Completed
Push — master ( 696c6e...f662ec )
by Jean-Christophe
02:43
created

JsUtils::forward()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 4
1
<?php
2
3
namespace Ajax\php\ubiquity;
4
5
use Ubiquity\controllers\Startup;
6
use Ubiquity\utils\RequestUtils;
7
class JsUtils extends \Ajax\JsUtils{
8
9
	public function getUrl($url){
10
		return RequestUtils::getUrl($url);
11
	}
12
13 View Code Duplication
	public function addViewElement($identifier,$content,&$view){
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
		$controls=$view->getVar("q");
15
		if (isset($controls) === false) {
16
			$controls=array ();
17
		}
18
		$controls[$identifier]=$content;
19
		$view->setVar("q", $controls);
20
	}
21
22
	public function createScriptVariable(&$view,$view_var, $output){
23
		$view->setVar($view_var,$output);
24
	}
25
26
	public function forward($initialController,$controller,$action,$params=array()){
27
		return $initialController->forward($controller,$action,$params,true,true,true);
28
	}
29
30
	public function renderContent($initialControllerInstance,$viewName, $params=NULL) {
31
		return $initialControllerInstance->loadView($viewName,$params,true);
32
	}
33
34
	public function fromDispatcher($dispatcher){
35
		return Startup::$urlParts;
36
	}
37
}
38