質問編集履歴
3
セキュリティの関わる問題なので削除させていただきました。
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
セキュリティの関わる問題なので削除させていただきました。
|
test
CHANGED
@@ -1,223 +1 @@
|
|
1
|
-
WEBというアプリケーション作っていて
|
2
|
-
|
3
|
-
その中のentityの動作として
|
4
|
-
|
5
|
-
roytes.phpに記述を行いリンクの設定をしたのですが
|
6
|
-
|
7
|
-
本来の動きとしては
|
8
|
-
|
9
|
-
WEB/Entity/entity_tbl/id
|
10
|
-
|
11
|
-
と動いて欲しいのですが何故か
|
12
|
-
|
13
|
-
WEB/WEB/Entity/entity_tbl/id
|
14
|
-
|
15
|
-
と二重になってしまい
|
16
|
-
|
17
|
-
Error: WebController could not be found.
|
18
|
-
|
19
|
-
|
1
|
+
セキュリティの関わる問題なので削除させていただきました。
|
20
|
-
|
21
|
-
どうしたら
|
22
|
-
|
23
|
-
WEB/Entity/entity_tbl/idになるようになりますでしょうか?
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
無理やりURLを合わせてみましたが
|
28
|
-
|
29
|
-
Warning (2):Missing argument 1 for EntityController::entity_tbl() [APP/controllers/entity_controller.php, line 17]
|
30
|
-
|
31
|
-
Notice (8): Undefined variable: db_id [APP/controllers/entity_controller.php, line 19]
|
32
|
-
|
33
|
-
と$db_idの取得もできていないみたいです。
|
34
|
-
|
35
|
-
どうすれば動くようになりますでしょうか
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
```ここに言語を入力
|
42
|
-
|
43
|
-
routes.php
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
Router::connect(
|
48
|
-
|
49
|
-
'/Entity/entity_tbl/:db_id',
|
50
|
-
|
51
|
-
array('controller' => 'Entity', 'action' => 'entity_tbl'),
|
52
|
-
|
53
|
-
array('db_id' => '\d+', 'pass' => array('db_id'))
|
54
|
-
|
55
|
-
);
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
```
|
62
|
-
|
63
|
-
```ここに言語を入力
|
64
|
-
|
65
|
-
<?php
|
66
|
-
|
67
|
-
class EntityController extends AppController {
|
68
|
-
|
69
|
-
var $name = 'Entity';
|
70
|
-
|
71
|
-
var $components = array('RequestHandler','Auth','Common');
|
72
|
-
|
73
|
-
var $user;
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
function index() {
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
$this->Entity->setDataSource('hive');
|
82
|
-
|
83
|
-
//$this->layout='entity';//使用するレイアウト
|
84
|
-
|
85
|
-
//DB一覧取得
|
86
|
-
|
87
|
-
$sql ="select * from DBS;";
|
88
|
-
|
89
|
-
$result= $this->Entity->query($sql);
|
90
|
-
|
91
|
-
$this->set('para', $result);
|
92
|
-
|
93
|
-
}
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
function entity_tbl($db_id){
|
98
|
-
|
99
|
-
$this->Entity->setDataSource('hive');
|
100
|
-
|
101
|
-
$sql ="select * from TBLS where DB_ID =$db_id;";
|
102
|
-
|
103
|
-
$result= $this->Entity->query($sql);
|
104
|
-
|
105
|
-
$this->set('para', $result);
|
106
|
-
|
107
|
-
}
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
}
|
112
|
-
|
113
|
-
```
|
114
|
-
|
115
|
-
```ここに言語を入力
|
116
|
-
|
117
|
-
index.php
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
<!DOCTYPE html>
|
124
|
-
|
125
|
-
<html>
|
126
|
-
|
127
|
-
<head>
|
128
|
-
|
129
|
-
<meta charset="utf-8">
|
130
|
-
|
131
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
132
|
-
|
133
|
-
<title></title>
|
134
|
-
|
135
|
-
<link rel="stylesheet" href="">
|
136
|
-
|
137
|
-
</head>
|
138
|
-
|
139
|
-
<body>
|
140
|
-
|
141
|
-
<h2>DB一覧</h2>
|
142
|
-
|
143
|
-
<ul>
|
144
|
-
|
145
|
-
<?php foreach($para as $name): ?>
|
146
|
-
|
147
|
-
<li>
|
148
|
-
|
149
|
-
<?php
|
150
|
-
|
151
|
-
echo $this->Html->link(
|
152
|
-
|
153
|
-
h($name['DBS']['NAME']),
|
154
|
-
|
155
|
-
Router::url(array('controller' => 'Entity', 'action' => 'entity_tbl', 'id' => $name['DBS']['DB_ID']))
|
156
|
-
|
157
|
-
);
|
158
|
-
|
159
|
-
?>
|
160
|
-
|
161
|
-
</li>
|
162
|
-
|
163
|
-
<?php endforeach; ?>
|
164
|
-
|
165
|
-
</ul>
|
166
|
-
|
167
|
-
</body>
|
168
|
-
|
169
|
-
</html>
|
170
|
-
|
171
|
-
```
|
172
|
-
|
173
|
-
```ここに言語を入力
|
174
|
-
|
175
|
-
<!DOCTYPE html>
|
176
|
-
|
177
|
-
<html>
|
178
|
-
|
179
|
-
<head>
|
180
|
-
|
181
|
-
<meta charset="utf-8">
|
182
|
-
|
183
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
184
|
-
|
185
|
-
<title></title>
|
186
|
-
|
187
|
-
<link rel="stylesheet" href="">
|
188
|
-
|
189
|
-
</head>
|
190
|
-
|
191
|
-
<body>
|
192
|
-
|
193
|
-
<h2>テーブル一覧</h2>
|
194
|
-
|
195
|
-
<ul>
|
196
|
-
|
197
|
-
<?php foreach($para as $name): ?>
|
198
|
-
|
199
|
-
<li>
|
200
|
-
|
201
|
-
<?php
|
202
|
-
|
203
|
-
echo $this->Html->link(
|
204
|
-
|
205
|
-
h($name['TBLS']['TBL_NAME']),
|
206
|
-
|
207
|
-
Router::url(array('controller' => 'Entity', 'action' => 'entity_tbl', 'id' => $name['TBLS']['TBL_ID']))
|
208
|
-
|
209
|
-
);
|
210
|
-
|
211
|
-
?>
|
212
|
-
|
213
|
-
</li>
|
214
|
-
|
215
|
-
<?php endforeach; ?>
|
216
|
-
|
217
|
-
</ul>
|
218
|
-
|
219
|
-
</body>
|
220
|
-
|
221
|
-
</html>
|
222
|
-
|
223
|
-
```
|
2
追加
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
cakephp routes.phpにコード書いたがURLが上手くいかない
|
1
|
+
cakephp1.3 routes.phpにコード書いたがURLが上手くいかない
|
test
CHANGED
File without changes
|
1
追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,6 +24,20 @@
|
|
24
24
|
|
25
25
|
|
26
26
|
|
27
|
+
無理やりURLを合わせてみましたが
|
28
|
+
|
29
|
+
Warning (2):Missing argument 1 for EntityController::entity_tbl() [APP/controllers/entity_controller.php, line 17]
|
30
|
+
|
31
|
+
Notice (8): Undefined variable: db_id [APP/controllers/entity_controller.php, line 19]
|
32
|
+
|
33
|
+
と$db_idの取得もできていないみたいです。
|
34
|
+
|
35
|
+
どうすれば動くようになりますでしょうか
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
27
41
|
```ここに言語を入力
|
28
42
|
|
29
43
|
routes.php
|