@@ -98,14 +98,14 @@ public function initialize() {
98
98
*
99
99
* @return mixed
100
100
*/
101
- public function execute () {
101
+ public function execute ($ name = null , $ template = null , $ action = null ) {
102
102
parent ::execute ();
103
103
104
104
if (!isset ($ this ->connection )) {
105
105
$ this ->connection = 'default ' ;
106
106
}
107
107
108
- if (empty ($ this -> args )) {
108
+ if (empty ($ name )) {
109
109
$ this ->out (__d ('cake_console ' , 'Possible tables to bake views for based on your current database: ' ));
110
110
$ this ->Model ->connection = $ this ->connection ;
111
111
foreach ($ this ->Model ->listAll () as $ table ) {
@@ -114,22 +114,18 @@ public function execute() {
114
114
return true ;
115
115
}
116
116
117
- $ action = null ;
118
- if (strtolower ($ this ->args [0 ]) === 'all ' ) {
117
+ if (strtolower ($ name ) === 'all ' ) {
119
118
return $ this ->all ();
120
119
}
121
120
122
121
$ controller = null ;
123
122
if (!empty ($ this ->params ['controller ' ])) {
124
123
$ controller = $ this ->params ['controller ' ];
125
124
}
126
- $ this ->controller ($ this -> args [ 0 ] , $ controller );
125
+ $ this ->controller ($ name , $ controller );
127
126
128
- if (isset ($ this ->args [1 ])) {
129
- $ this ->template = $ this ->args [1 ];
130
- }
131
- if (isset ($ this ->args [2 ])) {
132
- $ action = $ this ->args [2 ];
127
+ if (isset ($ template )) {
128
+ $ this ->template = $ template ;
133
129
}
134
130
if (!$ action ) {
135
131
$ action = $ this ->template ;
@@ -223,8 +219,7 @@ public function all() {
223
219
$ tables = $ this ->Model ->listAll ();
224
220
225
221
foreach ($ tables as $ table ) {
226
- $ this ->args [0 ] = $ table ;
227
- $ this ->execute ();
222
+ $ this ->execute ($ table );
228
223
}
229
224
}
230
225
0 commit comments