Update docs, add init and examples

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@329504 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Xinchen Hui 2013-02-19 13:33:15 +00:00
parent 04f882eb0d
commit c789d27148
4 changed files with 104 additions and 8 deletions

View file

@ -77,6 +77,43 @@
</variablelist>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>Yaf_Controller_Abstract::forward</function>example</title>
<programlisting role="php">
<![CDATA[
<?php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction(){
$logined = $_SESSION["login"];
if (!$logined) {
$this->forward("login", array("from" => "Index")); // forward to login action
return FALSE; // this is important, this finish current working flow
// and tell the Yaf do not doing auto-render
}
// other processes
}
public function loginAction() {
echo "login, redirected from ", $this->getInvokeArg("from") , " action";
}
}
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
login, redirected from Index action
]]>
</screen>
</example>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>

View file

@ -4,7 +4,7 @@
<refentry xml:id="yaf-controller-abstract.getrequest" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Yaf_Controller_Abstract::getRequest</refname>
<refpurpose>The getRequest purpose</refpurpose>
<refpurpose>Retrieve current request object</refpurpose>
</refnamediv>
<refsect1 role="description">
@ -14,7 +14,7 @@
<void />
</methodsynopsis>
<para>
retrieve current request object
</para>
</refsect1>
@ -26,7 +26,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<classname>Yaf_Request_Abstract</classname> instance
</para>
</refsect1>

View file

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 327672 $ -->
<refentry xml:id="yaf-controller-abstract.init" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Yaf_Controller_Abstract::init</refname>
<refpurpose>Controller initializer</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>Yaf_Controller_Abstract::init</methodname>
<void />
</methodsynopsis>
<para>
<methodname>Yaf_Controller_Abstract::__construct</methodname> is final,
which means users can not override it.
but users can define
<methodname>Yaf_Controller_Abstract::init</methodname>, which will be
called after controller object is instantiated.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
</para>
</refsect1>
</refentry>
<!-- 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
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/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
-->

View file

@ -4,17 +4,17 @@
<refentry xml:id="yaf-controller-abstract.redirect" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Yaf_Controller_Abstract::redirect</refname>
<refpurpose>The redirect purpose</refpurpose>
<refpurpose>Redirect to a URL</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>Yaf_Controller_Abstract::redirect</methodname>
<modifier>public</modifier> <type>bool</type><methodname>Yaf_Controller_Abstract::redirect</methodname>
<methodparam><type>string</type><parameter>url</parameter></methodparam>
</methodsynopsis>
<para>
redirect to a URL by sending a 302 header
</para>
</refsect1>
@ -25,7 +25,7 @@
<term><parameter>url</parameter></term>
<listitem>
<para>
a location URL
</para>
</listitem>
</varlistentry>
@ -35,7 +35,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
bool
</para>
</refsect1>