PGメモ

非エンジニアの記録

symfonyで動的にページタイトルを変える方法

action内で

$this->getResponse()->setTitle('foovar');

とするだけ

スタイルシート追加

$this->getResponse()->addStylesheet('newstyle');

ジャバスクリプト追加

$this->getResponse()->addJavascript('newscript');

最初に読み込ませる

$this->getResponse()->addStylesheet('newstyle', 'first');

最後に読み込ませる

$this->getResponse()->addStylesheet('newstyle', 'last');

属性オプションをつける

$this->getResponse()->addStylesheet('main_for_print', '', array('media' => 'print'));