cvs: phpdoc /en/language basic-syntax.xml

From: Date: Wed, 16 May 2001 15:19:26 +0000
Subject: cvs: phpdoc /en/language basic-syntax.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969335317@lists.php.net to get a copy of this message
jeroen Wed May 16 08:19:26 2001 EDT Modified files: /phpdoc/en/language basic-syntax.xml Log: - Begin with revision of language section. basic-syntax: - Added note about revision, and progress-info - Explained escaping a bit more eleborately - Explained escaping inside control structures (quite badly, I admit, but still) types: - Added null and resource - Categorized in scalars, compound and special - Added 'converting to xxx' section for boolean and integer (rest follows some day) - Moved 'when is something considered true' to that new section, and updated it. - Added overflow and converting notes to integer. Referred to float-precision warning. - Added section about resource-freeing - In type-juggling, referred to the new 'convert to xxx' sections. - fixed some xml-tags - converted most > to &gt; Index: phpdoc/en/language/basic-syntax.xml diff -u phpdoc/en/language/basic-syntax.xml:1.5 phpdoc/en/language/basic-syntax.xml:1.6 --- phpdoc/en/language/basic-syntax.xml:1.5 Thu May 10 11:01:14 2001 +++ phpdoc/en/language/basic-syntax.xml Wed May 16 08:19:25 2001 @@ -1,14 +1,65 @@ <chapter id="language.basic-syntax"> <title>Basic syntax</title> + <!-- + + NOTE: Last modified: 2001-05-16 13:00 GMT + + the language part is currently under heavy revision. Please do not + not make any heavy (i.e. structural) modifications to this part + for a moment. + + You'd also better not start any translation yet. + + Comments are always welcome at phpdoc@lists.php.net + + Progress: + + intro : DOESN'T EXIST - yet? + new chapter, with some introductionary remarks? + Will be discussed on the ML soon. + basic-syntax: + FISISHED + except maybe moving the 'advanced escaping' + to a better place? + TODO: + - nada + types : Being revised. Added all new types + Boolean and Integer are more or less finished. + The rest isn't. + TODO: + - why is $foo[bar] bad syntax? + - what's the difference between unset($bla) and + $bla = NULL (it is different!) + - $obj->{expr} syntax + - (unset) cast????? + - $bla = unset <== should've been nuked, don't mention it + - $str{offset} syntax, rather than $str[offset] + - read notes and apply when any of them are useful + - remove notes which have been included here. + - ... + the rest: Not yet started with. + TODO: + - ? + + --> + <sect1 id="language.basic-syntax.phpmode"> <title>Escaping from HTML</title> <para> - There are four ways of escaping from HTML and entering "PHP code - mode":</para> + When PHP starts to handle file, it will just output the text + it encouters. So if you have a HTML-file, and you change its + extension to .php, your file will keep working. + </para> <para> + If you want to insert php-statements at some point in your + file, you'll need to indicate so to php, by entering "PHP mode" + in either of the following ways: + </para> + + <para> <example> <title>Ways of escaping from HTML</title> <programlisting> @@ -53,7 +104,35 @@ <para> The closing tag for the block will include the immediately - trailing newline if one is present.</para></sect1> + trailing newline if one is present. + </para> + + <para> <!-- TODO: find a better place for this para --> + PHP allows you to use structures like this: + <example><title>Advanced escaping</title> + <programlisting role="php"> +&lt;?php + +if ( boolean-expression ) +{ + ?&gt; +&lt;strong&gt;This is true.&lt;/strong&gt; + &lt;?php +} +else +{ + ?&gt; +&lt;strong&gt;This is false.&lt;/strong&gt; + &lt;?php +} + </programlisting></example> + + This works as expected, because PHP handles text within ?&gt; and + &lt;?php as an <function>echo</function> statement. + <!-- without the parsing if vars, that is (hopefully?) obvious --> + </para> + + </sect1> <sect1 id="language.basic-syntax.instruction-separation"> <title>Instruction separation</title>

« previous php.doc (#969335317) next »