@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | } |
14 | 14 | |
15 | 15 | public function setClass($classNames) { |
16 | - if(is_array($classNames)){ |
|
16 | + if (is_array($classNames)) { |
|
17 | 17 | $classNames=implode(" ", $classNames); |
18 | 18 | } |
19 | 19 | $this->setProperty("class", $classNames); |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function fromArray($array) { |
46 | 46 | $array=parent::fromArray($array); |
47 | - foreach ( $array as $key => $value ) { |
|
47 | + foreach ($array as $key => $value) { |
|
48 | 48 | $this->setProperty($key, $value); |
49 | 49 | } |
50 | 50 | return $array; |
@@ -27,15 +27,15 @@ discard block |
||
27 | 27 | return $this->content; |
28 | 28 | } |
29 | 29 | |
30 | - public function addContent($content,$before=false) { |
|
30 | + public function addContent($content, $before=false) { |
|
31 | 31 | if (is_array($this->content)===false) { |
32 | - if(isset($this->content)) |
|
33 | - $this->content=array ($this->content); |
|
32 | + if (isset($this->content)) |
|
33 | + $this->content=array($this->content); |
|
34 | 34 | else |
35 | 35 | $this->content=array(); |
36 | 36 | } |
37 | - if($before) |
|
38 | - array_unshift($this->content,$content); |
|
37 | + if ($before) |
|
38 | + array_unshift($this->content, $content); |
|
39 | 39 | else |
40 | 40 | $this->content []=$content; |
41 | 41 | return $this; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | if ($this->content instanceof HtmlDoubleElement) { |
51 | 51 | $this->content->run($js); |
52 | 52 | } else if (is_array($this->content)) { |
53 | - foreach ( $this->content as $itemContent ) { |
|
53 | + foreach ($this->content as $itemContent) { |
|
54 | 54 | if ($itemContent instanceof HtmlDoubleElement) { |
55 | 55 | $itemContent->run($js); |
56 | 56 | } |
@@ -29,15 +29,17 @@ |
||
29 | 29 | |
30 | 30 | public function addContent($content,$before=false) { |
31 | 31 | if (is_array($this->content)===false) { |
32 | - if(isset($this->content)) |
|
33 | - $this->content=array ($this->content); |
|
34 | - else |
|
35 | - $this->content=array(); |
|
32 | + if(isset($this->content)) { |
|
33 | + $this->content=array ($this->content); |
|
34 | + } else { |
|
35 | + $this->content=array(); |
|
36 | + } |
|
37 | + } |
|
38 | + if($before) { |
|
39 | + array_unshift($this->content,$content); |
|
40 | + } else { |
|
41 | + $this->content []=$content; |
|
36 | 42 | } |
37 | - if($before) |
|
38 | - array_unshift($this->content,$content); |
|
39 | - else |
|
40 | - $this->content []=$content; |
|
41 | 43 | return $this; |
42 | 44 | } |
43 | 45 |
@@ -2,21 +2,21 @@ |
||
2 | 2 | namespace Ajax\service; |
3 | 3 | class JString { |
4 | 4 | |
5 | - public static function contains($hay,$needle){ |
|
6 | - return strpos($hay, $needle) !== false; |
|
5 | + public static function contains($hay, $needle) { |
|
6 | + return strpos($hay, $needle)!==false; |
|
7 | 7 | } |
8 | 8 | public static function startswith($hay, $needle) { |
9 | - return substr($hay, 0, strlen($needle)) === $needle; |
|
9 | + return substr($hay, 0, strlen($needle))===$needle; |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | public static function endswith($hay, $needle) { |
13 | - return substr($hay, -strlen($needle)) === $needle; |
|
13 | + return substr($hay, -strlen($needle))===$needle; |
|
14 | 14 | } |
15 | 15 | |
16 | - public static function isNull($s){ |
|
16 | + public static function isNull($s) { |
|
17 | 17 | return (!isset($s) || NULL===$s || ""===$s); |
18 | 18 | } |
19 | - public static function isNotNull($s){ |
|
19 | + public static function isNotNull($s) { |
|
20 | 20 | return (isset($s) && NULL!==$s && ""!==$s); |
21 | 21 | } |
22 | 22 | } |
23 | 23 | \ No newline at end of file |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | class JArray { |
6 | 6 | |
7 | 7 | public static function isAssociative($array) { |
8 | - return (array_values($array) !== $array); |
|
8 | + return (array_values($array)!==$array); |
|
9 | 9 | // return (array_keys($array)!==range(0, count($array)-1)); |
10 | 10 | } |
11 | 11 | |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | return $array[$key]; |
15 | 15 | } |
16 | 16 | $values=array_values($array); |
17 | - if ($pos < sizeof($values)) |
|
17 | + if ($pos<sizeof($values)) |
|
18 | 18 | return $values[$pos]; |
19 | 19 | } |
20 | 20 | |
@@ -22,12 +22,12 @@ discard block |
||
22 | 22 | $result=NULL; |
23 | 23 | if (array_key_exists($key, $array)) { |
24 | 24 | $result=$array[$key]; |
25 | - if ($condition($result) === true) |
|
25 | + if ($condition($result)===true) |
|
26 | 26 | return $result; |
27 | 27 | } |
28 | 28 | $values=array_values($array); |
29 | - foreach ( $values as $val ) { |
|
30 | - if ($condition($val) === true) |
|
29 | + foreach ($values as $val) { |
|
30 | + if ($condition($val)===true) |
|
31 | 31 | return $val; |
32 | 32 | } |
33 | 33 | return $result; |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | $result=""; |
45 | 45 | if (\is_array($glue)) { |
46 | 46 | $size=\sizeof($pieces); |
47 | - if ($size > 0) { |
|
48 | - for($i=0; $i < $size - 1; $i++) { |
|
49 | - $result.=$pieces[$i] . @$glue[$i]; |
|
47 | + if ($size>0) { |
|
48 | + for ($i=0; $i<$size-1; $i++) { |
|
49 | + $result.=$pieces[$i].@$glue[$i]; |
|
50 | 50 | } |
51 | - $result.=$pieces[$size - 1]; |
|
51 | + $result.=$pieces[$size-1]; |
|
52 | 52 | } |
53 | 53 | } else { |
54 | 54 | $result=\implode($glue, $pieces); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | public static function dimension($array) { |
60 | 60 | if (is_array(reset($array))) { |
61 | - $return=self::dimension(reset($array)) + 1; |
|
61 | + $return=self::dimension(reset($array))+1; |
|
62 | 62 | } else { |
63 | 63 | $return=1; |
64 | 64 | } |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | public static function sortAssociative($array, $sortedKeys=array()) { |
69 | - $newArray=array (); |
|
70 | - foreach ( $sortedKeys as $key ) { |
|
69 | + $newArray=array(); |
|
70 | + foreach ($sortedKeys as $key) { |
|
71 | 71 | if (\array_key_exists($key, $array)) { |
72 | 72 | $newArray[$key]=$array[$key]; |
73 | 73 | } |
@@ -14,21 +14,24 @@ discard block |
||
14 | 14 | return $array[$key]; |
15 | 15 | } |
16 | 16 | $values=array_values($array); |
17 | - if ($pos < sizeof($values)) |
|
18 | - return $values[$pos]; |
|
17 | + if ($pos < sizeof($values)) { |
|
18 | + return $values[$pos]; |
|
19 | + } |
|
19 | 20 | } |
20 | 21 | |
21 | 22 | public static function getConditionalValue($array, $key, $condition) { |
22 | 23 | $result=NULL; |
23 | 24 | if (array_key_exists($key, $array)) { |
24 | 25 | $result=$array[$key]; |
25 | - if ($condition($result) === true) |
|
26 | - return $result; |
|
26 | + if ($condition($result) === true) { |
|
27 | + return $result; |
|
28 | + } |
|
27 | 29 | } |
28 | 30 | $values=array_values($array); |
29 | 31 | foreach ( $values as $val ) { |
30 | - if ($condition($val) === true) |
|
31 | - return $val; |
|
32 | + if ($condition($val) === true) { |
|
33 | + return $val; |
|
34 | + } |
|
32 | 35 | } |
33 | 36 | return $result; |
34 | 37 | } |
@@ -36,8 +39,9 @@ discard block |
||
36 | 39 | public static function getDefaultValue($array, $key, $default=NULL) { |
37 | 40 | if (array_key_exists($key, $array)) { |
38 | 41 | return $array[$key]; |
39 | - } else |
|
40 | - return $default; |
|
42 | + } else { |
|
43 | + return $default; |
|
44 | + } |
|
41 | 45 | } |
42 | 46 | |
43 | 47 | public static function implode($glue, $pieces) { |
@@ -30,7 +30,7 @@ |
||
30 | 30 | if ($stopPropagation===true) { |
31 | 31 | $result.="event.stopPropagation();\n"; |
32 | 32 | } |
33 | - switch($this->method) { |
|
33 | + switch ($this->method) { |
|
34 | 34 | case "get": |
35 | 35 | $result.=$js->getDeferred($url, $responseElement, $params, $callback, $attr); |
36 | 36 | break; |
@@ -14,8 +14,9 @@ |
||
14 | 14 | } |
15 | 15 | |
16 | 16 | public function compile(JsUtils $js=null) { |
17 | - if ($js==null) |
|
18 | - return; |
|
17 | + if ($js==null) { |
|
18 | + return; |
|
19 | + } |
|
19 | 20 | $result=""; |
20 | 21 | $params="{}"; |
21 | 22 | $callback=NULL; |
@@ -4,24 +4,24 @@ discard block |
||
4 | 4 | |
5 | 5 | use Illuminate\Support\Facades\App; |
6 | 6 | |
7 | -class JsUtils extends \Ajax\JsUtils{ |
|
8 | - public function getUrl($url){ |
|
7 | +class JsUtils extends \Ajax\JsUtils { |
|
8 | + public function getUrl($url) { |
|
9 | 9 | return \url($url); |
10 | 10 | } |
11 | - public function addViewElement($identifier,$content,&$view){ |
|
11 | + public function addViewElement($identifier, $content, &$view) { |
|
12 | 12 | $controls=$view->__get("q"); |
13 | - if (isset($controls) === false) { |
|
14 | - $controls=array (); |
|
13 | + if (isset($controls)===false) { |
|
14 | + $controls=array(); |
|
15 | 15 | } |
16 | 16 | $controls[$identifier]=$content; |
17 | 17 | $view->__set("q", $controls); |
18 | 18 | } |
19 | 19 | |
20 | - public function createScriptVariable(&$view,$view_var, $output){ |
|
21 | - $view->__set($view_var,$output); |
|
20 | + public function createScriptVariable(&$view, $view_var, $output) { |
|
21 | + $view->__set($view_var, $output); |
|
22 | 22 | } |
23 | 23 | |
24 | - public function forward($initialControllerInstance,$controllerName,$actionName,$params=NULL){ |
|
24 | + public function forward($initialControllerInstance, $controllerName, $actionName, $params=NULL) { |
|
25 | 25 | \ob_start(); |
26 | 26 | App::make($controllerName)->{$actionName}($params); |
27 | 27 | $result=\ob_get_contents(); |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | return $result; |
30 | 30 | } |
31 | 31 | |
32 | - public function renderContent($initialControllerInstance,$viewName, $params=NULL) { |
|
33 | - return \view()->make($viewName,$params)->render(); |
|
32 | + public function renderContent($initialControllerInstance, $viewName, $params=NULL) { |
|
33 | + return \view()->make($viewName, $params)->render(); |
|
34 | 34 | } |
35 | 35 | |
36 | - public function fromDispatcher($dispatcher){ |
|
36 | + public function fromDispatcher($dispatcher) { |
|
37 | 37 | return $dispatcher->segments(); |
38 | 38 | } |
39 | 39 | } |
40 | 40 | \ No newline at end of file |
@@ -48,15 +48,15 @@ |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | public function renderContent($initialControllerInstance,$viewName, $params=NULL) { |
51 | - if ($initialControllerInstance->has('templating')) { |
|
52 | - return $initialControllerInstance->get('templating')->render($viewName, $params); |
|
53 | - } |
|
51 | + if ($initialControllerInstance->has('templating')) { |
|
52 | + return $initialControllerInstance->get('templating')->render($viewName, $params); |
|
53 | + } |
|
54 | 54 | |
55 | - if (!$initialControllerInstance->has('twig')) { |
|
56 | - throw new \LogicException('You can not use the "renderView" method if the Templating Component or the Twig Bundle are not available.'); |
|
57 | - } |
|
55 | + if (!$initialControllerInstance->has('twig')) { |
|
56 | + throw new \LogicException('You can not use the "renderView" method if the Templating Component or the Twig Bundle are not available.'); |
|
57 | + } |
|
58 | 58 | |
59 | - return $initialControllerInstance->get('twig')->render($viewName, $params); |
|
59 | + return $initialControllerInstance->get('twig')->render($viewName, $params); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | public function fromDispatcher($dispatcher){ |
@@ -6,27 +6,27 @@ discard block |
||
6 | 6 | use Symfony\Component\HttpFoundation\Request; |
7 | 7 | use Symfony\Component\HttpKernel\HttpKernelInterface; |
8 | 8 | use Ajax\service\JString; |
9 | -class JsUtils extends \Ajax\JsUtils{ |
|
10 | - public function getUrl($url){ |
|
9 | +class JsUtils extends \Ajax\JsUtils { |
|
10 | + public function getUrl($url) { |
|
11 | 11 | //$request = Request::createFromGlobals(); |
12 | 12 | $router=$this->getInjected(); |
13 | - if(isset($router)===true){ |
|
13 | + if (isset($router)===true) { |
|
14 | 14 | try { |
15 | 15 | $url=$router->generate($url); |
16 | - }catch (\Exception $e){ |
|
16 | + }catch (\Exception $e) { |
|
17 | 17 | return $router->getContext()->getBaseUrl(); |
18 | 18 | } |
19 | 19 | } |
20 | 20 | return $url; |
21 | 21 | } |
22 | - public function addViewElement($identifier,$content,&$view){ |
|
23 | - if(\array_key_exists("q", $view)===false){ |
|
22 | + public function addViewElement($identifier, $content, &$view) { |
|
23 | + if (\array_key_exists("q", $view)===false) { |
|
24 | 24 | $view["q"]=array(); |
25 | 25 | } |
26 | 26 | $view["q"][$identifier]=$content; |
27 | 27 | } |
28 | 28 | |
29 | - public function createScriptVariable(&$view,$view_var, $output){ |
|
29 | + public function createScriptVariable(&$view, $view_var, $output) { |
|
30 | 30 | $view[$view_var]=$output; |
31 | 31 | } |
32 | 32 | |
@@ -37,17 +37,17 @@ discard block |
||
37 | 37 | * @param array $params |
38 | 38 | * @see \Ajax\JsUtils::forward() |
39 | 39 | */ |
40 | - public function forward($initialControllerInstance,$controllerName,$actionName,$params=array()){ |
|
40 | + public function forward($initialControllerInstance, $controllerName, $actionName, $params=array()) { |
|
41 | 41 | $path=$params; |
42 | - $request = $initialControllerInstance->get('request_stack')->getCurrentRequest(); |
|
43 | - $path['_forwarded'] = $request->attributes; |
|
44 | - $path['_controller'] = $controllerName.":".$actionName; |
|
45 | - $subRequest = $request->duplicate([], null, $path); |
|
46 | - $response= $initialControllerInstance->get('http_kernel')->handle($subRequest, HttpKernelInterface::SUB_REQUEST); |
|
42 | + $request=$initialControllerInstance->get('request_stack')->getCurrentRequest(); |
|
43 | + $path['_forwarded']=$request->attributes; |
|
44 | + $path['_controller']=$controllerName.":".$actionName; |
|
45 | + $subRequest=$request->duplicate([], null, $path); |
|
46 | + $response=$initialControllerInstance->get('http_kernel')->handle($subRequest, HttpKernelInterface::SUB_REQUEST); |
|
47 | 47 | return $response->getContent(); |
48 | 48 | } |
49 | 49 | |
50 | - public function renderContent($initialControllerInstance,$viewName, $params=NULL) { |
|
50 | + public function renderContent($initialControllerInstance, $viewName, $params=NULL) { |
|
51 | 51 | if ($initialControllerInstance->has('templating')) { |
52 | 52 | return $initialControllerInstance->get('templating')->render($viewName, $params); |
53 | 53 | } |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | return $initialControllerInstance->get('twig')->render($viewName, $params); |
60 | 60 | } |
61 | 61 | |
62 | - public function fromDispatcher($dispatcher){ |
|
63 | - $request = $dispatcher->get('request_stack')->getCurrentRequest(); |
|
62 | + public function fromDispatcher($dispatcher) { |
|
63 | + $request=$dispatcher->get('request_stack')->getCurrentRequest(); |
|
64 | 64 | $uri=$request->getPathInfo(); |
65 | - if(JString::startswith($uri, "/")){ |
|
65 | + if (JString::startswith($uri, "/")) { |
|
66 | 66 | $uri=\substr($uri, 1); |
67 | 67 | } |
68 | 68 | return \explode("/", $uri); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | if(isset($router)===true){ |
14 | 14 | try { |
15 | 15 | $url=$router->generate($url); |
16 | - }catch (\Exception $e){ |
|
16 | + } catch (\Exception $e){ |
|
17 | 17 | return $router->getContext()->getBaseUrl(); |
18 | 18 | } |
19 | 19 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | use Phalcon\Mvc\View; |
8 | 8 | use Phalcon\Mvc\Controller; |
9 | 9 | |
10 | -class JsUtils extends \Ajax\JsUtils implements InjectionAwareInterface{ |
|
10 | +class JsUtils extends \Ajax\JsUtils implements InjectionAwareInterface { |
|
11 | 11 | protected $_di; |
12 | 12 | public function setDi(DiInterface $di) { |
13 | 13 | $this->_di=$di; |
@@ -18,50 +18,50 @@ discard block |
||
18 | 18 | return $this->_di; |
19 | 19 | } |
20 | 20 | |
21 | - public function getUrl($url){ |
|
21 | + public function getUrl($url) { |
|
22 | 22 | return $this->_di->get("url")->get($url); |
23 | 23 | } |
24 | 24 | |
25 | - public function addViewElement($identifier,$content,&$view){ |
|
25 | + public function addViewElement($identifier, $content, &$view) { |
|
26 | 26 | $controls=$view->getVar("q"); |
27 | - if (isset($controls) === false) { |
|
28 | - $controls=array (); |
|
27 | + if (isset($controls)===false) { |
|
28 | + $controls=array(); |
|
29 | 29 | } |
30 | 30 | $controls[$identifier]=$content; |
31 | 31 | $view->setVar("q", $controls); |
32 | 32 | } |
33 | 33 | |
34 | - public function createScriptVariable(&$view,$view_var, $output){ |
|
35 | - $view->setVar($view_var,$output); |
|
34 | + public function createScriptVariable(&$view, $view_var, $output) { |
|
35 | + $view->setVar($view_var, $output); |
|
36 | 36 | } |
37 | 37 | |
38 | - public function forward($initialController,$controller,$action,$params=array()){ |
|
39 | - $dispatcher = $initialController->dispatcher; |
|
38 | + public function forward($initialController, $controller, $action, $params=array()) { |
|
39 | + $dispatcher=$initialController->dispatcher; |
|
40 | 40 | $dispatcher->setControllerName($controller); |
41 | 41 | $dispatcher->setActionName($action); |
42 | 42 | $dispatcher->dispatch(); |
43 | - $template=$initialController->view->getRender($dispatcher->getControllerName(), $dispatcher->getActionName(),$dispatcher->getParams(), function ($view) { |
|
43 | + $template=$initialController->view->getRender($dispatcher->getControllerName(), $dispatcher->getActionName(), $dispatcher->getParams(), function($view) { |
|
44 | 44 | $view->setRenderLevel(View::LEVEL_ACTION_VIEW); |
45 | 45 | }); |
46 | 46 | return $template; |
47 | 47 | } |
48 | 48 | |
49 | - public function renderContent($initialControllerInstance,$viewName, $params=NULL) { |
|
50 | - list($controller,$action)=\explode("@", $viewName); |
|
51 | - $template=$initialControllerInstance->view->getRender($controller, $action, $params, function ($view) { |
|
49 | + public function renderContent($initialControllerInstance, $viewName, $params=NULL) { |
|
50 | + list($controller, $action)=\explode("@", $viewName); |
|
51 | + $template=$initialControllerInstance->view->getRender($controller, $action, $params, function($view) { |
|
52 | 52 | $view->setRenderLevel(View::LEVEL_ACTION_VIEW); |
53 | 53 | }); |
54 | 54 | return $template; |
55 | 55 | } |
56 | 56 | |
57 | - public function fromDispatcher($dispatcher){ |
|
57 | + public function fromDispatcher($dispatcher) { |
|
58 | 58 | $params=$dispatcher->getParams(); |
59 | 59 | $action=$dispatcher->getActionName(); |
60 | 60 | $items=array($dispatcher->getControllerName()); |
61 | - if(\sizeof($params)>0 || \strtolower($action)!="index" ){ |
|
61 | + if (\sizeof($params)>0 || \strtolower($action)!="index") { |
|
62 | 62 | $items[]=$action; |
63 | - foreach ($params as $p){ |
|
64 | - if(\is_object($p)===false) |
|
63 | + foreach ($params as $p) { |
|
64 | + if (\is_object($p)===false) |
|
65 | 65 | $items[]=$p; |
66 | 66 | } |
67 | 67 | } |
@@ -61,8 +61,9 @@ |
||
61 | 61 | if(\sizeof($params)>0 || \strtolower($action)!="index" ){ |
62 | 62 | $items[]=$action; |
63 | 63 | foreach ($params as $p){ |
64 | - if(\is_object($p)===false) |
|
65 | - $items[]=$p; |
|
64 | + if(\is_object($p)===false) { |
|
65 | + $items[]=$p; |
|
66 | + } |
|
66 | 67 | } |
67 | 68 | } |
68 | 69 | return $items; |
@@ -4,14 +4,14 @@ discard block |
||
4 | 4 | |
5 | 5 | use yii\helpers\Url; |
6 | 6 | |
7 | -class JsUtils extends \Ajax\JsUtils{ |
|
8 | - public function getUrl($url){ |
|
9 | - if($url==="") |
|
7 | +class JsUtils extends \Ajax\JsUtils { |
|
8 | + public function getUrl($url) { |
|
9 | + if ($url==="") |
|
10 | 10 | $url="/"; |
11 | 11 | return Url::toRoute($url); |
12 | 12 | } |
13 | 13 | |
14 | - public function addViewElement($identifier,$content,&$view){ |
|
14 | + public function addViewElement($identifier, $content, &$view) { |
|
15 | 15 | $params=$view->params; |
16 | 16 | if (\array_key_exists("q", $params)==false) { |
17 | 17 | $view->params["q"]=array(); |
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | $view->params["q"][$identifier]=$content; |
20 | 20 | } |
21 | 21 | |
22 | - public function createScriptVariable(&$view,$view_var, $output){ |
|
22 | + public function createScriptVariable(&$view, $view_var, $output) { |
|
23 | 23 | $view->params[$view_var]=$output; |
24 | 24 | } |
25 | 25 | |
26 | - public function forward($initialControllerInstance,$controllerName,$actionName,$params=array()){ |
|
26 | + public function forward($initialControllerInstance, $controllerName, $actionName, $params=array()) { |
|
27 | 27 | \ob_start(); |
28 | 28 | $ctrInfo=\yii::$app->createController($controllerName."/".$actionName); |
29 | 29 | $ctrInfo[0]->{$ctrInfo[1]}($params); |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | return $result; |
33 | 33 | } |
34 | 34 | |
35 | - public function renderContent($initialControllerInstance,$viewName, $params=NULL) { |
|
36 | - return \yii::$app->view->render($viewName,$params); |
|
35 | + public function renderContent($initialControllerInstance, $viewName, $params=NULL) { |
|
36 | + return \yii::$app->view->render($viewName, $params); |
|
37 | 37 | } |
38 | 38 | |
39 | - public function fromDispatcher($dispatcher){ |
|
39 | + public function fromDispatcher($dispatcher) { |
|
40 | 40 | $uri=new \Ajax\php\yii\URI(); |
41 | 41 | return $uri->segment_array(); |
42 | 42 | } |
@@ -6,8 +6,9 @@ |
||
6 | 6 | |
7 | 7 | class JsUtils extends \Ajax\JsUtils{ |
8 | 8 | public function getUrl($url){ |
9 | - if($url==="") |
|
10 | - $url="/"; |
|
9 | + if($url==="") { |
|
10 | + $url="/"; |
|
11 | + } |
|
11 | 12 | return Url::toRoute($url); |
12 | 13 | } |
13 | 14 |