phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
JsUtils Class Reference

JQuery PHP library. More...

+ Inheritance diagram for JsUtils:

Public Member Functions

 getUrl ($url)
 Generates an URL Used internally by phpMv. More...
 
 addViewElement ($identifier, $content, &$view)
 Adds the array of controls q in the $view element Used internally by phpMv. More...
 
 createScriptVariable (&$view, $view_var, $output)
 Creates the script variable script_foot Used internally by phpMv. More...
 
 forward ($initialController, $controller, $action, $params)
 Forwards to. More...
 
 renderContent ($initialControllerInstance, $viewName, $params=NULL)
 render the content of an existing view : $viewName and set the response to the modal content Used internally by phpMv More...
 
 fromDispatcher ($dispatcher)
 Collects url parts from the request dispatcher : controllerName, actionName, parameters Used internally by phpMv. More...
 
 ui (JqueryUI $ui=NULL)
 getter or setter of the jQuery-UI variable More...
 
 bootstrap (Bootstrap $bootstrap=NULL)
 getter or setter of the Twitter Bootstrap variable More...
 
 semantic (Semantic $semantic=NULL)
 getter or setter of the Semantic-UI variable More...
 
 config ($config=NULL)
 
 __construct ($params=array(), $injected=NULL)
 
 __set ($property, $value)
 
 getParam ($key)
 
 output ($array_js)
 Outputs the called javascript to the screen. More...
 
 compile (&$view=NULL, $view_var='script_foot', $script_tags=TRUE)
 gather together all script needing to be output More...
 
 clear_compile ()
 Clears the array of script events collected for output. More...
 
 getScript ($offset=0)
 
 scriptCount ()
 
 inline ($script, $cdata=TRUE)
 Outputs a <script> tag. More...
 
 generate_json ($result=NULL, $match_array_type=FALSE)
 Can be passed a database result or associative array and returns a JSON formatted string. More...
 
 _prep_args ($result, $is_key=FALSE)
 Ensures a standard json value and escapes values. More...
 
 _add_event ($element, $js, $event, $preventDefault=false, $stopPropagation=false, $immediatly=true, $listenerOn=false)
 Constructs the syntax for an event, and adds to into the array for compilation. More...
 
 getInjected ()
 
 setParam (string $param, $value)
 

Protected Member Functions

 initialize ()
 To override for special initialization of the component. More...
 

Protected Attributes

 $params
 
 $injected
 
 $_ui
 
 $_bootstrap
 
 $_semantic
 
 $config
 

Private Member Functions

 _create_json ($json_result, $match_array_type)
 

Detailed Description

JQuery PHP library.

Author
jcheron
Version
1.0.5 Apache 2 http://www.apache.org/licenses/ JsUtils Class : Service to be injected

Definition at line 23 of file JsUtils.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $params = array(),
  $injected = NULL 
)
Parameters
array$params['debug'=>true,'defer'=>false,'ajax'=>['ajaxTransition'=>null,'attr'=>'','historize'=>false,'attr'=>''],'beforeCompileHtml'=>null,'semantic'=>false,'bootstrap'=>false,'historize'=>true,'autoActiveLinks'=>true]
mixed$injectedoptional param for Symfony/Ubiquity

Definition at line 196 of file JsUtils.php.

Member Function Documentation

◆ __set()

__set (   $property,
  $value 
)

Definition at line 266 of file JsUtils.php.

◆ _add_event()

_add_event (   $element,
  $js,
  $event,
  $preventDefault = false,
  $stopPropagation = false,
  $immediatly = true,
  $listenerOn = false 
)

Constructs the syntax for an event, and adds to into the array for compilation.

Parameters
string$elementThe element to attach the event to
string$jsThe code to execute
string$eventThe event to pass
boolean$preventDefaultIf set to true, the default action of the event will not be triggered.
boolean$stopPropagationPrevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event.
boolean$immediatlyif true, execute this code immediatly
boolean|stringfalse for an event associated with existing DOM elements, or a string selector and then the event is dynamically associated to all elements created in this selector
Returns
string

Definition at line 498 of file JsUtils.php.

◆ _create_json()

_create_json (   $json_result,
  $match_array_type 
)
private

Definition at line 427 of file JsUtils.php.

◆ _prep_args()

_prep_args (   $result,
  $is_key = FALSE 
)

Ensures a standard json value and escapes values.

Parameters
mixed$result
boolean$is_key
Returns
string

Definition at line 453 of file JsUtils.php.

◆ addViewElement()

addViewElement (   $identifier,
  $content,
$view 
)
abstract

