Layoutの変数を使用するタイミングとView、ページのページ セグメントを取得するために の変数を使用するタイミングがわかりません。これは彼らのLayoutパッケージチュートリアルの写真です(どこでもインスタンス$thisを意味しViewます):

なぜNavigation、ContentおよびSidebarセグメントはLayout変数として取得されるのですか?
$this->layout()->nav;
しかしHeadTitle、、、 ViewHeadScriptからHeadStylesheetそのまま取得できますか?
$this->headTitle(); // I know that this is a placeholder view helper.
// But this segment of the page logically belongs to Layout.
// and it has to be called smth like view->layout->placeholder
そして、なぜHeaderとFooterはのプロパティではなくのpartialメソッドからのものなのですか?ViewLayout
$this->partial('header.phtml');
私はそれらを変更しようとしましたが、両方の方法でうまくいきます:
echo $this->nav; // I assigned navigation segment script to the View and it works;
Footerにセグメントスクリプトを割り当てようとしましたがLayout、それも機能します:
$layout->footer = $footer;
echo $this->layout()->footer; // it also works, it's displayed on the page
どの方法でも、ページ上の任意の変数に適用できます。たとえば、Navigationセグメントには表示する変数がたくさんあり、両方の方法を使用してそれらを出力できます-1つの変数をLayoutのプロパティとして、別の変数を saViewのプロパティとして。
では、それらを正しい方法で使用するためのルールは何ですか? Viewの変数と の変数はいつ使用する必要がありLayoutますか?