<commit_before><commit_msg>add new translation of Zend_Layout-Advanced.xml based its English version 7078<commit_after><sect1 id="zend.layout.advanced">
    <title>Zend_Layout ߼÷</title>

    <para>
        <code>Zend_Layout</code> ṩԸ޸Ӧͬͼʵ֡ļϵͳּĸ߼ߡ
    </para>

    <para>
        Ҫչǣ
    </para>

    <itemizedlist>
        <listitem><para>
                <emphasis>ͼ</emphasis> <code>Zend_Layout</code> ʹκʵ<code>Zend_View_Interface</code> ࡣ
        </para></listitem>

        <listitem><para>
                <emphasis>ǰ˿</emphasis> <code>Zend_Layout</code> ڷӦ֮ǰԶֵı׼ǰ˿һ𷢲滻ԼĲ
        </para></listitem>

        <listitem><para>
                <emphasis>ƶ֡</emphasis> <code>Zend_Layout</code> ͱ׼һ𷢲ΪֶڲֶԼһƴdumb proxyӦʺϴ󲿷ֵ
        </para></listitem>

        <listitem><para>
                <emphasis>Ʋֽű·resolution</emphasis><code>Zend_Layout</code> Ϊֽű·ʹԼ <link linkend="zend.filter.inflector">inflector</link> ߼򵥵޸ĸӵıָԼıι
        </para></listitem>
    </itemizedlist>

    <sect2 id="zend.layout.advanced.view">
        <title>ͼ</title>

        <para>
            <code>Zend_Layout</code> κʵ <code>Zend_View_Interface</code> չ <code>Zend_View_Abstract</code> ֽű򵥵ذѶƵͼݸ constructor/<code>startMvc()</code><code>setView()</code> 
        </para>

        <programlisting role="php"><![CDATA[<?php
$view = new My_Custom_View();
$layout->setView($view);
?>]]></programlisting>

        <note>
            <title>е Zend_View ʵֶͬ</title>

            <para>
                Ȼ<code>Zend_Layout</code>ʹκʵ<code>Zend_View_Interface</code>࣬ǲʹø<code>Zend_View</code>֣Ҳ⣬رǲֺ<link linkend="zend.view.helpers.initial.placeholder">ռλ</link>֡Ϊ<code>Zend_Layout</code>ͨԼ<link linkend="zend.view.helpers.initial.placeholder">ռλ</link>ڿõĶñ
            </para>

            <para>
                ҪʹһƵĲ֧Щ<code>Zend_View</code>ʵ֣ôҪҵһ취Ѳֱͼͨ취ʵ֣չ<code>Zend_Layout</code>͸ı<code>render()</code>ݱͼߣԼĲ࣬ڽǰǡ
            </para>

            <para>
                Ϊ滻ͼʵ֧κĲͨ'Zend_Layout'ռλʹ<link linkend="zend.view.helpers.initial.placeholder">ռλ</link>
            </para>

            <programlisting role="php"><![CDATA[<?php
$placeholders = new Zend_View_Helper_Placeholder();
$layoutVars   = $placeholders->placeholder('Zend_Layout')->getArrayCopy();
?>]]></programlisting>
        </note>
    </sect2>

    <sect2 id="zend.layout.advanced.plugin">
        <title>ǰ˿</title>

        <para>
            MVCһʹã<code>Zend_Layout</code>עһǰ˿ѽΪ˳ǲѭ֮ǰһڴ£ȱʡĲãдԼģͨ<code>pluginClass</code>ѡ<code>startMvc()</code>ָȥء
        </para>

        <para>
            ΪĿдκβཫҪչ<code>Zend_Controller_Plugin_Abstract</code>ӦýһֶʵΪ⣬ʵϸȡ㡣
        </para>

        <para>
            ʹȱʡ<code>Zend_Layout_Controller_Plugin_Layout</code>
        </para>
    </sect2>

    <sect2 id="zend.layout.advanced.helper">
        <title>ƶ</title>

        <para>
            MVCһʹã<code>Zend_Layout</code>־עһ֡ȱʡ֣<code>Zend_Layout_Controller_Action_Helper_Layout</code>һƴֶʵԼӦʺϴ
        </para>

        <para>
            ҪдƵĺ򵥵дһչ<code>Zend_Controller_Action_Helper_Abstract</code> ĶಢΪ<code>helperClass</code>ѡݸ<code>startMvc()</code>ϸھȡˡ
        </para>
    </sect2>

    <sect2 id="zend.layout.advanced.inflector">
        <title>Ʋֽű·ResolutionʹñInflector</title>

        <para>
            Ϊ벼ֽű·<code>Zend_Layout</code>  <code>Zend_Filter_Inflector</code>һȱʡأѭ'StringToLower'ַСдʹù'CamelCaseToDash'շ̺ߣͼӺ׺'phtml'תֵ·¼ʾ
        </para>

        <itemizedlist>
            <listitem><para>
                    'foo' will be transformed to 'foo.phtml'.
            </para></listitem>

            <listitem><para>
                    'FooBarBaz' will be transformed to 'foo-bar-baz.phtml'.
            </para></listitem>
        </itemizedlist>

        <para>
            ѡ޸ıΣ޸ı<code>Zend_Layout</code>ʵϱĿ꣬ߴԼıʵݸ<code>Zend_Layout::setInflector()</code>
        </para>

        <example id="zend.layout.advanced.inflector.directmodification">
            <title>Zend_Layout ֱ޸ </title>

            <para>
                ĿһȱʡĿ<code>Zend_Layout</code>һʹ':script.:suffix'':script'ǱݵעĲƣ':suffix'Ǳľ̬
            </para>

            <para>
                Ǽú׺'html'ΪֽűļչշΪ»߶Ƕ̺ߣʹСдĸ⣬ȥ'layouts'Ŀ¼ȥҽű
            </para>

            <programlisting role="php"><![CDATA[<?php
$layout->getInflector()->setTarget('layouts/:script.:suffix')
                       ->setStaticRule('suffix', 'html')
                       ->setFilterRule(array('CamelCaseToUnderscore'));
?>]]></programlisting>
        </example>

        <example id="zend.layout.advanced.inflector.custom">
            <title>Ʊinflectors</title>

            <para>
                ڴ£޸ѴڵıѾ㹻ȻһڶطʹõıвͬĶ͡<code>Zend_Layout</code>֧
            </para>

            <programlisting role="php"><![CDATA[<?php
$inflector = new Zend_Filter_Inflector('layouts/:script.:suffix');
$inflector->addRules(array(
    ':script' => array('CamelCaseToUnderscore'),
    'suffix'  => 'html'
));
$layout->setInflector($inflector);
?>]]></programlisting>
        </example>

        <note>
            <title>ΣInflectionԱֹ </title>

            <para>
                <code>Zend_Layout</code>÷ԽֹΡָ·ͼű˵ãָֽ֪űҪεĻƣ򵥵ʹ<code>enableInflection()</code>  <code>disableInflection()</code> 
            </para>
        </note>
    </sect2>
</sect1>
<!--
vim:se ts=4 sw=4 et:
-->
{'fraction_non_alphanumeric': 0.1706758304696449, 'fraction_numerical': 0.0030546009927453228, 'mean_word_length': 2.5859000684462696, 'pattern_counts': {'":': 0, '<': 208, '<?xml version=': 0, '>': 219, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6718940', 'n_tokens_mistral': 2271, 'n_tokens_neox': 2256, 'n_words': 197}