Adds the array of controls q in the $view element Used internally by phpMv.

Parameters
string$identifier
string$content
object$view

◆ bootstrap()

bootstrap ( Bootstrap  $bootstrap = NULL)

getter or setter of the Twitter Bootstrap variable

Parameters
Bootstrap$bootstrap
Returns
Bootstrap

Definition at line 141 of file JsUtils.php.

◆ clear_compile()

clear_compile ( )

Clears the array of script events collected for output.

Returns
void

Definition at line 361 of file JsUtils.php.

◆ compile()

compile ( $view = NULL,
  $view_var = 'script_foot',
  $script_tags = TRUE 
)

gather together all script needing to be output

Parameters
object$view
string$view_varview script variable name, default : script_foot
boolean$script_tags
Returns
string

Definition at line 319 of file JsUtils.php.

◆ config()

config (   $config = NULL)
Parameters
Config$config
Returns
Config

Definition at line 176 of file JsUtils.php.

◆ createScriptVariable()

createScriptVariable ( $view,
  $view_var,
  $output 
)
abstract

Creates the script variable script_foot Used internally by phpMv.

Parameters
object$view
string$view_vardefault: script_foot
string$output

◆ forward()

forward (   $initialController,
  $controller,
  $action,
  $params 
)
abstract

Forwards to.

$controller::$action and set the response to the modal content Used internally by phpMv

Parameters
object$initialController
string$controllera controller
string$actionan action
array$params

◆ fromDispatcher()

fromDispatcher (   $dispatcher)
abstract

Collects url parts from the request dispatcher : controllerName, actionName, parameters Used internally by phpMv.

Parameters
mixed$dispatcher
Returns
array

◆ generate_json()

generate_json (   $result = NULL,
  $match_array_type = FALSE 
)

Can be passed a database result or associative array and returns a JSON formatted string.

Parameters
mixed$resultresult set or array
bool$match_array_typematch array types (defaults to objects)
Returns
string json formatted string

Definition at line 410 of file JsUtils.php.

◆ getInjected()

getInjected ( )

Definition at line 522 of file JsUtils.php.

◆ getParam()

getParam (   $key)
Parameters
string$key

Definition at line 286 of file JsUtils.php.

◆ getScript()

getScript (   $offset = 0)

Definition at line 374 of file JsUtils.php.

◆ getUrl()

getUrl (   $url)
abstract

Generates an URL Used internally by phpMv.

Parameters
string$url
Returns
string the generated url

◆ initialize()

initialize ( )
protected

To override for special initialization of the component.

Definition at line 264 of file JsUtils.php.

◆ inline()

inline (   $script,
  $cdata = TRUE 
)

Outputs a <script> tag.

Parameters
string$script
boolean$cdataIf a CDATA section should be added
Returns
string

Definition at line 394 of file JsUtils.php.

◆ output()

output (   $array_js)

Outputs the called javascript to the screen.

Parameters
string$array_jscode to output
Returns
string

Definition at line 298 of file JsUtils.php.

◆ renderContent()

renderContent (   $initialControllerInstance,
  $viewName,
  $params = NULL 
)
abstract

render the content of an existing view : $viewName and set the response to the modal content Used internally by phpMv

Parameters
object$initialControllerInstance
string$viewName
array$paramsThe parameters to pass to the view

◆ scriptCount()

scriptCount ( )

Definition at line 382 of file JsUtils.php.

◆ semantic()

semantic ( Semantic  $semantic = NULL)

getter or setter of the Semantic-UI variable

Parameters
Semantic$semantic
Returns
Semantic

Definition at line 159 of file JsUtils.php.

◆ setParam()

setParam ( string  $param,
  $value 
)

Definition at line 526 of file JsUtils.php.

◆ ui()

ui ( JqueryUI  $ui = NULL)

getter or setter of the jQuery-UI variable

Parameters
JqueryUI$ui
Returns
JqueryUI

Definition at line 123 of file JsUtils.php.

Field Documentation

◆ $_bootstrap

$_bootstrap
protected

Definition at line 40 of file JsUtils.php.

◆ $_semantic

$_semantic
protected

Definition at line 46 of file JsUtils.php.

◆ $_ui

$_ui
protected

Definition at line 34 of file JsUtils.php.

◆ $config

$config
protected

Definition at line 52 of file JsUtils.php.

◆ $injected

$injected
protected

Definition at line 28 of file JsUtils.php.

◆ $params

$params
protected

Definition at line 26 of file JsUtils.php.


The documentation for this class was generated from the following file: