1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ajax\php\ubiquity; |
4
|
|
|
|
5
|
|
|
use Ubiquity\controllers\Startup; |
|
|
|
|
6
|
|
|
use Ubiquity\utils\http\URequest; |
|
|
|
|
7
|
|
|
|
8
|
|
|
class JsUtils extends \Ajax\JsUtils{ |
9
|
|
|
|
10
|
|
|
public function getUrl($url){ |
11
|
|
|
return URequest::getUrl($url); |
12
|
|
|
} |
13
|
|
|
|
14
|
|
|
public function addViewElement($identifier,$content,&$view){ |
15
|
|
|
$controls=$view->getVar("q"); |
16
|
|
|
if (isset($controls) === false) { |
17
|
|
|
$controls=array (); |
18
|
|
|
} |
19
|
|
|
$controls[$identifier]=$content; |
20
|
|
|
$view->setVar("q", $controls); |
21
|
|
|
} |
22
|
|
|
|
23
|
|
|
public function createScriptVariable(&$view,$view_var, $output){ |
24
|
|
|
$view->setVar($view_var,$output); |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
public function forward($initialController,$controller,$action,$params=array()){ |
28
|
|
|
return $initialController->forward($controller,$action,$params,true,true,true); |
29
|
|
|
} |
30
|
|
|
|
31
|
|
|
public function renderContent($initialControllerInstance,$viewName, $params=NULL) { |
32
|
|
|
return $initialControllerInstance->loadView($viewName,$params,true); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
public function fromDispatcher($dispatcher){ |
36
|
|
|
return Startup::$urlParts; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Performs jQuery compilation and displays a view |
41
|
|
|
* @param string $viewName |
42
|
|
|
* @param mixed $parameters Variable or associative array to pass to the view <br> If a variable is passed, it will have the name <b> $ data </ b> in the view, <br> |
43
|
|
|
* If an associative array is passed, the view retrieves variables from the table's key names |
44
|
|
|
* @param boolean $asString If true, the view is not displayed but returned as a string (usable in a variable) |
45
|
|
|
*/ |
46
|
|
|
public function renderView($viewName,$parameters=[],$asString=false){ |
47
|
|
|
if(isset($this->injected)){ |
48
|
|
|
$view=$this->injected->getView(); |
49
|
|
|
$this->compile($view); |
50
|
|
|
if (isset($parameters)) |
51
|
|
|
$this->view->setVars($parameters); |
|
|
|
|
52
|
|
|
return $this->view->render($viewName, $asString); |
53
|
|
|
} |
54
|
|
|
throw new \Exception(get_class()." instance is not properly instancied : you omitted the second parameter \$controller!"); |
55
|
|
|
} |
56
|
|
|
} |
57
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths