コントローラ内で次のコードを想定します。
$this->view->addScriptPath('dir1/views/scripts');
$this->view->addScriptPath('dir2/views/scripts');
$this->render('index.phtml');
dir1 / views / scriptsに2つのファイルが含まれている場合:
-index.phtml
-table.phtml
そして、dir2 / views / scripts:
-table.phtml
これで、dir 2にはindex.phtmlがないため、dir1にindex.phtmlがレンダリングされます。
Index.phtmlは次のようになります。
<somehtml>
<?= $this->render('table.phtml') ?>
</somehtml>
これが私にとって混乱が始まるところです。スクリプトパススタックに追加された最後のディレクトリにあるtable.phtmlをレンダリングすることを期待しますが、そうではありません。
私の問題に対する簡単な解決策/説明はありますか?