27 if ($this->cfg->forceSecure)
30 if (!$this->cfg->enabled)
40 final public function exec(array $prm=array()) {
41 $this->prmExec = array_merge(array(
49 $this->prmExec[
'prefix'] = null;
51 if (array_key_exists(
NYROENV, $this->cfg->basicPrefixExec) &&
52 in_array($this->prmExec[
'action'], $this->cfg->getInArray(
'basicPrefixExec',
NYROENV)))
53 $this->prmExec[
'prefix'] = ucfirst(
NYROENV);
54 else if ($this->cfg->prefixExec && !in_array($this->prmExec[
'action'], $this->cfg->noPrefixExec))
55 $this->prmExec[
'prefix'] = $this->cfg->prefixExec;
59 if (!$this->cfg->render)
62 $fctName = ($this->cfg->render?
'render' :
'exec').$this->prmExec[
'prefix'].ucfirst($this->prmExec[
'action']);
63 if (!method_exists($this, $fctName))
68 $param = is_array($this->prmExec[
'paramA'])? $this->prmExec[
'paramA'] :
request::parseParam($this->prmExec[
'param']);
70 $tags = $this->cfg->cacheTags;
71 $search = array(
'/',
'<',
'>');
72 $replace = array(
'',
'',
'');
73 if (is_array($this->prmExec[
'paramA']))
74 foreach($this->prmExec[
'paramA'] as $k=>$v) {
76 if (is_callable(array($v,
'__toString')))
79 $tags[] = $k.
'='.get_class($v);
80 } elseif (!is_numeric($k))
81 $tags[] = $k.
'='.str_replace($search, $replace, $v);
83 $tags[] = str_replace($search, $replace, $v);
87 foreach($param as $k=>$v) {
89 if (is_callable(array($v,
'__toString')))
90 $paramTpl[] = $k.
'='.$v;
92 $paramTpl[] = $k.
'='.get_class($v);
94 $paramTpl[] = $k.
':'.$v;
98 'layout'=>$this->cfg->layout,
99 'module'=>$this->getName(),
100 'action'=>$this->cfg->viewAction,
101 'param'=>implode(
',', $paramTpl),
102 'cache'=>array_merge(array(
106 'request'=>array(
'uri'=>
false,
'meth'=>array())
107 ), $this->cfg->cache)
109 $this->
tpl =
factory::get(
'tpl', array_merge_recursive($conf, $this->cfg->tplPrm));
110 $this->tpl->getCfg()->layout = $this->cfg->layout;
111 $this->tpl->getCfg()->module = $this->
getName();
112 $this->tpl->getCfg()->action = $this->cfg->viewAction;
113 $this->tpl->getCfg()->default = $this->cfg->viewAction;
115 $this->prmExec[
'callbackPrm'] = array(
117 'fctNameParam'=>$param,
124 $this->{$prm[
'fctName']}($prm[
'fctNameParam']);
154 return $this->cfg->viewAction;
163 $this->cfg->viewAction = $action;
165 $this->
tpl->
getCfg()->action = $this->cfg->viewAction;
166 $this->
tpl->
getCfg()->default = $this->cfg->viewAction;
177 return $this->
tpl->
get($name);
187 $this->
tpl->
set($name, $value);
204 public function publish(array $prm = array()) {
205 if (!$this->cfg->viewAction)
208 return $this->
tpl->
fetch(array_merge(array(
209 'callback'=>array($this,
'callbackTpl'),
210 'callbackPrm'=>$this->prmExec[
'callbackPrm'],
231 return $this->cfg->defaultCache;
240 $this->cfg->setInArrayA(
'cacheTags', array($val));
242 $this->
tpl->
getCfg()->setInarray(
'cache',
'tags', $this->cfg->cacheTags);
static parseParam($param)
publish(array $prm=array())
fetch(array $prm=array())
setViewVar($name, $value)
static isContained(array $url, array $checks)
static getModuleName($className)
setViewVars(array $values)
static get($className, array $cfg=array())