質問編集履歴

1

修正しました。

2019/06/20 09:59

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -51,3 +51,95 @@
51
51
 
52
52
 
53
53
  で、コントローラーとアクションを識別しています。
54
+
55
+
56
+
57
+ -------------
58
+
59
+ 具体的にした方が、より明確な回答を得られるとアドバイスをいただいたので
60
+
61
+ 追記いたします。
62
+
63
+
64
+
65
+ 私のイメージしているcontrollerのactionとテンプレートの紐付けとは
66
+
67
+ 以下のような感じです。
68
+
69
+ ```php
70
+
71
+ <?php
72
+
73
+ //sample_controler.php
74
+
75
+
76
+
77
+ /**
78
+
79
+ * AppControllerはControllerを継承しています。
80
+
81
+ *
82
+
83
+ * Controllerでは、PDOのinstance化などの
84
+
85
+ * 主要な機能を使えるようにする処理を書いています。
86
+
87
+ */
88
+
89
+ class sample_controller extends AppController
90
+
91
+ {
92
+
93
+ function something()
94
+
95
+ {
96
+
97
+ $view->assign($msg,'post送信です。');
98
+
99
+ $view->setTmp('sample.php');
100
+
101
+ }
102
+
103
+ }
104
+
105
+ ```
106
+
107
+ ```php
108
+
109
+ //sample.php
110
+
111
+ <!DOCTYPE html>
112
+
113
+ <html>
114
+
115
+ <head>
116
+
117
+ <meta charset="utf-8">
118
+
119
+ <title>sample</title>
120
+
121
+ </head>
122
+
123
+ <body>
124
+
125
+ <form action="?cont=sample:something" method="post" accept-charset="utf-8">
126
+
127
+ <input type="text" name="something">
128
+
129
+ <button type="submit">送信</button>
130
+
131
+ </form>
132
+
133
+ <?=$msg?>
134
+
135
+ </body>
136
+
137
+ </html>
138
+
139
+ ```
140
+
141
+
142
+
143
+ 不足していることがありましたら、修正します。
144
+
145
+ よろしくお願いいたします。