diff --git a/reference/yaf/ini.xml b/reference/yaf/ini.xml index a7acf420cc..fb3903761b 100644 --- a/reference/yaf/ini.xml +++ b/reference/yaf/ini.xml @@ -227,12 +227,12 @@ - This value is "dev" by default, used for Yaf to fetch the config + This value is "product" by default, used for Yaf to fetch the config section of a ini config file. - That is, if this value is "dev", Yaf will use the section named "dev" - in the ini config file(the first parameter of the + That is, if this value is "product", Yaf will use the section named + "product" in the ini config file(the first parameter of the Yaf_Application) as the final config of the Yaf_Application. diff --git a/reference/yaf/yaf-loader.xml b/reference/yaf/yaf-loader.xml index b4abd16d4a..f79ece0de3 100644 --- a/reference/yaf/yaf-loader.xml +++ b/reference/yaf/yaf-loader.xml @@ -36,26 +36,38 @@ - + + Config example + + + -//Assuming the following local name space registerd: + Assuming the following local name space registerd: + + Register localnamespace + +registerLocalNameSpace(array("Foo", "Bar")); - } + public function _initLoader($dispatcher) { + Yaf_Loader::getInstance()->registerLocalNameSpace(array("Foo", "Bar")); + } ?> ]]> - + + - then the autoload examples: - + Then the autoload examples: + + Load class example + // APPLICATION_PATH/library/Foo/Bar/Test.php @@ -66,11 +78,13 @@ class GLO_Name => class BarNon_Test // /global_dir/Barnon/Test.php ]]> - + + - As of PHP 5.3, you can use namespace, in this case you need open the - yaf.use_namespace on, then: - + As of PHP 5.3, you can use namespace: + + Load namespace class example + // APPLICATION_PATH/library/Foo/Bar/Dummy.php @@ -78,8 +92,10 @@ class \Foo\Bar\Dummy => class \FooBar\Bar\Dummy => // /global_dir/FooBar/Bar/Dummy.php ]]> - + + + You may noticed that all the folder wth the first letter capitalized, you can make them lowercase by set yaf.lowcase_path = On in php.ini @@ -88,23 +104,28 @@ class \FooBar\Bar\Dummy => Yaf_Loader is also designed to load the MVC classes, and the rule is: - + + MVC class loading example + - // APPLICATION_PATH/controllers/ +// APPLICATION_PATH/controllers/ Model Classes => - // APPLICATION_PATH/models/ +// APPLICATION_PATH/models/ Plugin Classes => - // APPLICATION_PATH/plugins/ +// APPLICATION_PATH/plugins/ ]]> - + + Yaf identify a class's suffix(this is by default, you can also change to the prefix by change the configure yaf.name_suffix) to decide whether it is a MVC class: + + MVC class distinctions @@ -117,9 +138,12 @@ Plugin Classes => // ***Plugin ]]> + some examples: - + + MVC loading example + class A_B_TestModel => // APPLICATION_PATH/models/A/B/Test.php ]]> - + + also, the directory will be affected by yaf.lowcase_path. diff --git a/reference/yaf/yaf-router.xml b/reference/yaf/yaf-router.xml index dcb9fc1966..39be288dbc 100644 --- a/reference/yaf/yaf-router.xml +++ b/reference/yaf/yaf-router.xml @@ -27,13 +27,18 @@ on Rails routing and does not require any prior knowledge of webserver URL rewriting. It is designed to work with a single Apache mod_rewrite rule (one of): + + Rewrite rule for Apache + or (preferred): + + Rewrite rule for Apache + If using Lighttpd, the following rewrite rule is valid: + + Rewrite rule for Lighttpd + + If using Nginx, use the following rewrite rule: + + Rewrite rule for Nginx + + + + @@ -67,15 +94,20 @@ url.rewrite-once = ( module/controller/action. Finally, it will also match any additional parameters appended to the URI by default - controller/action/var1/value1/var2/value2. - - - Module name must be defined like application.module="Index,Foo,Bar" - in this case, only index, foo and bar can be considerd as a module name, - defaultly, there is only one module name "Index" was preconfigured. - - + + + Module name must be defined in config, considering application.module="Index,Foo,Bar", + in this case, only index, foo and bar can be considerd as a module name. + if doesn't config, there is only one module named "Index". + + + + Some examples of how such routes are matched: + + <classname>Yaf_Route_Static</classname>(default + route)example + diff --git a/reference/yaf/yaf_application/construct.xml b/reference/yaf/yaf_application/construct.xml index 97d68c9c1b..5537bf74f4 100644 --- a/reference/yaf/yaf_application/construct.xml +++ b/reference/yaf/yaf_application/construct.xml @@ -31,13 +31,51 @@ A ini config file path, or a config array + + If is a ini config file, there should be a section named as the one + defined by yaf.environ, which + is "product" by default. + + + And the config entry(and there default value) list blow: + + A ini config file example + + + + + envrion - + Which section will be loaded as the final config