Ubiquity
2.5.2
php rapid development framework
Loading...
Searching...
No Matches
BaseControllerCreator.php
Go to the documentation of this file.
1
<?php
2
namespace
Ubiquity\scaffolding\creators
;
3
4
use Ubiquity\scaffolding\ScaffoldController;
5
use
Ubiquity\controllers\Startup
;
6
use
Ubiquity\cache\CacheManager
;
7
use
Ubiquity\creator\HasUsesTrait
;
8
19
abstract
class
BaseControllerCreator
extends
HasUsesTrait
{
20
21
protected
$controllerName
;
22
23
protected
$routePath
;
24
25
protected
$views
;
26
27
protected
$controllerNS
;
28
29
protected
$templateName
;
30
31
protected
$useViewInheritance
;
32
37
protected
$scaffoldController
;
38
39
public
function
__construct
(
$controllerName
,
$routePath
,
$views
,
$useViewInheritance
) {
40
$this->controllerName =
$controllerName
;
41
if
(
$routePath
!=
null
) {
42
$this->routePath =
'/'
. \ltrim(
$routePath
,
'/'
);
43
}
44
$this->views =
$views
;
45
$this->controllerNS = Startup::getNS(
"controllers"
);
46
$this->useViewInheritance=
$useViewInheritance
;
47
}
48
49
protected
function
getNamespaceStr
(){
50
if
($this->controllerNS==
null
){
51
return
''
;
52
}
53
return
'namespace '
. \trim($this->controllerNS,
'\\'
).
';'
;
54
}
55
56
protected
function
getRouteAnnotation
($path, $automated=
true
, $inherited=
true
) {
57
return
CacheManager::getAnnotationsEngineInstance()->getAnnotation($this,
'route'
, [
58
'path'
=> $path,
59
'automated'
=> $automated,
60
'inherited'
=> $inherited
61
])->asAnnotation();
62
}
63
64
protected
function
getAnnotation
(
string
$type,array $attributes){
65
return
CacheManager::getAnnotationsEngineInstance()->getAnnotation($this, $type, $attributes)->asAnnotation();
66
}
67
68
abstract
public
function
create
(ScaffoldController
$scaffoldController
);
69
70
abstract
protected
function
addViews
(&$messages, &$classContent);
71
76
public
function
getTemplateName
() {
77
return
$this->templateName
;
78
}
79
84
public
function
setTemplateName
(
$templateName
) {
85
$this->templateName =
$templateName
;
86
}
87
}
88
Ubiquity\cache\CacheManager
Manager for caches (Router, Rest, models).
Definition
CacheManager.php:28
Ubiquity\controllers\Startup
Starts the framework.
Definition
Startup.php:19
Ubiquity\creator\HasUsesTrait
Definition
HasUsesTrait.php:4
Ubiquity\scaffolding\creators\BaseControllerCreator
Definition
BaseControllerCreator.php:19
Ubiquity\scaffolding\creators\BaseControllerCreator\$routePath
$routePath
Definition
BaseControllerCreator.php:23
Ubiquity\scaffolding\creators\BaseControllerCreator\$views
$views
Definition
BaseControllerCreator.php:25
Ubiquity\scaffolding\creators\BaseControllerCreator\$controllerNS
$controllerNS
Definition
BaseControllerCreator.php:27
Ubiquity\scaffolding\creators\BaseControllerCreator\create
create(ScaffoldController $scaffoldController)
Ubiquity\scaffolding\creators\BaseControllerCreator\$controllerName
$controllerName
Definition
BaseControllerCreator.php:21
Ubiquity\scaffolding\creators\BaseControllerCreator\getTemplateName
getTemplateName()
Definition
BaseControllerCreator.php:76
Ubiquity\scaffolding\creators\BaseControllerCreator\$scaffoldController
$scaffoldController
Definition
BaseControllerCreator.php:37
Ubiquity\scaffolding\creators\BaseControllerCreator\__construct
__construct($controllerName, $routePath, $views, $useViewInheritance)
Definition
BaseControllerCreator.php:39
Ubiquity\scaffolding\creators\BaseControllerCreator\$templateName
$templateName
Definition
BaseControllerCreator.php:29
Ubiquity\scaffolding\creators\BaseControllerCreator\addViews
addViews(&$messages, &$classContent)
Ubiquity\scaffolding\creators\BaseControllerCreator\setTemplateName
setTemplateName($templateName)
Definition
BaseControllerCreator.php:84
Ubiquity\scaffolding\creators\BaseControllerCreator\getRouteAnnotation
getRouteAnnotation($path, $automated=true, $inherited=true)
Definition
BaseControllerCreator.php:56
Ubiquity\scaffolding\creators\BaseControllerCreator\$useViewInheritance
$useViewInheritance
Definition
BaseControllerCreator.php:31
Ubiquity\scaffolding\creators\BaseControllerCreator\getAnnotation
getAnnotation(string $type, array $attributes)
Definition
BaseControllerCreator.php:64
Ubiquity\scaffolding\creators\BaseControllerCreator\getNamespaceStr
getNamespaceStr()
Definition
BaseControllerCreator.php:49
Ubiquity\scaffolding\creators
Definition
AuthControllerCreator.php:2
C:
Users
myadd
Documents
GitHub
ubiquity-doc-api
vendor
phpmv
ubiquity-dev
src
Ubiquity
scaffolding
creators
BaseControllerCreator.php
Generated on Sun Dec 10 2023 15:04:08 for
Ubiquity
by
doxygen
1.9.8