src/Controller/PagesController.php
public function display() { $this->Flash->success('いらっしゃい!'); $this->Flash->default('ハロー'); $this->Flash->error('ダメダメ'); }src/Template/Layout/default.ctp
<?= $this->Flash->render() ?>HTMLレイアウトは、
src/Template/Element/Flash/default.ctp
src/Template/Element/Flash/error.ctp
src/Template/Element/Flash/success.ctp
を編集すればOKらしい。
実際に設定してみたサイトがこちら。
参考サイト
Flash(CakePHP Cookbook 3.x documentation)
0 件のコメント:
コメントを投稿