@@ -5,34 +5,34 @@ discard block |
||
| 5 | 5 | use Ubiquity\controllers\Startup; |
| 6 | 6 | use Ubiquity\utils\http\URequest; |
| 7 | 7 | |
| 8 | -class JsUtils extends \Ajax\JsUtils{ |
|
| 8 | +class JsUtils extends \Ajax\JsUtils { |
|
| 9 | 9 | |
| 10 | - public function getUrl($url){ |
|
| 10 | + public function getUrl($url) { |
|
| 11 | 11 | return URequest::getUrl($url); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | - public function addViewElement($identifier,$content,&$view){ |
|
| 14 | + public function addViewElement($identifier, $content, &$view) { |
|
| 15 | 15 | $controls=$view->getVar("q"); |
| 16 | - if (isset($controls) === false) { |
|
| 17 | - $controls=array (); |
|
| 16 | + if (isset($controls)===false) { |
|
| 17 | + $controls=array(); |
|
| 18 | 18 | } |
| 19 | 19 | $controls[$identifier]=$content; |
| 20 | 20 | $view->setVar("q", $controls); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public function createScriptVariable(&$view,$view_var, $output){ |
|
| 24 | - $view->setVar($view_var,$output); |
|
| 23 | + public function createScriptVariable(&$view, $view_var, $output) { |
|
| 24 | + $view->setVar($view_var, $output); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public function forward($initialController,$controller,$action,$params=array()){ |
|
| 28 | - return $initialController->forward($controller,$action,$params,true,true,true); |
|
| 27 | + public function forward($initialController, $controller, $action, $params=array()) { |
|
| 28 | + return $initialController->forward($controller, $action, $params, true, true, true); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | - public function renderContent($initialControllerInstance,$viewName, $params=NULL) { |
|
| 32 | - return $initialControllerInstance->loadView($viewName,$params,true); |
|
| 31 | + public function renderContent($initialControllerInstance, $viewName, $params=NULL) { |
|
| 32 | + return $initialControllerInstance->loadView($viewName, $params, true); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - public function fromDispatcher($dispatcher){ |
|
| 35 | + public function fromDispatcher($dispatcher) { |
|
| 36 | 36 | return Startup::$urlParts; |
| 37 | 37 | } |
| 38 | 38 | |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | * If an associative array is passed, the view retrieves variables from the table's key names |
| 44 | 44 | * @param boolean $asString If true, the view is not displayed but returned as a string (usable in a variable) |
| 45 | 45 | */ |
| 46 | - public function renderView($viewName,$parameters=[],$asString=false){ |
|
| 47 | - if(isset($this->injected)){ |
|
| 46 | + public function renderView($viewName, $parameters=[], $asString=false) { |
|
| 47 | + if (isset($this->injected)) { |
|
| 48 | 48 | $view=$this->injected->getView(); |
| 49 | 49 | $this->compile($view); |
| 50 | 50 | if (isset($parameters)) |
@@ -47,8 +47,9 @@ |
||
| 47 | 47 | if(isset($this->injected)){ |
| 48 | 48 | $view=$this->injected->getView(); |
| 49 | 49 | $this->compile($view); |
| 50 | - if (isset($parameters)) |
|
| 51 | - $this->view->setVars($parameters); |
|
| 50 | + if (isset($parameters)) { |
|
| 51 | + $this->view->setVars($parameters); |
|
| 52 | + } |
|
| 52 | 53 | return $this->view->render($viewName, $asString); |
| 53 | 54 | } |
| 54 | 55 | throw new \Exception(get_class()." instance is not properly instancied : you omitted the second parameter \$controller!"); |