| 0 | array(2)« | tag | string(0) ""
| | value | string(568)« string(568) "<p>Note: Some code samples and HTML renderings in this manual are imaginary for ullistrative purpose only.
Though other samples marked as <span style="font-size:8pt; color:red; text-align:left">LIVE SAMPLE</span> are actual execution of the corresponding code.
You may see how clean and simple code to achieve rather complex results. This is the main feature what <em>Phella</em> was developed for.
Also you may try interactive <span style="font-size:8pt; color:red; text-align:left">LIVE SAMPLE</span> right from this document and see what result it generates.
"
|
|
| 1 | array(3)« | name | string(2) "h1"
| | value | string(44) "<a name="Introduction"><h1>Introduction</h1>"
| | attr-raw | string(0) ""
|
|
| 2 | array(2)« | tag | string(0) ""
| | value | string(863)« string(863) "
<p>Phella is the small footprint PHP framework. While with the additional plugins it may be scaled to much larger extent.
One of the most important plugins is CMS. It doesn't make Phella a boxed CMS but offers intellegent API to build a custom tuned CMS.
Though there is at least one ready made CMS approach supplied as a sample and completely working solution which already employed in several projects.
See more detailed description at <a href="http://www.phella.net">www.phella.net</a>.
<p>Phella was programmed for PHP4. At the moment this lines were written PHP4 was just stopped from further developmnet.
And yet it is still the most used PHP platform worldwide. Of cause Phella will work in PHP5 too. And there you can get a bit more flavour.
<p>Somebody may find style of programming in Phella a bit too loose. The very first code line says:
"
|
|
| 3 | array(3)« | name | string(4) "code"
| | value | string(326)« string(326) "<blockquote><code><font color="#000000">
<font color="#0000BB"><? error_reporting </font><font color="#007700">(</font><font color="#0000BB">E_ALL </font><font color="#007700">^ </font><font color="#0000BB">E_NOTICE</font><font color="#007700">) </font><font color="#0000BB">?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 4 | array(2)« | tag | string(0) ""
| | value | string(294)« string(294) "
<p>There are strong oppinions that such approach is not recommended. Yes, we aware of that.
And still after observation of all pro's and contra's we believe that simplicity and cleanless of the program is the most important feature.
For instance we can write the same thing in two ways:
"
|
|
| 5 | array(3)« | name | string(4) "code"
| | value | string(636)« string(636) "<blockquote><code><font color="#000000">
<font color="#0000BB"><?
<br /> </font><font color="#FF8000">/*1*/ </font><font color="#007700">if (isset(</font><font color="#0000BB">$variable</font><font color="#007700">) && !</font><font color="#0000BB">is_empty</font><font color="#007700">(</font><font color="#0000BB">$variable</font><font color="#007700">)) {...}
<br />
<br /> </font><font color="#FF8000">/*2*/ </font><font color="#007700">if (</font><font color="#0000BB">$variable</font><font color="#007700">) {...}
<br /></font><font color="#0000BB">?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 6 | array(2)« | tag | string(0) ""
| | value | string(600)« string(600) "
<p>The first line is theoretically more correct but the second is simplier.
Finally the more iportant is what goes for {...} and the "if" expression is <i>additional</i> condition.
This sample may be not impressive when you see it isolated but if program literally overloaded with such "technical" details
you hardly can get main logic of the program while browsing through the code.
We are in web stuff and if there empty value or non-existing variable the sense is the same in 99.99% cases.
If it an exception then work it differently but please leave the rest of the code "clean".
"
|
|
| 7 | array(3)« | name | string(2) "h1"
| | value | string(36) "<a name="Glossary"><h1>Glossary</h1>"
| | attr-raw | string(0) ""
|
|
| 8 | array(2)« | tag | string(0) ""
| | value | string(4) "
"
|
|
| 9 | array(3)« | name | string(2) "h3"
| | value | string(40) "<a name="Controller"><h3>Controller</h3>"
| | attr-raw | string(0) ""
|
|
| 10 | array(2)« | tag | string(0) ""
| | value | string(144)« string(144) "
<p>A PHP script which controls all workflow for the project. It is called on every web request and maintains all the tasks for this request.
"
|
|
| 11 | array(3)« | name | string(2) "h3"
| | value | string(32) "<a name="Module"><h3>Module</h3>"
| | attr-raw | string(0) ""
|
|
| 12 | array(2)« | tag | string(0) ""
| | value | string(164)« string(164) "
<p>A PHP script which provides functionality of the certain part of project. Modules usually don't have any visual output commands (unless it's a debug output).
"
|
|
| 13 | array(3)« | name | string(2) "h3"
| | value | string(36) "<a name="Template"><h3>Template</h3>"
| | attr-raw | string(0) ""
|
|
| 14 | array(2)« | tag | string(0) ""
| | value | string(424)« string(424) "
<p>A HTML document with PHP tags which generates visual presentation of the webpage.
<p>In fact 'modules' and 'templates' are the same type PHP scripts. Difference is only logical - 'modules' do calculations without output and 'templates' do output of calculated data. It is how presentation separated from functionality.
<p>It is also good to format 'modules' and 'templates' differently. 'Modules' as whole script:
"
|
|
| 15 | array(3)« | name | string(4) "code"
| | value | string(224)« string(224) "<blockquote><code><font color="#000000">
<font color="#0000BB"><?
<br />…
<br /></font><font color="#FF8000">/* PHP code lines */
<br /></font><font color="#0000BB">…
<br />?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 16 | array(2)« | tag | string(0) ""
| | value | string(65)« string(65) "
<p>And 'templates' as HTML documents with PHP embeddings:
"
|
|
| 17 | array(3)« | name | string(4) "code"
| | value | string(369)« string(369) "<blockquote><code><font color="#000000">
<html>
<br />…
<br /><center>This page has been accessed <font color="#0000BB"><?=$OUTPUT</font><font color="#007700">[</font><font color="#DD0000">"counter"</font><font color="#007700">]</font><font color="#0000BB">?></font> times.</center>
<br />…
<br /></html>
<br /></font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 18 | array(2)« | tag | string(0) ""
| | value | string(4) "
"
|
|
| 19 | array(3)« | name | string(2) "h3"
| | value | string(46) "<a name="Main Template"><h3>Main Template</h3>"
| | attr-raw | string(0) ""
|
|
| 20 | array(2)« | tag | string(0) ""
| | value | string(491)« string(491) "
<p>A template which generates main output for the requested webpage. Its name is passed in the web request to the Controller.
All other templates and modules used in the same request are just mounting chase for the main one. For instance when server gets request:
<blockquote>
http://www.domain.com/?template=home&lang=en
<br>or
<br>http://www.domain.com/?page=home&lang=en
</blockquote>
<p>the 'main template' with the name "home" will be invoked by the Controller.
"
|
|
| 21 | array(3)« | name | string(2) "h3"
| | value | string(54)« string(54) "<a name="Template Variable"><h3>Template Variable</h3>"
| | attr-raw | string(0) ""
|
|
| 22 | array(2)« | tag | string(0) ""
| | value | string(56)« string(56) "
<p>A query request variable which carries name of the "
|
|
| 23 | array(3)« | name | string(3) "ref"
| | value | string(42) "<a href="#main template">main template</a>"
| | attr-raw | string(0) ""
|
|
| 24 | array(2)« | tag | string(0) ""
| | value | string(327)« string(327) " requested by the user.
We may consider it as a name of the requested webpage. For instance:
<blockquote>
http://www.domain.com/?page=home&lang=en
</blockquote>
<p>In this sample 'template variable' is <var>page</var>. This name can be changed in the configuration file.
<p>In order to retreive name of the current "
|
|
| 25 | array(3)« | name | string(3) "ref"
| | value | string(42) "<a href="#main template">main template</a>"
| | attr-raw | string(0) ""
|
|
| 26 | array(2)« | tag | string(0) ""
| | value | string(301)« string(301) " we dicourage to use 'template variable' explicitly.
Let leave it only for URL appearance.
Enstead we advice to use definition <var>TEMPLATE</var> which always carries name of the current template disregarding of what 'template variable' is.
In other words this sample of what is not appreciated:
"
|
|
| 27 | array(3)« | name | string(4) "code"
| | value | string(432)« string(432) "<blockquote><code><font color="#000000">
<font color="#0000BB"><? </font><font color="#007700">if (</font><font color="#0000BB">$page</font><font color="#007700">==</font><font color="#DD0000">'home'</font><font color="#007700">): </font><font color="#0000BB">?>
<br /></font>...
<br /><font color="#0000BB"><? </font><font color="#007700">endif </font><font color="#0000BB">?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 28 | array(2)« | tag | string(0) ""
| | value | string(35) "
<p>Better to use this notation:
"
|
|
| 29 | array(3)« | name | string(4) "code"
| | value | string(435)« string(435) "<blockquote><code><font color="#000000">
<font color="#0000BB"><? </font><font color="#007700">if (</font><font color="#0000BB">TEMPLATE</font><font color="#007700">==</font><font color="#DD0000">'home'</font><font color="#007700">): </font><font color="#0000BB">?>
<br /></font>...
<br /><font color="#0000BB"><? </font><font color="#007700">endif </font><font color="#0000BB">?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 30 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 31 | array(3)« | name | string(2) "h3"
| | value | string(54)« string(54) "<a name="Synonymous Module"><h3>Synonymous Module</h3>"
| | attr-raw | string(0) ""
|
|
| 32 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 33 | array(3)« | name | string(2) "h3"
| | value | string(58)« string(58) "<a name="Synonymous Template"><h3>Synonymous Template</h3>"
| | attr-raw | string(0) ""
|
|
| 34 | array(2)« | tag | string(0) ""
| | value | string(399)« string(399) "
<p>In <em>Phella</em> each template assumes corresponding (pairing) module. It has the same name and called 'synonymous'.
When template invoked for output the synonymous module automatically called before to generate necessary data.
If synonymous module doesn't exist, there is no error will be generated.
It means template doesn't need any data to generate (or takes it from another source).
"
|
|
| 35 | array(3)« | name | string(2) "h3"
| | value | string(54)« string(54) "<a name="Standalone Module"><h3>Standalone Module</h3>"
| | attr-raw | string(0) ""
|
|
| 36 | array(2)« | tag | string(0) ""
| | value | string(170)« string(170) "
<p>A module which is not pared to any synonymous template.
It has to be called explicitly (or set in configuration file) when one needs functionality of such module.
"
|
|
| 37 | array(3)« | name | string(2) "h3"
| | value | string(44) "<a name="Sub-template"><h3>Sub-template</h3>"
| | attr-raw | string(0) ""
|
|
| 38 | array(2)« | tag | string(0) ""
| | value | string(285)« string(285) "
<p>A template which generates presentation output for the part of a webpage.
Sub-template may be called to be inserted into another template to utilize similar portions of output several times or in different pages.
The rule of synonymous modules applied to sub-templates either.
"
|
|
| 39 | array(3)« | name | string(2) "h3"
| | value | string(44) "<a name="Pre-template"><h3>Pre-template</h3>"
| | attr-raw | string(0) ""
|
|
| 40 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 41 | array(3)« | name | string(2) "h3"
| | value | string(46) "<a name="Post-template"><h3>Post-template</h3>"
| | attr-raw | string(0) ""
|
|
| 42 | array(2)« | tag | string(0) ""
| | value | string(57)« string(57) "
<p>Templates called by the Controller before and after "
|
|
| 43 | array(3)« | name | string(3) "ref"
| | value | string(42) "<a href="#main template">main template</a>"
| | attr-raw | string(0) ""
|
|
| 44 | array(2)« | tag | string(0) ""
| | value | string(124)« string(124) ". Rule of the synonymous modules applied to them either.
Presentation-wise we may consider them as "header" and "footer".
"
|
|
| 45 | array(3)« | name | string(2) "h3"
| | value | string(40) "<a name="Pre-module"><h3>Pre-module</h3>"
| | attr-raw | string(0) ""
|
|
| 46 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 47 | array(3)« | name | string(2) "h3"
| | value | string(42) "<a name="Post-module"><h3>Post-module</h3>"
| | attr-raw | string(0) ""
|
|
| 48 | array(2)« | tag | string(0) ""
| | value | string(250)« string(250) "
<p>Standalone modules called by the Controller right at the beginning and at the end of all web request flow.
These modules don't have any realtion to pre- and post-templates. Pre- and post-templates do have their own pairing synonymous modules.
"
|
|
| 49 | array(3)« | name | string(2) "h3"
| | value | string(56)« string(56) "<a name="Incoming Data Pool"><h3>Incoming Data Pool</h3>"
| | attr-raw | string(0) ""
|
|
| 50 | array(2)« | tag | string(0) ""
| | value | string(632)« string(632) "
<p>A PHP associative array $INPUT containing all incoming data necessary for business logic.
It organized similarly to PHP's arrays $_GET or $_POST, but contains variables accumulated from all kind of sources (GET, POST, cookies, session variables).
All security checks already done by the Controller, developer don't have to think about technical details how and where certain variable came from.
<p>$INPUT has global scope and available in any module and template by default.
It is unappreciated if any user-deifned module writes anything into this array to avoid potential bugs. Logically it is only for reading purposes.
"
|
|
| 51 | array(3)« | name | string(2) "h3"
| | value | string(56)« string(56) "<a name="Outgoing Data Pool"><h3>Outgoing Data Pool</h3>"
| | attr-raw | string(0) ""
|
|
| 52 | array(2)« | tag | string(0) ""
| | value | string(56)« string(56) "
<p>A PHP associative array $OUTPUT similar to $INPUT ("
|
|
| 53 | array(3)« | name | string(3) "ref"
| | value | string(52)« string(52) "<a href="#Incoming Data pool">Incoming Data pool</a>"
| | attr-raw | string(0) ""
|
|
| 54 | array(2)« | tag | string(0) ""
| | value | string(80)« string(80) "),
the main transport for exchanging data between modules and templates.
When "
|
|
| 55 | array(3)« | name | string(3) "ref"
| | value | string(28) "<a href="#module">module</a>"
| | attr-raw | string(0) ""
|
|
| 56 | array(2)« | tag | string(0) ""
| | value | string(56)« string(56) " called it stores generated data into this array.
Then "
|
|
| 57 | array(3)« | name | string(3) "ref"
| | value | string(32) "<a href="#template">template</a>"
| | attr-raw | string(0) ""
|
|
| 58 | array(2)« | tag | string(0) ""
| | value | string(62)« string(62) " uses data from the array to generate output presentation.
"
|
|
| 59 | array(3)« | name | string(2) "h1"
| | value | string(54)« string(54) "<a name="Data Flow Concept"><h1>Data Flow Concept</h1>"
| | attr-raw | string(0) ""
|
|
| 60 | array(2)« | tag | string(0) ""
| | value | string(646)« string(646) "
<p><em>Phella</em> provide abstraction layer above standard HTTP protocol.
All incoming (GET, POST, COOKIES) and stored (SESSION) data necessary for implementation of web request accumulated in one pool.
There will be no information in the pool how particular piece of data came.
All necessary security checks already done by <em>Phella</em> and developer may use data for business logic as it is.
The name of the array is <var>$INPUT</var> and it's accessible in every module and template automatically.
<p>There is similar output data pool which holds data generated by the scripts.
This data may be used for generating HTML output (in "
|
|
| 61 | array(3)« | name | string(3) "ref"
| | value | string(32) "<a href="#template">template</a>"
| | attr-raw | string(0) ""
|
|
| 62 | array(2)« | tag | string(0) ""
| | value | string(48) "s) and exchanging information between different "
|
|
| 63 | array(3)« | name | string(3) "ref"
| | value | string(28) "<a href="#module">module</a>"
| | attr-raw | string(0) ""
|
|
| 64 | array(2)« | tag | string(0) ""
| | value | string(1425)« string(1425) "s.
The array's name is <var>$OUTPUT</var>.
<p><var>$INPUT</var> and <var>$OUTPUT</var> arrays declared global but while you processing scope is inside function you obviously have to declare them global again.
According to the our main terms of "simplicity" addition declaration is hassle. It may be forgotten either.
That why we decided to give you one may be arguable but powerful option.
We provide you super-global aliases for <var>$INPUT</var> and <var>$OUTPUT</var> array which no need to be declared inside the functions.
The alias for <var>$INPUT</var> is <var>$_GET</var> and alias for <var>$OUTPUT</var> is <var>$_POST</var>.
<p>Yes, it means that we spoiled all initial data in <var>$_GET</var> and <var>$_POST</var> arrays and utilized them for our needs.
Remember that we designed Phella covering HTTP protocol for you and that why you don't actually need <var>$_GET</var> and <var>$_POST</var> arrays for the purpose they were designed in lower level of PHP programming.
Though for the sake of debugging you still may find original low level content of these arrays in <var>$_GET['_GET']</var> and <var>$_POST['_POST']</var>.
See configuration options how to activate and handle this behavior.
<p>Mechanism of global variables has nothing bad in it's nature if its well organized.
For those who has religious tabu not to touch global variables in PHP at all we offer kosher class wrapper.
If module "
|
|
| 65 | array(3)« | name | string(3) "ref"
| | value | string(54)« string(54) "<a href="#module phella_class">module phella_class</a>"
| | attr-raw | string(0) ""
|
|
| 66 | array(2)« | tag | string(0) ""
| | value | string(726)« string(726) " is included (see <var>$CONFIG['pre-module']</var> in the <a href="http://www.phella.net/?page=config">config file</a> for that) than you can use:
<table>
<tr><td><var>phella::input('var')</var><td>===<td><var>$INPUT['var']</var>
<tr><td><var>phella::inputSet('var',$val)</var><td>===<td><var>$INPUT['var']=$val</var>
<tr><td><var>phella::output('var1','var2')</var><td>===<td><var>$OUTPUT['var1']['var1']</var>
<tr><td><var>phella::outputSet('var1','var2',$val)</var><td>===<td><var>$OUTPUT['var1']['var1']=$val</var>
</table>
<p>As you can guess this wrapper works for PHP4. More elegant PHP5 wrapper is coming soon.
Need to note that we do not encorage using "wild" global variables other from those we provide.
"
|
|
| 67 | array(3)« | name | string(2) "h2"
| | value | string(86)« string(86) "<a name="Working with Sessions and Cookies"><h2>Working with Sessions and Cookies</h2>"
| | attr-raw | string(0) ""
|
|
| 68 | array(2)« | tag | string(0) ""
| | value | string(544)« string(544) "
<p>As was said above Phella was made to place layer between developer and HTTP protocol.
It means that session variables and cookies are not an exception here and coming into the common pool of input data together with GET and POST.
Variables which suppose to be stored in the sessions and/or cookies should be listed in the <a href="http://www.phella.net/?page=config">config file</a>
(see <var>$CONFIG['session-vars']</var> and <var>$CONFIG['cookie-vars']</var>).
<p>For instance we declared variable "sort" as a session variable:
"
|
|
| 69 | array(3)« | name | string(4) "code"
| | value | string(628)« string(628) "<blockquote><code><font color="#000000">
<font color="#0000BB"><?
<br /> $CONFIG</font><font color="#007700">[</font><font color="#DD0000">'session-vars'</font><font color="#007700">][</font><font color="#DD0000">'sort'</font><font color="#007700">] = array(</font><font color="#DD0000">'valid'</font><font color="#007700">=>array(</font><font color="#DD0000">'none'</font><font color="#007700">,</font><font color="#DD0000">'asc'</font><font color="#007700">,</font><font color="#DD0000">'desc'</font><font color="#007700">));
<br /></font><font color="#0000BB">?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 70 | array(2)« | tag | string(0) ""
| | value | string(1187)« string(1187) "
<p>It means that (1) session mechanism automatically starts,
(2) <var>$INPUT['sort']</var> initialised to the current value from session or to "none" by default.
If client supplies another value through GET or POST channel, then it will be taken and stored in the session.
<p>So once you declared variable a session you may forget it.
Phella Controller will handle all validations and back-end operations for sessions and cookies.
<p>All said above concerns only "public" variables which client may change at his own wish.
There are also may be "private" variables which client may not manipulate freely, for instance authorization state of the client.
In this case such variable (1) should not be declared in <var>$CONFIG['session-vars']</var>,
(2) to avoid any possible security damage such variable should carry dot in its name.
For instance you will have variable <var>$INPUT['.authorized']</var> automatically retrived from the session storage while client may never ammend it directly.
Presence of a dot symbol at the beginning makes clear idiomatic impression of a "private" data, we ecourage such custom.
<p>To store explicitly "private" variable in the session use "
|
|
| 71 | array(3)« | name | string(3) "ref"
| | value | string(54)« string(54) "<a href="#phella_sess_store()">phella_sess_store()</a>"
| | attr-raw | string(0) ""
|
|
| 72 | array(2)« | tag | string(0) ""
| | value | string(5) ".
"
|
|
| 73 | array(3)« | name | string(2) "h2"
| | value | string(62)« string(62) "<a name="Working with Markdown"><h2>Working with Markdown</h2>"
| | attr-raw | string(0) ""
|
|
| 74 | array(2)« | tag | string(0) ""
| | value | string(443)« string(443) "
<p>Because of small footprint Phella good not only for the heavy programmed websites but pretty static ones too.
It is much easier to develop and maintain them within a framework than "raw".
If there is a lot of content to carry we offer Markdown to publish the texts.
Thoughe WYSIWYG is also available but Markdown is our preffered solution.
See our <a href="http://www.phella.net/?page=approach">Approaches</a> if wonder why.
<p>In "
|
|
| 75 | array(3)« | name | string(3) "ref"
| | value | string(50) "<a href="#Synonymous Module">Synonymous Module</a>"
| | attr-raw | string(0) ""
|
|
| 76 | array(2)« | tag | string(0) ""
| | value | string(1604)« string(1604) " we showed you that each webpage or Template comes with the pairing Module of the same name.
Together with Markdown this pair extends to a triade.
Well quite often Markdown page doesn't need its own functionaly module if its only static text.
To simplify explanation instead of triade Markdown-Template-Module lets talk about pair Markdown-Template,
the other member works as usual.
<p>First what you need is to activate Markdown functionality in <a href="http://www.phella.net/?page=config">config file</a>.
See <var>$CONFIG['source-prefix']</var> and <var>$CONFIG['source-suffix']</var> which work very same as
<var>$CONFIG['template-prefix']</var> and <var>$CONFIG['template-suffix']</var>.
<p>If Phella detects Markdown source it processes it and stores to the HTML cache which actually is the Template in our terms.
Not every webpage have to be done in Markdown, some of them may have usual HTML/PHP source in the Templates.
It is no need to specify which page is in Markdown and which is HTML, everything detected on the fly.
Markdown itself also allows HTML and PHP embeddings.
<p>Phella automatically regenarates cache (Template) if Markdown source has been ammended.
Abviously there is one condition that Templates (which work as a cache now) have to be "writable" for your webserver
(user "nobody", "www" or else). This may be good reason to arrange templates in a separate "writable" directory
see (<var>$CONFIG['template-prefix']</var>).
<p>The rest of the functionality is very transparent. You don't have to pay special attention is it a Markdown page or generic HTML.
"
|
|
| 77 | array(3)« | name | string(2) "h2"
| | value | string(56)« string(56) "<a name="Working with Cache"><h2>Working with Cache</h2>"
| | attr-raw | string(0) ""
|
|
| 78 | array(2)« | tag | string(0) ""
| | value | string(180)« string(180) "
<p>Phella provide three different kinds of caching mechanism.
They are independed and used for different puproses. That why theoretically they can be combined very wildly.
"
|
|
| 79 | array(3)« | name | string(2) "h3"
| | value | string(44) "<a name="Static cache"><h3>Static cache</h3>"
| | attr-raw | string(0) ""
|
|
| 80 | array(2)« | tag | string(0) ""
| | value | string(1552)« string(1552) "
<p>Each webpage in Phella combined at least from 3 parts.
Even if pages are not really dynamic but any way PHP invoked every time to put together footer, body and header.
Phella footprint is so small that it takes practically the same resources if the operation was done in plain PHP without any framework.
But even here you can be more savvy.
You can switch on static cache mechanism and since that first invoke of the page will create plain HTML cache and all other calls will be
directed to this cache. Nor Phella neither any other single PHP code line will be invoked.
All call will go through your webserver only to a static HTML file.
<p>In fact you can develop the website on your working station, export it to plain HTML files and upload only them to the production server.
You don't need Phella and even PHP itself on the server.
Well it is a bit exaggerated sample, any website need a bit of dynamic stuff (contact form for instance).
But we believe you got the point.
<p>Static cache works in conjuction with re-write mechanism (though re-write can be used alone without cache).
As you remember re-write purpose is to mimic dynamic pages as static.
Then if switched both it not only mimics the page but actually stores it to the disk.
And then sinse the file exits it actually used instead of dynamic call.
<p>See <var>$CONFIG['cache-prefix']</var> to trigger cache and <var>$CONFIG['rewrite-encode']</var> to setup re-write rules.
There is also sample of the Apache ".htaccess" file provided with the re-write rules.
"
|
|
| 81 | array(3)« | name | string(2) "h3"
| | value | string(52)« string(52) "<a name="Fractional cache"><h3>Fractional cache</h3>"
| | attr-raw | string(0) ""
|
|
| 82 | array(2)« | tag | string(0) ""
| | value | string(711)« string(711) "
<p>The cache is good when it saves heavy load to the database if data updated less frequently than read.
Alas there is always some dynamic surrounding for the data (rotated banners, counters, etc.).
It means no avail to cache whole webpage. Then we offer so called fractional cache.
<p>Certain chunks of the webpage may be cached in plain HTML files.
If corresponding data in the database was modified then cache file automatically removed.
On the next read call it will be created again from the fresh data.
<p>Fractional Cache also involves default re-write mechanism (see <var>$CONFIG['rewrite-encode']</var>).
Usually formed chunks of templates we include into the common template using function "
|
|
| 83 | array(3)« | name | string(3) "ref"
| | value | string(48) "<a href="#phella_include()">phella_include()</a>"
| | attr-raw | string(0) ""
|
|
| 84 | array(2)« | tag | string(0) ""
| | value | string(62)« string(62) ".
If we want this chunk to be cached then we include it with "
|
|
| 85 | array(3)« | name | string(3) "ref"
| | value | string(60)« string(60) "<a href="#phella_include_cache()">phella_include_cache()</a>"
| | attr-raw | string(0) ""
|
|
| 86 | array(2)« | tag | string(0) ""
| | value | string(81)« string(81) ".
See also <var>$CONFIG['fract-cache-prefix']</var> to define cache storage.
"
|
|
| 87 | array(3)« | name | string(2) "h3"
| | value | string(48) "<a name="Markdown cache"><h3>Markdown cache</h3>"
| | attr-raw | string(0) ""
|
|
| 88 | array(2)« | tag | string(0) ""
| | value | string(143)« string(143) "
<p>This cache is a bit different nature from the previous two. It doesn't create HTML file per se.
Instead it creates a PHP file which is "
|
|
| 89 | array(3)« | name | string(3) "ref"
| | value | string(32) "<a href="#Template">Template</a>"
| | attr-raw | string(0) ""
|
|
| 90 | array(2)« | tag | string(0) ""
| | value | string(120)« string(120) " in our terms.
Well most likely this Template will consist of only HTML tags with no PHP code but theoreticaly it is a "
|
|
| 91 | array(3)« | name | string(3) "ref"
| | value | string(32) "<a href="#Template">Template</a>"
| | attr-raw | string(0) ""
|
|
| 92 | array(2)« | tag | string(0) ""
| | value | string(52)« string(52) ".
And in theory it can be cached further down to a "
|
|
| 93 | array(3)« | name | string(3) "ref"
| | value | string(40) "<a href="#Static Cache">Static Cache</a>"
| | attr-raw | string(0) ""
|
|
| 94 | array(2)« | tag | string(0) ""
| | value | string(96)« string(96) " for instance.
<p>Markdown cache used always if Markdown functionality triggered on.
See also "
|
|
| 95 | array(3)« | name | string(3) "ref"
| | value | string(58)« string(58) "<a href="#Working with Markdown">Working with Markdown</a>"
| | attr-raw | string(0) ""
|
|
| 96 | array(2)« | tag | string(0) ""
| | value | string(38) " to understand how we employ it.
"
|
|
| 97 | array(3)« | name | string(2) "h1"
| | value | string(30) "<a name="Setup"><h1>Setup</h1>"
| | attr-raw | string(0) ""
|
|
| 98 | array(2)« | tag | string(0) ""
| | value | string(4) "
"
|
|
| 99 | array(3)« | name | string(2) "h2"
| | value | string(46) "<a name="Default Setup"><h2>Default Setup</h2>"
| | attr-raw | string(0) ""
|
|
| 100 | array(2)« | tag | string(0) ""
| | value | string(1082)« string(1082) "
<p>Developer has to organize website in that way so all request were going to the Controller.
<em>Phella</em> comes with a sample of <var>index.php</var> file which do the task.
Normally one has to drop it into the website root directory without any changes.
<p>Suppose you have a root directory for your website at <var>~/public_html</var>. Then <var>index.php</var> should appear as:
<blockquote>
~/public_html/index.php
</blockquote>
<p>Another file <var>config.php</var> normally also goes together with <var>index.php</var> in the same directory.
Sample of the configuration file is also supplied.
<blockquote>
~/public_html/config.php
</blockquote>
<p>Read trough all <a href="http://www.phella.net/?page=config">config file</a> as it is well commented and gives you idea what you can tune up for your project.
The following explanation is good if configuration file used as it is supplied.
<p>Copy engine directory "phella" to corresponding sub-directory:
<blockquote>
~/public_html/phella/
</blockquote>
<p>Create header for your project:
"
|
|
| 101 | array(3)« | name | string(4) "code"
| | value | string(372)« string(372) "<blockquote><code><font color="#000000">
<html>
<br /> <head>
<br /> <font color="#0000BB"><?=phella_head</font><font color="#007700">()</font><font color="#0000BB">?>
<br /></font> </head>
<br /> <body>
<br /></font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 102 | array(2)« | tag | string(0) ""
| | value | string(115)« string(115) "
<p>Save it to:
<blockquote>
~/public_html/head.tpl.php
</blockquote>
<p>Create footer for your project:
"
|
|
| 103 | array(3)« | name | string(4) "code"
| | value | string(109)« string(109) "<blockquote><code><font color="#000000">
</body>
<br /></html>
<br /></font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 104 | array(2)« | tag | string(0) ""
| | value | string(131)« string(131) "
<p>Save it to:
<blockquote>
~/public_html/foot.tpl.php
</blockquote>
<p>Create home page and write in some sample text:
"
|
|
| 105 | array(3)« | name | string(4) "code"
| | value | string(313)« string(313) "<blockquote><code><font color="#000000">
<p>Hello world!</p>
<br /><p>Today is <font color="#0000BB"><?=$OUTPUT</font><font color="#007700">[</font><font color="#DD0000">'date'</font><font color="#007700">]</font><font color="#0000BB">?></font></p>
<br /></font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 106 | array(2)« | tag | string(0) ""
| | value | string(164)« string(164) "
<p>Save it to:
<blockquote>
~/public_html/home.tpl.php
</blockquote>
<p>Now create a business module for the home page carring all complex calculations:
"
|
|
| 107 | array(3)« | name | string(4) "code"
| | value | string(410)« string(410) "<blockquote><code><font color="#000000">
<font color="#0000BB"><?
<br /> $OUTPUT</font><font color="#007700">[</font><font color="#DD0000">'date'</font><font color="#007700">]= </font><font color="#0000BB">date</font><font color="#007700">(</font><font color="#DD0000">'l, F jS, Y'</font><font color="#007700">);
<br /></font><font color="#0000BB">?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 108 | array(2)« | tag | string(0) ""
| | value | string(365)« string(365) "
<p>Save it to:
<blockquote>
~/public_html/home.mod.php
</blockquote>
<p>Here it is! One page website is ready to run. Call it http://localhost or http://www.mysite.com or whatever else your webserver configured.
The most easy way to produce all the steps above is to copy our provided source as it is with all directory tree into your ~/public_html/.
"
|
|
| 109 | array(3)« | name | string(2) "h2"
| | value | string(44) "<a name="Custom Setup"><h2>Custom Setup</h2>"
| | attr-raw | string(0) ""
|
|
| 110 | array(2)« | tag | string(0) ""
| | value | string(849)« string(849) "
<p>A lot of custom ajustments may be done in <a href="http://www.phella.net/?page=config">config file</a>.
Read it and get an idea. Here we just name several.
<p>Remember that some modules and templates have to have the same names (synonimous).
For instance the page "home" consists of two files. You may give them different suffixes/preffixes or store in different folders:
<blockquote>
~/public_html/home.tpl.php
<br>
~/public_html/home.mod.php
</blockquote>
<p>or
<blockquote>
~/public_html/templates/home.php
<br>
~/public_html/modules/home.php
</blockquote>
<p>Note that if you don't need any specific functionality for the webpage, you may omit corresponding module file at all.
<p>Do the setup in configuration file accordingly the way you store templates and modules. In first case it should be:
"
|
|
| 111 | array(3)« | name | string(4) "code"
| | value | string(1035)« string(1035) "<blockquote><code><font color="#000000">
<font color="#0000BB"><?
<br /> $CONFIG</font><font color="#007700">[</font><font color="#DD0000">"template-prefix"</font><font color="#007700">] = </font><font color="#DD0000">""</font><font color="#007700">;
<br /> </font><font color="#0000BB">$CONFIG</font><font color="#007700">[</font><font color="#DD0000">"template-suffix"</font><font color="#007700">] = </font><font color="#DD0000">".tpl.php"</font><font color="#007700">;
<br /> </font><font color="#0000BB">$CONFIG</font><font color="#007700">[</font><font color="#DD0000">"module-prefix"</font><font color="#007700">] = </font><font color="#DD0000">""</font><font color="#007700">;
<br /> </font><font color="#0000BB">$CONFIG</font><font color="#007700">[</font><font color="#DD0000">"module-suffix"</font><font color="#007700">] = </font><font color="#DD0000">".mod.php"</font><font color="#007700">;
<br /></font><font color="#0000BB">?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 112 | array(2)« | tag | string(0) ""
| | value | string(35) "
<p>And for the second case:
"
|
|
| 113 | array(3)« | name | string(4) "code"
| | value | string(1045)« string(1045) "<blockquote><code><font color="#000000">
<font color="#0000BB"><?
<br /> $CONFIG</font><font color="#007700">[</font><font color="#DD0000">"template-prefix"</font><font color="#007700">] = </font><font color="#DD0000">"templates/"</font><font color="#007700">;
<br /> </font><font color="#0000BB">$CONFIG</font><font color="#007700">[</font><font color="#DD0000">"template-suffix"</font><font color="#007700">] = </font><font color="#DD0000">".php"</font><font color="#007700">;
<br /> </font><font color="#0000BB">$CONFIG</font><font color="#007700">[</font><font color="#DD0000">"module-prefix"</font><font color="#007700">] = </font><font color="#DD0000">"modules/"</font><font color="#007700">;
<br /> </font><font color="#0000BB">$CONFIG</font><font color="#007700">[</font><font color="#DD0000">"module-suffix"</font><font color="#007700">] = </font><font color="#DD0000">".php"</font><font color="#007700">;
<br /></font><font color="#0000BB">?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 114 | array(2)« | tag | string(0) ""
| | value | string(4) "
"
|
|
| 115 | array(3)« | name | string(2) "h2"
| | value | string(44) "<a name="Shared Setup"><h2>Shared Setup</h2>"
| | attr-raw | string(0) ""
|
|
| 116 | array(2)« | tag | string(0) ""
| | value | string(176)« string(176) "
<p>One <em>Phella</em> engine may serve one or several projects on a shared hosting.
In the chapter above we used dedicated installation. Configuration for that will be:
"
|
|
| 117 | array(3)« | name | string(4) "code"
| | value | string(580)« string(580) "<blockquote><code><font color="#000000">
<font color="#0000BB"><?
<br /> $CONFIG</font><font color="#007700">[</font><font color="#DD0000">"system-prefix"</font><font color="#007700">] = </font><font color="#DD0000">"phella/"</font><font color="#007700">;
<br /> </font><font color="#0000BB">$CONFIG</font><font color="#007700">[</font><font color="#DD0000">"system-suffix"</font><font color="#007700">] = </font><font color="#DD0000">".php"</font><font color="#007700">;
<br /></font><font color="#0000BB">?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 118 | array(2)« | tag | string(0) ""
| | value | string(167)« string(167) "
In order to share one Phella installation to different virtual websites you need to copy "phella" directory to some other directory on the server.
For instance:
"
|
|
| 119 | array(3)« | name | string(4) "code"
| | value | string(588)« string(588) "<blockquote><code><font color="#000000">
<font color="#0000BB"><?
<br /> $CONFIG</font><font color="#007700">[</font><font color="#DD0000">"system-prefix"</font><font color="#007700">] = </font><font color="#DD0000">"/shared/phella/"</font><font color="#007700">;
<br /> </font><font color="#0000BB">$CONFIG</font><font color="#007700">[</font><font color="#DD0000">"system-suffix"</font><font color="#007700">] = </font><font color="#DD0000">".php"</font><font color="#007700">;
<br /></font><font color="#0000BB">?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 120 | array(2)« | tag | string(0) ""
| | value | string(436)« string(436) "
<p>Note that if you use leading slash in prefixes it means file system root directory.
Without slash it means current directory, where "index.php" is.
<p>Among shared PHP code which used within the server Phella has some HTTP shared resources such as images and JavaScripts.
They are stored within the directory set in <var>$CONFIG["system-prefix"]</var>.
To form a HTTP link to such resource you need to use something like:
"
|
|
| 121 | array(3)« | name | string(4) "code"
| | value | string(463)« string(463) "<blockquote><code><font color="#000000">
<script language="JavaScript" src="<font color="#0000BB"><?=phella_href</font><font color="#007700">(</font><font color="#DD0000">'(shared)'</font><font color="#007700">,</font><font color="#DD0000">'document'</font><font color="#007700">,</font><font color="#DD0000">'calendar/calendar.js'</font><font color="#007700">)</font><font color="#0000BB">?></font>"></script>
<br /></font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 122 | array(2)« | tag | string(0) ""
| | value | string(818)« string(818) "
<p>This samples shows how to embed a calendar script.
<p>By default all the resources go through Phella's internal mechanism.
This may influence performance in bad way as soon as browser may deside not to cache them.
In this case we advise to give shared Phella directory direct HTTP access through your web server setup.
If variable <var>$CONFIG['shared-http']</var> set to something non-empty, this will be used as prefix for URL to shared resources.
Note that <var>$CONFIG["system-prefix"]</var> is the server filesystem path and <var>$CONFIG['shared-http']</var> is URL path.
In the default setup they are the same but it is not a common case.
<p>If you run a webserver with virtual websites than you provide access to shared Phella through two channels: filesystem and web interface.
For instance:
"
|
|
| 123 | array(3)« | name | string(4) "code"
| | value | string(856)« string(856) "<blockquote><code><font color="#000000">
<font color="#0000BB"><?
<br /> $CONFIG</font><font color="#007700">[</font><font color="#DD0000">"system-prefix"</font><font color="#007700">] = </font><font color="#DD0000">"/clients/shared/phella/"</font><font color="#007700">;
<br /> </font><font color="#0000BB">$CONFIG</font><font color="#007700">[</font><font color="#DD0000">"system-suffix"</font><font color="#007700">] = </font><font color="#DD0000">".php"</font><font color="#007700">;
<br /> </font><font color="#0000BB">$CONFIG</font><font color="#007700">[</font><font color="#DD0000">"shared-http"</font><font color="#007700">] = </font><font color="#DD0000">"http://www.myhosting.com/shared/phella/"</font><font color="#007700">;
<br /></font><font color="#0000BB">?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 124 | array(2)« | tag | string(0) ""
| | value | string(103)« string(103) "
<p>If you use something like Apache's ALIAS setup you can do it more personalized for your clients:
"
|
|
| 125 | array(3)« | name | string(4) "code"
| | value | string(187)« string(187) "<blockquote><code><font color="#000000">
<IfModule mod_alias.c>
<br /> Alias /phella/ "/clients/shared/phella/"
<br /></IfModule>
<br /></font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 126 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 127 | array(3)« | name | string(4) "code"
| | value | string(825)« string(825) "<blockquote><code><font color="#000000">
<font color="#0000BB"><?
<br /> $CONFIG</font><font color="#007700">[</font><font color="#DD0000">"system-prefix"</font><font color="#007700">] = </font><font color="#DD0000">"/clients/shared/phella/"</font><font color="#007700">;
<br /> </font><font color="#0000BB">$CONFIG</font><font color="#007700">[</font><font color="#DD0000">"system-suffix"</font><font color="#007700">] = </font><font color="#DD0000">".php"</font><font color="#007700">;
<br /> </font><font color="#0000BB">$CONFIG</font><font color="#007700">[</font><font color="#DD0000">"shared-http"</font><font color="#007700">] = </font><font color="#DD0000">"/phella/"</font><font color="#007700">;
<br /></font><font color="#0000BB">?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 128 | array(2)« | tag | string(0) ""
| | value | string(4) "
"
|
|
| 129 | array(3)« | name | string(2) "h1"
| | value | string(88)« string(88) "<a name="Plugin Modules and their Functions"><h1>Plugin Modules and their Functions</h1>"
| | attr-raw | string(0) ""
|
|
| 130 | array(2)« | tag | string(0) ""
| | value | string(10) "
"
|
|
| 131 | array(3)« | name | string(2) "h2"
| | value | string(42) "<a name="Core Module"><h2>Core Module</h2>"
| | attr-raw | string(0) ""
|
|
| 132 | array(2)« | tag | string(0) ""
| | value | string(189)« string(189) "
<p>Core module responsible for basic functionality of the Phella Framework.
Some of the most used functions may have another short form.
In order to activate them you need to include "
|
|
| 133 | array(3)« | name | string(3) "ref"
| | value | string(54)« string(54) "<a href="#module phella_short">module phella_short</a>"
| | attr-raw | string(0) ""
|
|
| 134 | array(2)« | tag | string(0) ""
| | value | string(131)« string(131) " module
(see <var>$CONFIG['pre-module']</var> in the <a href="http://www.phella.net/?page=config">config file</a> for that).
"
|
|
| 135 | array(3)« | name | string(2) "h3"
| | value | string(52)« string(52) "<a name="phella_include()"><h3>phella_include()</h3>"
| | attr-raw | string(0) ""
|
|
| 136 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 137 | array(3)« | name | string(6) "syntax"
| | value | string(78)« string(78) "<p class=func>mixed phella_include(string Template [, arg1 [, …[, argN]]])</p>"
| | attr-raw | string(0) ""
|
|
| 138 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 139 | array(3)« | name | string(6) "syntax"
| | value | string(58)« string(58) "<p class=func><i>synonym [phella_short]:</i> insert(…)</p>"
| | attr-raw | string(0) ""
|
|
| 140 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 141 | array(3)« | name | string(6) "syntax"
| | value | string(67)« string(67) "<p class=func><i>synonym [phella_class]:</i> phella::include(…)</p>"
| | attr-raw | string(0) ""
|
|
| 142 | array(2)« | tag | string(0) ""
| | value | string(67)« string(67) "
<p>Includes in the place where this function encountered another "
|
|
| 143 | array(3)« | name | string(3) "ref"
| | value | string(32) "<a href="#template">template</a>"
| | attr-raw | string(0) ""
|
|
| 144 | array(2)« | tag | string(0) ""
| | value | string(4) " or "
|
|
| 145 | array(3)« | name | string(3) "ref"
| | value | string(40) "<a href="#sub-template">sub-template</a>"
| | attr-raw | string(0) ""
|
|
| 146 | array(2)« | tag | string(0) ""
| | value | string(19) " in this case.
If "
|
|
| 147 | array(3)« | name | string(3) "ref"
| | value | string(50) "<a href="#synonymous module">synonymous module</a>"
| | attr-raw | string(0) ""
|
|
| 148 | array(2)« | tag | string(0) ""
| | value | string(85)« string(85) " exists it will be included automatically right before including this sub-template.
"
|
|
| 149 | array(3)« | name | string(4) "code"
| | value | string(327)« string(327) "<blockquote><code><font color="#000000">
... some HTML text ...
<br /><font color="#0000BB"><? phella_include</font><font color="#007700">(</font><font color="#DD0000">'some_other_name'</font><font color="#007700">) </font><font color="#0000BB">?>
<br /></font>... rest of HTML text ...
<br /></font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 150 | array(2)« | tag | string(0) ""
| | value | string(63)« string(63) "
<p>Or using alternative "short" notation (available with the "
|
|
| 151 | array(3)« | name | string(3) "ref"
| | value | string(54)« string(54) "<a href="#module phella_short">module phella_short</a>"
| | attr-raw | string(0) ""
|
|
| 152 | array(2)« | tag | string(0) ""
| | value | string(4) "):
"
|
|
| 153 | array(3)« | name | string(4) "code"
| | value | string(319)« string(319) "<blockquote><code><font color="#000000">
... some HTML text ...
<br /><font color="#0000BB"><? insert</font><font color="#007700">(</font><font color="#DD0000">'some_other_name'</font><font color="#007700">) </font><font color="#0000BB">?>
<br /></font>... rest of HTML text ...
<br /></font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 154 | array(2)« | tag | string(0) ""
| | value | string(495)« string(495) "
<p>The sub-template will have separate scope of variables. Only global variables $INPUT and $OUTPUT always available.
If it's necessary to pass parameters in to the sub-template, $OUTPUT may be used for this task.
<p>Let see one of the common sample. You output all pictures on your website in some kind fancy frame.
It is like 5-7 lines of HTML code which are good to move in a separate template "framed_pic".
The only we need to pass there is picture file name. See how it may be done:
"
|
|
| 155 | array(3)« | name | string(4) "code"
| | value | string(977)« string(977) "<blockquote><code><font color="#000000">
... some HTML text ...
<br /><font color="#0000BB"><? $OUTPUT</font><font color="#007700">[</font><font color="#DD0000">'pic'</font><font color="#007700">] = </font><font color="#DD0000">'pic1.jpg' </font><font color="#007700">) </font><font color="#0000BB">?>
<br /><? insert</font><font color="#007700">(</font><font color="#DD0000">'framed_pic'</font><font color="#007700">) </font><font color="#0000BB">?>
<br /></font>... some other HTML text ...
<br /><font color="#0000BB"><? $OUTPUT</font><font color="#007700">[</font><font color="#DD0000">'pic'</font><font color="#007700">] = </font><font color="#DD0000">'pic2.jpg' </font><font color="#007700">) </font><font color="#0000BB">?>
<br /><? insert</font><font color="#007700">(</font><font color="#DD0000">'framed_pic'</font><font color="#007700">) </font><font color="#0000BB">?>
<br /></font>... rest of HTML text ...
<br /></font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 156 | array(2)« | tag | string(0) ""
| | value | string(149)« string(149) "
<p>But if parameters have very local meaning (like in this sample) it may be cleaner for the algorithm and business logic not to store them in the "
|
|
| 157 | array(3)« | name | string(3) "ref"
| | value | string(38) "<a href="#output pool">output pool</a>"
| | attr-raw | string(0) ""
|
|
| 158 | array(2)« | tag | string(0) ""
| | value | string(83)« string(83) ".
Then it is possible to pass parameters locally using <var>arg1, …, argN</var>.
"
|
|
| 159 | array(3)« | name | string(4) "code"
| | value | string(806)« string(806) "<blockquote><code><font color="#000000">
... some HTML text ...
<br /><font color="#0000BB"><? insert</font><font color="#007700">(</font><font color="#DD0000">'framed_pic'</font><font color="#007700">, </font><font color="#DD0000">'pic1.jpg'</font><font color="#007700">, </font><font color="#DD0000">'left'</font><font color="#007700">) </font><font color="#0000BB">?>
<br /></font>... some other HTML text ...
<br /><font color="#0000BB"><? insert</font><font color="#007700">(</font><font color="#DD0000">'framed_pic'</font><font color="#007700">, </font><font color="#DD0000">'pic2.jpg'</font><font color="#007700">, </font><font color="#DD0000">'right'</font><font color="#007700">) </font><font color="#0000BB">?>
<br /></font>... rest of HTML text ...
<br /></font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 160 | array(2)« | tag | string(0) ""
| | value | string(77)« string(77) "
<p>To retrieve such 'local' arguments within the sub-template use function "
|
|
| 161 | array(3)« | name | string(3) "ref"
| | value | string(50) "<a href="#phella_get_args()">phella_get_args()</a>"
| | attr-raw | string(0) ""
|
|
| 162 | array(2)« | tag | string(0) ""
| | value | string(3) ":
"
|
|
| 163 | array(3)« | name | string(4) "code"
| | value | string(717)« string(717) "<blockquote><code><font color="#000000">
<font color="#0000BB"><? $src</font><font color="#007700">=</font><font color="#0000BB">phella_get_args</font><font color="#007700">(</font><font color="#0000BB">1</font><font color="#007700">) </font><font color="#0000BB">?>
<br /><? $align</font><font color="#007700">=</font><font color="#0000BB">phella_get_args</font><font color="#007700">(</font><font color="#0000BB">2</font><font color="#007700">) </font><font color="#0000BB">?>
<br /></font>... some HTML text ...
<br /><img src="<font color="#0000BB"><?=$src?></font>" align="<font color="#0000BB"><?=$align?></font>">
<br />... rest of HTML text ...
<br /></font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 164 | array(2)« | tag | string(0) ""
| | value | string(356)« string(356) "
<p>In order to stop processing of the sub-template before it reached its end, one may use <var>return</var> directive. Directive <var>exit</var> will abort all PHP processing including <em>Phella</em> Controller.
<p>Technically it is possible to return a value from sub-template to the caller template, but we don't see any practical use for it.
"
|
|
| 165 | array(3)« | name | string(2) "h3"
| | value | string(44) "<a name="phella_use()"><h3>phella_use()</h3>"
| | attr-raw | string(0) ""
|
|
| 166 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 167 | array(3)« | name | string(6) "syntax"
| | value | string(72)« string(72) "<p class=func>mixed phella_use(string module [, arg1 [, …[, argN]]])</p>"
| | attr-raw | string(0) ""
|
|
| 168 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 169 | array(3)« | name | string(6) "syntax"
| | value | string(58)« string(58) "<p class=func><i>synonym [phella_short]:</i> module(…)</p>"
| | attr-raw | string(0) ""
|
|
| 170 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 171 | array(3)« | name | string(6) "syntax"
| | value | string(63)« string(63) "<p class=func><i>synonym [phella_class]:</i> phella::use(…)</p>"
| | attr-raw | string(0) ""
|
|
| 172 | array(2)« | tag | string(0) ""
| | value | string(15) "
<p>Calls for "
|
|
| 173 | array(3)« | name | string(3) "ref"
| | value | string(52)« string(52) "<a href="#stand-alone module">stand-alone module</a>"
| | attr-raw | string(0) ""
|
|
| 174 | array(2)« | tag | string(0) ""
| | value | string(28) ".
Usage is very similar to "
|
|
| 175 | array(3)« | name | string(3) "ref"
| | value | string(48) "<a href="#phella_include()">phella_include()</a>"
| | attr-raw | string(0) ""
|
|
| 176 | array(2)« | tag | string(0) ""
| | value | string(94)« string(94) ", apart that there is no rule of synonymous module applied for obvious reason.
Remember that "
|
|
| 177 | array(3)« | name | string(3) "ref"
| | value | string(28) "<a href="#module">module</a>"
| | attr-raw | string(0) ""
|
|
| 178 | array(2)« | tag | string(0) ""
| | value | string(8) " unlike "
|
|
| 179 | array(3)« | name | string(3) "ref"
| | value | string(32) "<a href="#template">template</a>"
| | attr-raw | string(0) ""
|
|
| 180 | array(2)« | tag | string(0) ""
| | value | string(172)« string(172) " doesn't suppose to generate any output.
Basically it is called only to get extended functionality and/or prepare some data.
<p>There is one difference in behaviour with "
|
|
| 181 | array(3)« | name | string(3) "ref"
| | value | string(48) "<a href="#phella_include()">phella_include()</a>"
| | attr-raw | string(0) ""
|
|
| 182 | array(2)« | tag | string(0) ""
| | value | string(257)« string(257) ".
Phella searches for the module in the directory where all the custom modules reside for this project.
If it is not there than Phella attempts to find it in the core directory. If it neither there then error will be generated.
Phella never searches for "
|
|
| 183 | array(3)« | name | string(3) "ref"
| | value | string(32) "<a href="#template">template</a>"
| | attr-raw | string(0) ""
|
|
| 184 | array(2)« | tag | string(0) ""
| | value | string(81)« string(81) " in the core directory as soon it is no such thing like "system templates".
"
|
|
| 185 | array(3)« | name | string(2) "h3"
| | value | string(54)« string(54) "<a name="phella_get_args()"><h3>phella_get_args()</h3>"
| | attr-raw | string(0) ""
|
|
| 186 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 187 | array(3)« | name | string(6) "syntax"
| | value | string(48) "<p class=func>mixed phella_get_args([int n])</p>"
| | attr-raw | string(0) ""
|
|
| 188 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 189 | array(3)« | name | string(6) "syntax"
| | value | string(67)« string(67) "<p class=func><i>synonym [phella_class]:</i> phella::getArgs(…)</p>"
| | attr-raw | string(0) ""
|
|
| 190 | array(2)« | tag | string(0) ""
| | value | string(87)« string(87) "
<p>This function retrieves arguments passed to a template or module with functions "
|
|
| 191 | array(3)« | name | string(3) "ref"
| | value | string(48) "<a href="#phella_include()">phella_include()</a>"
| | attr-raw | string(0) ""
|
|
| 192 | array(2)« | tag | string(0) ""
| | value | string(4) " or "
|
|
| 193 | array(3)« | name | string(3) "ref"
| | value | string(40) "<a href="#phella_use()">phella_use()</a>"
| | attr-raw | string(0) ""
|
|
| 194 | array(2)« | tag | string(0) ""
| | value | string(126)« string(126) ".
Returned value is an array of passed values. If argument <var>n</var> supplied then the single Nth argument returned.
"
|
|
| 195 | array(3)« | name | string(2) "h3"
| | value | string(46) "<a name="phella_href()"><h3>phella_href()</h3>"
| | attr-raw | string(0) ""
|
|
| 196 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 197 | array(3)« | name | string(6) "syntax"
| | value | string(89)« string(89) "<p class=func>string phella_href([string template], [var1, val1 [, …[, varN, valN]]])</p>"
| | attr-raw | string(0) ""
|
|
| 198 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 199 | array(3)« | name | string(6) "syntax"
| | value | string(69)« string(69) "<p class=func>string phella_href([string template], [array vars])</p>"
| | attr-raw | string(0) ""
|
|
| 200 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 201 | array(3)« | name | string(6) "syntax"
| | value | string(54)« string(54) "<p class=func><i>synonym [phella_short]:</i>url(…)</p>"
| | attr-raw | string(0) ""
|
|
| 202 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 203 | array(3)« | name | string(6) "syntax"
| | value | string(64)« string(64) "<p class=func><i>synonym [phella_class]:</i> phella::href(…)</p>"
| | attr-raw | string(0) ""
|
|
| 204 | array(2)« | tag | string(0) ""
| | value | string(464)« string(464) "
<p>Returns qualified URL for another page in the project. <var>Template</var> stays for the template name.
If it's omitted or empty string passed then current template (the page where it was called) will be used.
Other query variables and its values given by pair of arguments, or in associative array.
<p>For example we need to get URL:
<blockquote>
index.php?template=product&group=common&id=234#mark
</blockquote>
<p>Then use function:
"
|
|
| 205 | array(3)« | name | string(4) "code"
| | value | string(631)« string(631) "<blockquote><code><font color="#000000">
<font color="#0000BB"><?=url</font><font color="#007700">(</font><font color="#DD0000">"product"</font><font color="#007700">, </font><font color="#DD0000">"group"</font><font color="#007700">, </font><font color="#DD0000">"common"</font><font color="#007700">, </font><font color="#DD0000">"id"</font><font color="#007700">, </font><font color="#0000BB">234</font><font color="#007700">, </font><font color="#DD0000">"#"</font><font color="#007700">, </font><font color="#DD0000">"mark"</font><font color="#007700">)</font><font color="#0000BB">?></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 206 | array(2)« | tag | string(0) ""
| | value | string(13) "
<p>or
"
|
|
| 207 | array(3)« | name | string(4) "code"
| | value | string(1021)« string(1021) "<blockquote><code><font color="#000000">
<font color="#0000BB"><?
<br />$query</font><font color="#007700">=array();
<br /></font><font color="#0000BB">$query</font><font color="#007700">[</font><font color="#DD0000">"group"</font><font color="#007700">]= </font><font color="#DD0000">"common"</font><font color="#007700">;
<br /></font><font color="#0000BB">$query</font><font color="#007700">[</font><font color="#DD0000">"id"</font><font color="#007700">]= </font><font color="#0000BB">234</font><font color="#007700">;
<br /></font><font color="#0000BB">$query</font><font color="#007700">[</font><font color="#DD0000">"#"</font><font color="#007700">]= </font><font color="#DD0000">"mark"</font><font color="#007700">;
<br />
<br /></font><font color="#0000BB">url</font><font color="#007700">(</font><font color="#DD0000">"product"</font><font color="#007700">, </font><font color="#0000BB">$query</font><font color="#007700">);
<br /></font><font color="#0000BB">?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 208 | array(2)« | tag | string(0) ""
| | value | string(98)« string(98) "
<p>Hash sign may appear at any place of the list, it will be always rendered at the end.
"
|
|
| 209 | array(3)« | name | string(2) "h3"
| | value | string(54)« string(54) "<a name="phella_href_add()"><h3>phella_href_add()</h3>"
| | attr-raw | string(0) ""
|
|
| 210 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 211 | array(3)« | name | string(6) "syntax"
| | value | string(72)« string(72) "<p class=func>string phella_href_add(var1, val1 [, …[, varN, valN]])</p>"
| | attr-raw | string(0) ""
|
|
| 212 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 213 | array(3)« | name | string(6) "syntax"
| | value | string(52)« string(52) "<p class=func>string phella_href_add(array vars)</p>"
| | attr-raw | string(0) ""
|
|
| 214 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 215 | array(3)« | name | string(6) "syntax"
| | value | string(59)« string(59) "<p class=func><i>synonym [phella_short]:</i> url_add(…)</p>"
| | attr-raw | string(0) ""
|
|
| 216 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 217 | array(3)« | name | string(6) "syntax"
| | value | string(67)« string(67) "<p class=func><i>synonym [phella_class]:</i> phella::hrefAdd(…)</p>"
| | attr-raw | string(0) ""
|
|
| 218 | array(2)« | tag | string(0) ""
| | value | string(30) "
<p>Function is similar to "
|
|
| 219 | array(3)« | name | string(3) "ref"
| | value | string(42) "<a href="#phella_href()">phella_href()</a>"
| | attr-raw | string(0) ""
|
|
| 220 | array(2)« | tag | string(0) ""
| | value | string(256)« string(256) " but always uses current template and all current query variables already passed.
<p>Examples:
<p>Suppose we have template processed from the URL:
<blockquote>
index.php?template=product&group=common&id=234
</blockquote>
<p>and used
"
|
|
| 221 | array(3)« | name | string(4) "code"
| | value | string(308)« string(308) "<blockquote><code><font color="#000000">
<font color="#0000BB"><?=url_add</font><font color="#007700">(</font><font color="#DD0000">"sort"</font><font color="#007700">, </font><font color="#DD0000">"desc"</font><font color="#007700">);</font><font color="#0000BB">?></font>
</font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 222 | array(2)« | tag | string(0) ""
| | value | string(267)« string(267) "
<p>Then it will generate URL:
<blockquote>
index.php?template=product&group=common&id=234&sort=desc
</blockquote>
<p>If variable passed with the name which already exist in current quiery, then it overwrites old value with the new one.
"
|
|
| 223 | array(3)« | name | string(2) "h3"
| | value | string(54)« string(54) "<a name="phella_redirect()"><h3>phella_redirect()</h3>"
| | attr-raw | string(0) ""
|
|
| 224 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 225 | array(3)« | name | string(6) "syntax"
| | value | string(93)« string(93) "<p class=func>string phella_redirect([string template], [var1, val1 [, …[, varN, valN]]])</p>"
| | attr-raw | string(0) ""
|
|
| 226 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 227 | array(3)« | name | string(6) "syntax"
| | value | string(74)« string(74) "<p class=func>string phella_redirect([string template], [array query])</p>"
| | attr-raw | string(0) ""
|
|
| 228 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 229 | array(3)« | name | string(6) "syntax"
| | value | string(60)« string(60) "<p class=func><i>synonym [phella_short]:</i> redirect(…)</p>"
| | attr-raw | string(0) ""
|
|
| 230 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 231 | array(3)« | name | string(6) "syntax"
| | value | string(68)« string(68) "<p class=func><i>synonym [phella_class]:</i> phella::redirect(…)</p>"
| | attr-raw | string(0) ""
|
|
| 232 | array(2)« | tag | string(0) ""
| | value | string(117)« string(117) "
<p>Redirects current webpage to the new one using HTML header <var>Location</var>.
All arguments are same as in "
|
|
| 233 | array(3)« | name | string(3) "ref"
| | value | string(42) "<a href="#phella_href()">phella_href()</a>"
| | attr-raw | string(0) ""
|
|
| 234 | array(2)« | tag | string(0) ""
| | value | string(183)« string(183) ".
In <em>Phella</em> one doesn't have to worry about any output done before sending the header.
Redirection will be implemented any way even template already produced some data.
"
|
|
| 235 | array(3)« | name | string(4) "code"
| | value | string(455)« string(455) "<blockquote><code><font color="#000000">
...Some HTML Code...
<br /><font color="#0000BB"><? </font><font color="#007700">if (</font><font color="#0000BB">$special_condition</font><font color="#007700">) </font><font color="#0000BB">phella_redirect</font><font color="#007700">(</font><font color="#DD0000">"other_page"</font><font color="#007700">); </font><font color="#0000BB">?>
<br /></font>...Rest of HTML...
<br /></font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 236 | array(2)« | tag | string(0) ""
| | value | string(99)« string(99) "
<p>As alternative for redirection one may use cloaking trick. See how to use it in example:
"
|
|
| 237 | array(3)« | name | string(4) "code"
| | value | string(436)« string(436) "<blockquote><code><font color="#000000">
<font color="#0000BB"><? </font><font color="#007700">if (</font><font color="#0000BB">$special_condition</font><font color="#007700">) return </font><font color="#0000BB">phella_include</font><font color="#007700">(</font><font color="#DD0000">"other_page"</font><font color="#007700">); </font><font color="#0000BB">?>
<br /></font>...Some HTML Code...
<br /></font>
</code></blockquote>"
| | attr-raw | string(0) ""
|
|
| 238 | array(2)« | tag | string(0) ""
| | value | string(120)« string(120) "
<p>Difference between those two is the address line in the browser. It will state "other_page" or initial one.
"
|
|
| 239 | array(3)« | name | string(2) "h3"
| | value | string(58)« string(58) "<a name="phella_sess_store()"><h3>phella_sess_store()</h3>"
| | attr-raw | string(0) ""
|
|
| 240 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 241 | array(3)« | name | string(2) "h3"
| | value | string(62)« string(62) "<a name="phella_cookie_store()"><h3>phella_cookie_store()</h3>"
| | attr-raw | string(0) ""
|
|
| 242 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 243 | array(3)« | name | string(6) "syntax"
| | value | string(66)« string(66) "<p class=func>void phella_sess_store(string name, mixed value)</p>"
| | attr-raw | string(0) ""
|
|
| 244 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 245 | array(3)« | name | string(6) "syntax"
| | value | string(68)« string(68) "<p class=func>void phella_cookie_store(string name, mixed value)</p>"
| | attr-raw | string(0) ""
|
|
| 246 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 247 | array(3)« | name | string(6) "syntax"
| | value | string(69)« string(69) "<p class=func><i>synonym [phella_class]:</i> phella::sessStore(…)</p>"
| | attr-raw | string(0) ""
|
|
| 248 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 249 | array(3)« | name | string(6) "syntax"
| | value | string(71)« string(71) "<p class=func><i>synonym [phella_class]:</i> phella::cookieStore(…)</p>"
| | attr-raw | string(0) ""
|
|
| 250 | array(2)« | tag | string(0) ""
| | value | string(379)« string(379) "
<p>These function explicitly store data in session pool or in cookies.
The functions used only for secure data (for instance trigger of authorization).
Publicly accessible insecure session variables should be described in configuration file and work automatically.
Recovery data from the session and cookie cache goes automatically for secure and insecure variables.
See "
|
|
| 251 | array(3)« | name | string(3) "ref"
| | value | string(82)« string(82) "<a href="#Working with Sessions and Cookies">Working with Sessions and Cookies</a>"
| | attr-raw | string(0) ""
|
|
| 252 | array(2)« | tag | string(0) ""
| | value | string(24) " fro more details.
"
|
|
| 253 | array(3)« | name | string(2) "h3"
| | value | string(64)« string(64) "<a name="phella_include_cache()"><h3>phella_include_cache()</h3>"
| | attr-raw | string(0) ""
|
|
| 254 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 255 | array(3)« | name | string(6) "syntax"
| | value | string(96)« string(96) "<p class=func>string phella_include_cache(string template, [var1, val1 [, …[, varN, valN]]])</p>"
| | attr-raw | string(0) ""
|
|
| 256 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 257 | array(3)« | name | string(6) "syntax"
| | value | string(76)« string(76) "<p class=func>string phella_include_cache(string template, [array vars])</p>"
| | attr-raw | string(0) ""
|
|
| 258 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 259 | array(3)« | name | string(6) "syntax"
| | value | string(72)« string(72) "<p class=func><i>synonym [phella_class]:</i> phella::includeCache(…)</p>"
| | attr-raw | string(0) ""
|
|
| 260 | array(2)« | tag | string(0) ""
| | value | string(46) "
<p>Purpose of this function is similar to "
|
|
| 261 | array(3)« | name | string(3) "ref"
| | value | string(48) "<a href="#phella_include()">phella_include()</a>"
| | attr-raw | string(0) ""
|
|
| 262 | array(2)« | tag | string(0) ""
| | value | string(276)« string(276) "
with the only difference it caches its content and uses cache when it available.
<p>Arguments for the function have different meaning either.
They are not passed data into the template but list of dependencies.
The template may have content depending on those data.
See "
|
|
| 263 | array(3)« | name | string(3) "ref"
| | value | string(42) "<a href="#phella_href()">phella_href()</a>"
| | attr-raw | string(0) ""
|
|
| 264 | array(2)« | tag | string(0) ""
| | value | string(70)« string(70) " for explanation of arguments, the notation is the same.
<p>See also "
|
|
| 265 | array(3)« | name | string(3) "ref"
| | value | string(48) "<a href="#Fractional Cache">Fractional Cache</a>"
| | attr-raw | string(0) ""
|
|
| 266 | array(2)« | tag | string(0) ""
| | value | string(42) " chapter to understand how it works.
"
|
|
| 267 | array(3)« | name | string(2) "h3"
| | value | string(60)« string(60) "<a name="phella_clear_cache()"><h3>phella_clear_cache()</h3>"
| | attr-raw | string(0) ""
|
|
| 268 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 269 | array(3)« | name | string(6) "syntax"
| | value | string(94)« string(94) "<p class=func>string phella_clear_cache(string template, [var1, val1 [, …[, varN, valN]]])</p>"
| | attr-raw | string(0) ""
|
|
| 270 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 271 | array(3)« | name | string(6) "syntax"
| | value | string(74)« string(74) "<p class=func>string phella_clear_cache(string template, [array vars])</p>"
| | attr-raw | string(0) ""
|
|
| 272 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 273 | array(3)« | name | string(6) "syntax"
| | value | string(70)« string(70) "<p class=func><i>synonym [phella_class]:</i> phella::clearCache(…)</p>"
| | attr-raw | string(0) ""
|
|
| 274 | array(2)« | tag | string(0) ""
| | value | string(44) "
<p>The function clears cache created by "
|
|
| 275 | array(3)« | name | string(3) "ref"
| | value | string(60)« string(60) "<a href="#phella_include_cache()">phella_include_cache()</a>"
| | attr-raw | string(0) ""
|
|
| 276 | array(2)« | tag | string(0) ""
| | value | string(146)« string(146) ".
Arguments notation is the same. The best place to call this function is the module where database updated, new records inserted or deleted.
"
|
|
| 277 | array(3)« | name | string(2) "h3"
| | value | string(48) "<a name="phella_email()"><h3>phella_email()</h3>"
| | attr-raw | string(0) ""
|
|
| 278 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 279 | array(3)« | name | string(6) "syntax"
| | value | string(92)« string(92) "<p class=func>string phella_email(string Email [, string Display [, string AddHtml ] ] )</p>"
| | attr-raw | string(0) ""
|
|
| 280 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 281 | array(3)« | name | string(6) "syntax"
| | value | string(57)« string(57) "<p class=func><i>synonym [phella_short]:</i> email(…)</p>"
| | attr-raw | string(0) ""
|
|
| 282 | array(2)« | tag | string(0) ""
| | value | string(326)« string(326) "
<p>Simple Java script scrambler for protection against email harvesting bots.
<p><var>Display</var> is the text within <A>...</A> tags. If ommited <var>Email</var> will be used.
<p><var>AddHtml</var> is additional HTML properties for the <A ... > tag (style, class, etc.).
<p>See usage and its output:
"
|
|
| 283 | array(4)« | name | string(9) "code_exec"
| | value | string(633)« string(633) "<blockquote><code><font color="#000000">
<p>This is what user sees:
<br /><br><font color="#0000BB"><?=phella_email</font><font color="#007700">(</font><font color="#DD0000">"info@phella.net"</font><font color="#007700">)</font><font color="#0000BB">?>
<br /></font><p>This is what bot sees:
<br /><br><font color="#0000BB"><?=htmlspecialchars</font><font color="#007700">( </font><font color="#0000BB">phella_email</font><font color="#007700">(</font><font color="#DD0000">"info@phella.net"</font><font color="#007700">) )</font><font color="#0000BB">?>
<br /></font>
</font>
</code></blockquote>"
| | attr-raw | string(25) "style="text-align:center""
| | code | string(161)« string(161) "
<p>This is what user sees:
<br><?=phella_email("info@phella.net")?>
<p>This is what bot sees:
<br><?=htmlspecialchars( phella_email("info@phella.net") )?>
"
|
|
| 284 | array(2)« | tag | string(0) ""
| | value | string(6) "
"
|
|
| 285 | array(4)« | name | string(2) "h3"
| | value | string(52)« string(52) "<a name="phella_control()"><h3>phella_control()</h3>"
| | attr-raw | string(0) ""
| | code | string(161)« string(161) "
<p>This is what user sees:
<br><?=phella_email("info@phella.net")?>
<p>This is what bot sees:
<br><?=htmlspecialchars( phella_email("info@phella.net") )?>
"
|
|
| 286 | array(2)« | tag | string(0) ""
| | value | string(2) "
"
|
|
| 287 | array(4)« | name | string(6) "syntax"
| | value | string(67)« string(67) "<p class=func>mixed phella_control(string Key [, mixed Value ])</p>"
| | attr-raw | string(0) ""
| | code | string(161)« string(161) "
<p>This is what user sees:
<br><?=phella_email("info@phella.net")?>
<p>This is what bot sees:
<br><?=htmlspecialchars( phella_email("info@phella.net") )?>
"
|
|
| 288 | array(2) |