質問編集履歴

1

あdc

2018/10/20 18:35

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -31,3 +31,23 @@
31
31
 
32
32
 
33
33
  その点、変数のセットはcakeがやりやすいのですが何かベストな方法はないでしょうか?
34
+
35
+
36
+
37
+ cakeではconst.php作ってそこに配列で多段構造的に定義して以下のようなことはよくやっていました。
38
+
39
+
40
+
41
+ ```
42
+
43
+      $currentAction = $this->request->getParam('action');
44
+
45
+ // ページ名動的取得対応 & ページ定義がない場合はレンダリングしない対応
46
+
47
+ isset(Configure::read('title.bank')[$currentAction]) ?
48
+
49
+ $this->set('title', Configure::read('title.bank')[$currentAction]) :
50
+
51
+ $this->autoRender = false;
52
+
53
+ ```