phpMv -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
JsUtils.php
Go to the documentation of this file.
1<?php
2
3namespace Ajax\php\yii;
4
5use yii\helpers\Url;
6
7class JsUtils extends \Ajax\JsUtils{
8 public function getUrl($url){
9 if($url==="")
10 $url="/";
11 return Url::toRoute($url);
12 }
13
14 public function addViewElement($identifier,$content,&$view){
15 $params=$view->params;
16 if (\array_key_exists("q", $params)===false) {
17 $view->params["q"]=array();
18 }
19 $view->params["q"][$identifier]=$content;
20 }
21
22 public function createScriptVariable(&$view,$view_var, $output){
23 $view->params[$view_var]=$output;
24 }
25
26 public function forward($initialControllerInstance,$controllerName,$actionName,$params=array()){
27 \ob_start();
28 $ctrInfo=\yii::$app->createController($controllerName."/".$actionName);
29 $ctrInfo[0]->{$ctrInfo[1]}($params);
30 $result=\ob_get_contents();
31 \ob_end_clean();
32 return $result;
33 }
34
35 public function renderContent($initialControllerInstance,$viewName, $params=NULL) {
36 return \yii::$app->view->render($viewName,$params);
37 }
38
39 public function fromDispatcher($dispatcher){
40 $uri=new \Ajax\php\yii\URI();
41 return $uri->segment_array();
42 }
43}
JQuery PHP library.
Definition JsUtils.php:23
fromDispatcher($dispatcher)
Collects url parts from the request dispatcher : controllerName, actionName, parameters Used internal...
Definition JsUtils.php:39
getUrl($url)
Generates an URL Used internally by phpMv.
Definition JsUtils.php:8
renderContent($initialControllerInstance, $viewName, $params=NULL)
render the content of an existing view : $viewName and set the response to the modal content Used int...
Definition JsUtils.php:35
createScriptVariable(&$view, $view_var, $output)
Creates the script variable script_foot Used internally by phpMv.
Definition JsUtils.php:22
forward($initialControllerInstance, $controllerName, $actionName, $params=array())
Forwards to.
Definition JsUtils.php:26
addViewElement($identifier, $content, &$view)
Adds the array of controls q in the $view element Used internally by phpMv.
Definition JsUtils.php:14