4
4
*
5
5
* Allows templating of Controllers generated from bake.
6
6
*
7
- * CakePHP(tm) : Rapid Development Framework (http ://cakephp.org)
8
- * Copyright (c) Cake Software Foundation, Inc. (http ://cakefoundation.org)
7
+ * CakePHP(tm) : Rapid Development Framework (https ://cakephp.org)
8
+ * Copyright (c) Cake Software Foundation, Inc. (https ://cakefoundation.org)
9
9
*
10
10
* Licensed under The MIT License
11
11
* For full copyright and license information, please see the LICENSE.txt
12
12
* Redistributions of files must retain the above copyright notice.
13
13
*
14
- * @copyright Copyright (c) Cake Software Foundation, Inc. (http ://cakefoundation.org)
15
- * @link http ://cakephp.org CakePHP(tm) Project
14
+ * @copyright Copyright (c) Cake Software Foundation, Inc. (https ://cakefoundation.org)
15
+ * @link https ://cakephp.org CakePHP(tm) Project
16
16
* @since 2.0.0
17
- * @license http ://www.opensource.org/licenses/mit-license.php MIT License
17
+ * @license https ://www.opensource.org/licenses/mit-license.php MIT License
18
18
*/
19
19
#}
20
- <?php
21
- declare (strict_types = 1 );
22
-
23
- namespace {{ namespace }}\Controller {{ prefix }};
24
-
25
- {% if plugin or prefix % }
26
- use {{ baseNamespace }}\Controller\AppController ;
27
- {% endif % }
28
- use Cake\Event\Event ;
29
- use Cake\Http\Exception\MethodNotAllowedException ;
30
- use OpenApi\Attributes as OA ;
20
+ {{ element(' Bake.file_header' , {
21
+ namespace : " #{namespace}\\Controller#{prefix}" ,
22
+ classImports : (plugin or prefix ) ? [" #{baseNamespace}\\Controller\\AppController" ] : [],
23
+ }) }}
31
24
32
25
/**
33
26
* {{ name }} Controller
@@ -40,10 +33,6 @@ use OpenApi\Attributes as OA;
40
33
{% set classInfo = Bake.classInfo (component , ' Controller/Component' , ' Component' ) %}
41
34
* @property {{ classInfo .fqn }} ${{ classInfo .name }}
42
35
{% endfor %}
43
-
44
- {%- if 'index' in actions %}
45
- * @method \{{ namespace }}\Model\Entity\{{ entityClassName }}[]|\Cake\Datasource\ResultSetInterface paginate($object = null, array $settings = [])
46
- {% endif %}
47
36
*/
48
37
class {{ name }}Controller extends AppController
49
38
{
@@ -61,7 +50,7 @@ class {{ name }}Controller extends AppController
61
50
$this->loadComponent('{{ component }}');
62
51
{% endfor %}
63
52
{% if helpers %}
64
- $this -> viewBuilder()-> setHelpers([ {{ Bake . stringifyList (helpers , { ' indent ' : false } )| raw }}] );
53
+ $this->viewBuilder()->setHelpers({{ Bake.exportArray (helpers )| raw }});
65
54
{% endif %}
66
55
}
67
56
{% if actions | length %}{{ " \n" }}{% endif %}
0 commit comments