File: basic-syntax.xml

package info (click to toggle)
phpdoc 20020310-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 35,272 kB
  • ctags: 354
  • sloc: xml: 799,767; php: 1,395; cpp: 500; makefile: 200; sh: 140; awk: 51
file content (221 lines) | stat: -rw-r--r-- 6,589 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<?xml version="1.0" encoding="iso-8859-2"?>
<!-- EN-Revision: 1.19 Maintainer: Yagood Status: ready -->
<!-- $Revision: 1.7 $ -->
  <chapter id="language.basic-syntax">
   <title>Podstawowa skadnia</title>

   <!--

    UWAGA:			Ostatnia modyfikacja: 2001-05-16 13:00 GMT
				Tumaczenie	    : 2001-10-12 18:48 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:
	     FINISHED
	     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:
	      - ?
     oop   : has been revised by Kristian, DONE.
   -->

   <sect1 id="language.basic-syntax.phpmode">
    <title>Wyskakiwanie z HTMLa</title>

    <para>
     Kiedy PHP zaczyna przetwarza plik, po prostu wywietla tekst,
     ktry napotka. Zatem, jeli zmienisz rozszerzenie pliku HTML na .php,
     ten plik bdzie dziaa nadal.
    </para>

    <para>
     Jeli chcesz wstawi komendy PHP w jakim miejscu w swoim dokumencie
     musisz to zasygnalizowa, wchodzc w "tryb PHP" ktrym ze sposobw
     podanych poniej:
    </para>

    <para>
     <example>
      <title>Moliwoci wyskoczenia z HTMLa</title>
      <programlisting role="php">
1.  &lt;? echo ("To jest najprostszy test, instrukcja SGML\n"); ?&gt;
    &lt;?= wyraenie ?&gt; To jest skrt takiej formy: "&lt;? echo wyraenie ?&gt;"

2.  &lt;?php echo("Jeli chcesz uywa dokumentw XHTML i XML, rb to tak\n"); ?&gt;

3.  &lt;script language="php"&gt;
	echo ("Niektre edytory (jak FrontPage)
	      nie lubi instrukcji wchodzcych w 'tryb PHP'");
    &lt;/script&gt;

4.  &lt;% echo ("Moesz take uy znacznikw w stylu ASP"); %&gt;
    &lt;%= $variable; # To jest skrt takiej formy: "&lt;%echo .." %&gt;
      </programlisting>
     </example>
    </para>

    <para>
     Pierwszy sposb jest dostpny tylko kiedy zostay wczone krtkie
     znaczniki. Mona to zrobi
     <!-- funkcj <function>short_tags</function>,-->
     wpisujc <link linkend="ini.short-open-tag">short_open_tag</link>
     do pliku konfiguracyjnego PHP albo kompilujc PHP dodajc
     --enable-short-tags do <command>configure</command>.
    </para>

    <para>
     Drugi sposb jest preferowany, zapewnia on nastpnej generacji XHTMLa
     atw implementacj w PHP.
    </para>

    <para>
     Czwarty sposb jest dostpny tylko kiedy znaczniki ASP zostay
     wczone poprzez uaktywnianie opcji
     konfiguracyjnej <link linkend="ini.asp-tags">asp_tags</link>.

    <note>
     <para>Obsuga dla znacznikw ASP zostaa dodana w wersji 3.0.4.</para>
    </note></para>

    <para>
     Znacznik zamykajcy blok bdzie dodawa kocow
     now lini, jeli taka istnieje.
    </para>

    <para> <!-- TODO: find a better place for this para -->
     PHP pozawala ci uywa takich struktur:
     <example><title>Zaawansowane wyskakiwanie</title>
     <programlisting role="php">
&lt;?php

if (wyrazenie-logiczne) {
    ?&gt;
&lt;strong&gt;prawda &lt;/strong&gt;
    &lt;?php
} else {
    ?&gt;
&lt;strong&gt;fasz &lt;/strong&gt;
    &lt;?php
}
    ?&gt;
     </programlisting></example>

     Powyszy kod dziaa, poniewa PHP traktuje tekst pomidzy ?&gt; i
     &lt;?php jak gdyby bya to funkcja <function>echo</function>.
     <!-- without the parsing if vars, that is (hopefully?) obvious -->
    </para>

   </sect1>

   <sect1 id="language.basic-syntax.instruction-separation">
    <title>Oddzielanie instrukcji</title>

    <simpara>
     Instrukcje s oddzielane tak samo jak w C czy Perlu - naley koczy
     kade wyraenie rednikiem.
    </simpara>

    <para>
     Znacznik zamykajcy (?&gt;) take koczy instrukcj, wic ponisze
     przykady s rwnowane:

     <informalexample>
      <programlisting role="php">
&lt;?php
    echo "To jest test";
?>

&lt;?php echo "To jest test" ?>
      </programlisting>
     </informalexample></para></sect1>

   <sect1 id="language.basic-syntax.comments">
    <title>Kometarze</title>

    <para>
     PHP obsuguje komentarze w stylu C, C++ oraz komentarze uywane
     w powokach uniksowych ("#"):

     <informalexample>
      <programlisting role="php">
&lt;?php
    echo "To jest test"; // to jest kometarz jednoliniowy w stylu C++
    /* to jest komentarz wieloliniowy
       a tutaj inna komentowana linia */
    echo "To jest jeszcze jeden test";
    echo "Ostatni test"; # to jest kometarz w stylu shell'a
?>
     </programlisting>
    </informalexample></para>

    <simpara>
     Komentarze typu jednoliniowego maj zasig do koca linii w ktrej si
     znajduj lub do koca bloku kodu PHP, zalenie co wystpi pierwsze.
    </simpara>
     <informalexample><programlisting role="php">
&lt;h1>To jest &lt;?php # echo "prosty";?> przykad.&lt;/h1>
&lt;p>Powyszy kod wypisze zdanie "To jest przykad."
     </programlisting></informalexample>

    <simpara>
     Powniene uwaa by nie zagnieda komentarzy w stylu C++
     (szczeglnie komentarzy wieloliniowych), co moe si sta kiedy
     komentujesz duszy blok kodu.</simpara>

    <informalexample><programlisting role="php">
&lt;?php
 /*
    echo "To jest test"; /* ten komentarz spowoduje problem */
 */
?>
    </programlisting></informalexample></sect1>
  </chapter>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->