svn: /phpdoc/en/trunk/reference/yaf/ ini.xml yaf-loader.xml

From: Date: Sat, 26 Nov 2011 05:49:49 +0000
Subject: svn: /phpdoc/en/trunk/reference/yaf/ ini.xml yaf-loader.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-9076@lists.php.net to get a copy of this message
laruence Sat, 26 Nov 2011 05:49:49 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=319901 Log: update docs Changed paths: U phpdoc/en/trunk/reference/yaf/ini.xml U phpdoc/en/trunk/reference/yaf/yaf-loader.xml Modified: phpdoc/en/trunk/reference/yaf/ini.xml =================================================================== --- phpdoc/en/trunk/reference/yaf/ini.xml 2011-11-26 05:19:57 UTC (rev 319900) +++ phpdoc/en/trunk/reference/yaf/ini.xml 2011-11-26 05:49:49 UTC (rev 319901) @@ -99,7 +99,8 @@ </term> <listitem> <para> - + The global library path, Yaf_loader will search global library in this + directory. </para> </listitem> </varlistentry> @@ -110,8 +111,12 @@ </term> <listitem> <para> - + If there is only one part in PATH_INFO, should it consider as a + controller or action. </para> + <para> + If this configure On, it will be considered as a Action name. + </para> </listitem> </varlistentry> <varlistentry xml:id="ini.yaf.lowcase-path"> @@ -121,7 +126,7 @@ </term> <listitem> <para> - + Whether lowercase all the path during the class autoloading. </para> </listitem> </varlistentry> @@ -154,8 +159,12 @@ </term> <listitem> <para> - + When this On, Yaf_Loader will indetify a class by it's suffix to decide + whether it is a MVC Class. </para> + <para> + When this Off, Yaf_Loader will look at the prefix of the class name. + </para> </listitem> </varlistentry> <varlistentry xml:id="ini.yaf.name-separator"> @@ -165,8 +174,13 @@ </term> <listitem> <para> - + When this is not empty, Yaf_Loader will identify the class suffix and + string value of this. </para> + <para> + For example, when this value is "_", Yaf_Loader will take Index_Controller as + a Controller Class, IndexController as a normal class. + </para> </listitem> </varlistentry> <varlistentry xml:id="ini.yaf.cache-config"> @@ -203,6 +217,18 @@ </listitem> </varlistentry> + <varlistentry xml:id="ini.yaf.use-namespace"> + <term> + <parameter>yaf.use_namespace</parameter> + <type>integer</type> + </term> + <listitem> + <para> + Only works as of PHP 5.3 + </para> + </listitem> + </varlistentry> + </variablelist> </para> </section> Modified: phpdoc/en/trunk/reference/yaf/yaf-loader.xml =================================================================== --- phpdoc/en/trunk/reference/yaf/yaf-loader.xml 2011-11-26 05:19:57 UTC (rev 319900) +++ phpdoc/en/trunk/reference/yaf/yaf-loader.xml 2011-11-26 05:49:49 UTC (rev 319901) @@ -23,7 +23,7 @@ <para> By default, <classname>Yaf_Loader</classname> assume all Class will store - in the <link linkend="yaf.configuration">global class + in the <link linkend="ini.yaf.library">global class directory</link>, which is defined in the php.ini(yaf.library). </para> @@ -69,7 +69,7 @@ </programlisting> As of PHP 5.3, you can use namespace, in this case you need open the - <link linkend="yaf.configuration">yaf.use_namespace</link> on, then: + <link linkend="ini.yaf.use-namespace">yaf.use_namespace</link> on, then: <programlisting role="bash"> <![CDATA[ class \Foo\Bar\Dummy => @@ -80,11 +80,63 @@ ]]> </programlisting> </para> - <para> You may noticed that all the folder wth the first letter capitalized, you can make them - lowercase by set <link linkend="yaf.configuration">yaf.lowcase_path</link> = On in php.ini + lowercase by set <link linkend="ini.yaf.lowcase-path">yaf.lowcase_path</link> = On in php.ini </para> + + <para> + <classname>Yaf_Loader</classname> is also designed to load the MVC classes, + and the rule is: + <programlisting role="bash"> +<![CDATA[ +Controller Classes => + // APPLICATION_PATH/controllers/ + +Model Classes => + // APPLICATION_PATH/models/ + +Plugin Classes => + // APPLICATION_PATH/plugins/ +]]> + </programlisting> + + Yaf identify a class's suffix(this is by default, you can also change to + the prefix by change the configure <link + linkend="ini.yaf.name-suffix">yaf.name_suffix</link>) to decide whether it + is a MVC class: + <programlisting role="bash"> +<![CDATA[ +Controller Classes => + // ***Controller + +Model Classes => + // ***Model + +Plugin Classes => + // ***Plugin +]]> + </programlisting> + + some examples: + <programlisting role="bash"> +<![CDATA[ +class IndexController + // APPLICATION_PATH/controllers/Index.php + +class DataModel => + // APPLICATION_PATH/models/Data.php + +class DummyPlugin => + // APPLICATION_PATH/plugins/Dummy.php + +class A_B_TestModel => + // APPLICATION_PATH/models/A/B/Test.php +]]> + </programlisting> + + also, the directory will be affected by <link linkend="ini.yaf.lowcase-path">yaf.lowcase_path</link>. + </para> </section> <!-- }}} -->

« previous php.doc.cvs (#9076) next »