CakePHP3 ビューからエレメントに値渡す(パラメーターアサイン)方法です。
※ エレメント(Element): 画面デザインのパーツを再利用できるように定義できる機能です。
1 2 3 4 5 | // element呼び出し <?= $this->element('body-common') ?> // src/Template/Element/body-common.ctp // element呼び出し + element用パラメーターアサイン <?= $this->element('body-common', ['ver' => '20171128']) ?> // body-common.ctpでは「$ver」が使える |