diff --git a/reference/yaf/yaf-bootstrap-abstract.xml b/reference/yaf/yaf-bootstrap-abstract.xml index b8d6ec03e3..a742ca0777 100644 --- a/reference/yaf/yaf-bootstrap-abstract.xml +++ b/reference/yaf/yaf-bootstrap-abstract.xml @@ -12,7 +12,17 @@
&reftitle.intro; - + Bootstrap is a mechanism used to do some intial config before a + Application run. + + + User may define their own Bootstrap class by inheriting + Yaf_Bootstrap_Abstract + + + Any method declared in Bootstrap class with leading "_init", will be + called by Yaf_Application::bootstrap one by one + according to their defined order.
diff --git a/reference/yaf/yaf-view-simple.xml b/reference/yaf/yaf-view-simple.xml index 7f7588237f..032493b687 100644 --- a/reference/yaf/yaf-view-simple.xml +++ b/reference/yaf/yaf-view-simple.xml @@ -12,7 +12,9 @@
&reftitle.intro; - + Yaf_View_Simple is the built-in template engine in + Yaf, it is a simple but fast template engine, and only support PHP script + template.
diff --git a/reference/yaf/yaf_application/bootstrap.xml b/reference/yaf/yaf_application/bootstrap.xml index 11e485416a..45b0bba322 100644 --- a/reference/yaf/yaf_application/bootstrap.xml +++ b/reference/yaf/yaf_application/bootstrap.xml @@ -15,7 +15,7 @@ Run a Bootstrap, all the methods defined in the Bootstrap and named with - prefix "_init" will be called in the declaration order, if the parameter bootstrap is not supplied, Yaf will look + prefix "_init" will be called according to their declaration order, if the parameter bootstrap is not supplied, Yaf will look for a Bootstrap under application.directory. &warn.undocumented.func; diff --git a/reference/yaf/yaf_view_simple/assign.xml b/reference/yaf/yaf_view_simple/assign.xml index beec1ddeab..490c77abf1 100644 --- a/reference/yaf/yaf_view_simple/assign.xml +++ b/reference/yaf/yaf_view_simple/assign.xml @@ -4,15 +4,15 @@ Yaf_View_Simple::assign - The assign purpose + Assign values &reftitle.description; - public voidYaf_View_Simple::assign + public boolYaf_View_Simple::assign stringname - stringvalue + mixedvalue @@ -29,7 +29,10 @@ name - + A string or an array. + + + if is string, then the next argument $value is required. @@ -37,7 +40,7 @@ value - + mixed value @@ -51,6 +54,51 @@ + + &reftitle.examples; + + <function>Yaf_View_Simple::assign</function>example + +getView()->assign("foo", "bar"); + $this->_view->assign( array( "key" => "value", "name" => "value")); + } +?> +]]> + + + + <function>template</function>example + + + + <?php echo $foo; ?> + + + _tpl_vars as $name => value) { + echo $$name; // or echo $this->_tpl_vars[$name]; + } + ?> + + +]]> + + + + + + &reftitle.seealso; + + Yaf_View_Simple::assignRef + Yaf_View_Interface::assign + Yaf_View_Interface::__set + + diff --git a/reference/yaf/yaf_view_simple/assignref.xml b/reference/yaf/yaf_view_simple/assignref.xml index 2ca2005fd4..c95846a241 100644 --- a/reference/yaf/yaf_view_simple/assignref.xml +++ b/reference/yaf/yaf_view_simple/assignref.xml @@ -10,12 +10,13 @@ &reftitle.description; - public voidYaf_View_Simple::assignRef + public boolYaf_View_Simple::assignRef stringname - stringvalue + mixedvalue - + unlike Yaf_View_Simple::assign, this method + assign a ref value to engine. &warn.undocumented.func; @@ -29,7 +30,7 @@ name - + A string name which will be used to access the value in the tempalte. @@ -37,7 +38,7 @@ value - + mixed value @@ -51,6 +52,62 @@ + + &reftitle.examples; + + <function>Yaf_View_Simple::assignRef</function>example + +getView()->assign("foo", $value); + + /* plz note that there was a bug before Yaf 2.1.4, + * which make following output "bar"; + */ + $dummy = $this->getView()->render("index/index.phtml"); + echo $value; + + //prevent the auto-render + Yaf_Dispatcher::getInstance()->autoRender(FALSE); + } +?> +]]> + + + + <function>template</function>example + + + + <?php echo $foo; $foo = "changed"; ?> + + + + +]]> + + &example.outputs.similar; + + + + + + + + &reftitle.seealso; + + Yaf_View_Simple::assign + Yaf_View_Interface::assign + Yaf_View_Interface::__set + + diff --git a/reference/yaf/yaf_view_simple/construct.xml b/reference/yaf/yaf_view_simple/construct.xml index 9f8d944498..8a1412e54a 100644 --- a/reference/yaf/yaf_view_simple/construct.xml +++ b/reference/yaf/yaf_view_simple/construct.xml @@ -29,7 +29,8 @@ tempalte_dir - + The base directory of the templates, by default, + it is APPLICATOIN . "/views" for Yaf. diff --git a/reference/yaf/yaf_view_simple/display.xml b/reference/yaf/yaf_view_simple/display.xml index 87da4d1de8..ecab7f516c 100644 --- a/reference/yaf/yaf_view_simple/display.xml +++ b/reference/yaf/yaf_view_simple/display.xml @@ -4,18 +4,18 @@ Yaf_View_Simple::display - The display purpose + Render and dispaly &reftitle.description; - public voidYaf_View_Simple::display + public boolYaf_View_Simple::display stringtpl - stringtpl_vars + arraytpl_vars - + Render a template and dispaly the result instantly. &warn.undocumented.func; diff --git a/reference/yaf/yaf_view_simple/getscriptpath.xml b/reference/yaf/yaf_view_simple/getscriptpath.xml index facbb2c36c..dcd841b997 100644 --- a/reference/yaf/yaf_view_simple/getscriptpath.xml +++ b/reference/yaf/yaf_view_simple/getscriptpath.xml @@ -4,13 +4,13 @@ Yaf_View_Simple::getScriptPath - The getScriptPath purpose + Get template base directory &reftitle.description; - public voidYaf_View_Simple::getScriptPath + public stringYaf_View_Simple::getScriptPath diff --git a/reference/yaf/yaf_view_simple/render.xml b/reference/yaf/yaf_view_simple/render.xml index fcc5666584..a10217358f 100644 --- a/reference/yaf/yaf_view_simple/render.xml +++ b/reference/yaf/yaf_view_simple/render.xml @@ -4,18 +4,18 @@ Yaf_View_Simple::render - The render purpose + Render template &reftitle.description; - public voidYaf_View_Simple::render + public stringYaf_View_Simple::render stringtpl - stringtpl_vars + arraytpl_vars - + Render a tempalte and return the result. &warn.undocumented.func; diff --git a/reference/yaf/yaf_view_simple/set.xml b/reference/yaf/yaf_view_simple/set.xml index 71d11b3c8a..d33a70a240 100644 --- a/reference/yaf/yaf_view_simple/set.xml +++ b/reference/yaf/yaf_view_simple/set.xml @@ -4,7 +4,7 @@ Yaf_View_Simple::__set - The __set purpose + Set value to engine @@ -12,10 +12,11 @@ public voidYaf_View_Simple::__set stringname - stringvalue + mixedvalue - + This is a easier way to instead of + Yaf_View_Simple::assign. &warn.undocumented.func; @@ -29,7 +30,7 @@ name - + A string value name. @@ -37,7 +38,7 @@ value - + Mixed value. @@ -51,6 +52,31 @@ + + &reftitle.examples; + + <function>Yaf_View_Simple::__set</function>example + +getView()->foo = "bar"; // same as assign("foo", "bar"); + } +?> +]]> + + + + + + &reftitle.seealso; + + Yaf_View_Simple::assignRef + Yaf_View_Interface::assign + Yaf_View_Interface::__set + + diff --git a/reference/yaf/yaf_view_simple/setscriptpath.xml b/reference/yaf/yaf_view_simple/setscriptpath.xml index 7925141bdc..4189ff0fdc 100644 --- a/reference/yaf/yaf_view_simple/setscriptpath.xml +++ b/reference/yaf/yaf_view_simple/setscriptpath.xml @@ -4,13 +4,13 @@ Yaf_View_Simple::setScriptPath - The setScriptPath purpose + Set tempalte base directory &reftitle.description; - public voidYaf_View_Simple::setScriptPath + public boolYaf_View_Simple::setScriptPath stringtemplate_dir