phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Ajax\common\html\traits Namespace Reference

Functions

 hookExists ($hookKey)
 
 getHook ($hookKey)
 
 addHook ($hookKey, $callable)
 Adds a new Hook. More...
 
 execHook ($hookKey,... $variables)
 Executes the hook with key $hookKey. More...
 
 addEvent ($event, $jsCode, $stopPropagation=false, $preventDefault=false)
 
 trigger ($event, $params="[]")
 
 jsTrigger ($event, $params="[this]")
 
 _addEvent ($event, $jsCode)
 
 on ($event, $jsCode, $stopPropagation=false, $preventDefault=false)
 
 onClick ($jsCode, $stopPropagation=false, $preventDefault=true)
 
 setClick ($jsCode)
 
 onCreate ($jsCode)
 
 addEventsOnRun (JsUtils $js=NULL)
 
 _eventsOnCreate (JsUtils $js=NULL)
 
 _ajaxOn ($operation, $event, $url, $responseElement="", $parameters=array())
 
 getOn ($event, $url, $responseElement="", $parameters=array())
 Performs a get to $url on the event $event on $element and display it in $responseElement. More...
 
 getOnClick ($url, $responseElement="", $parameters=array())
 Performs a get to $url on the click event on $element and display it in $responseElement. More...
 
 postOn ($event, $url, $params="{}", $responseElement="", $parameters=array())
 Performs a post to $url on the event $event on $element and display it in $responseElement. More...
 
 postOnClick ($url, $params="{}", $responseElement="", $parameters=array())
 Performs a post to $url on the click event on $element and display it in $responseElement. More...
 
 postFormOn ($event, $url, $form, $responseElement="", $parameters=array())
 Performs a post form with ajax. More...
 
 postFormOnClick ($url, $form, $responseElement="", $parameters=array())
 Performs a post form with ajax on click. More...
 
 jsDoJquery ($jqueryCall, $param="")
 
 executeOnRun ($jsCode)
 
 jsHtml ($content="")
 
 jsShow ()
 
 jsHide ()
 
 jsToggle ($value)
 
 getEvents ()
 
 ctrl ($name, $value, $typeCtrl)
 
 removeOldValues (&$oldValue, $allValues)
 
 _getElementBy ($callback, $elements)
 
 getProperties ()
 
 setProperties ($properties)
 
 setProperty ($name, $value)
 
 getProperty ($name)
 
 addToProperty ($name, $value, $separator=" ")
 
 addProperties ($properties)
 
 removePropertyValue ($name, $value)
 
 removePropertyValues ($name, $values)
 
 addToPropertyUnique ($name, $value, $typeCtrl)
 
 addToPropertyCtrl ($name, $value, $typeCtrl)
 
 addToPropertyCtrlCheck ($name, $value, $typeCtrl)
 
 removeProperty ($name)
 
 propertyContains ($propertyName, $value)
 
 setPropertyCtrl ($name, $value, $typeCtrl)
 
 getElementByPropertyValue ($propertyName, $value, $elements)
 
 jsSetContent (JsUtils $jsUtils)
 Generate the jquery script to set the elements to the HtmlNavElement. More...
 
 getRoot ()
 
 setRoot ($root)
 
 getAttr ()
 
 setAttr ($attr)
 Define the html attribute for each element url in ajax. More...
 
 __call ($method, $args)
 
 fromDispatcher (JsUtils $js, $dispatcher, $startIndex=0)
 

Variables

trait BaseHooksTrait
 
trait BaseHtmlEventsTrait
 
trait BaseHtmlPropertiesTrait
 
trait NavElementTrait
 

Function Documentation

◆ __call()

Ajax\common\html\traits\__call (   $method,
  $args 
)

Definition at line 44 of file NavElementTrait.php.

◆ _addEvent()

Ajax\common\html\traits\_addEvent (   $event,
  $jsCode 
)
Parameters
string$event
string | AjaxCall$jsCode
Returns
BaseHtml

Definition at line 48 of file BaseHtmlEventsTrait.php.

◆ _ajaxOn()

Ajax\common\html\traits\_ajaxOn (   $operation,
  $event,
  $url,
  $responseElement = "",
  $parameters = array() 
)
Parameters
string$operationhttp method get, post, postForm or json
string$eventthe event that triggers the request
string$urlThe url of the request
string$responseElementThe selector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false)
Returns
$this

Definition at line 136 of file BaseHtmlEventsTrait.php.

◆ _eventsOnCreate()

Ajax\common\html\traits\_eventsOnCreate ( JsUtils  $js = NULL)
protected

Definition at line 116 of file BaseHtmlEventsTrait.php.

◆ _getElementBy()

Ajax\common\html\traits\_getElementBy (   $callback,
  $elements 
)
abstractprotected

◆ addEvent()

Ajax\common\html\traits\addEvent (   $event,
  $jsCode,
  $stopPropagation = false,
  $preventDefault = false 
)
Parameters
string$event
string | AjaxCall$jsCode
boolean$stopPropagation
boolean$preventDefault
Returns
BaseHtml

Definition at line 25 of file BaseHtmlEventsTrait.php.

◆ addEventsOnRun()

Ajax\common\html\traits\addEventsOnRun ( JsUtils  $js = NULL)

Definition at line 91 of file BaseHtmlEventsTrait.php.

◆ addHook()

Ajax\common\html\traits\addHook (   $hookKey,
  $callable 
)

Adds a new Hook.

Parameters
String$hookKey
callable$callable

Definition at line 32 of file BaseHooksTrait.php.

◆ addProperties()

Ajax\common\html\traits\addProperties (   $properties)

Definition at line 63 of file BaseHtmlPropertiesTrait.php.

◆ addToProperty()

Ajax\common\html\traits\addToProperty (   $name,
  $value,
  $separator = " " 
)
abstract
Parameters
string$name
mixed$value
string$separator
Returns
$this

Definition at line 46 of file BaseHtmlPropertiesTrait.php.

◆ addToPropertyCtrl()

Ajax\common\html\traits\addToPropertyCtrl (   $name,
  $value,
  $typeCtrl 
)
abstract

Definition at line 87 of file BaseHtmlPropertiesTrait.php.

◆ addToPropertyCtrlCheck()

Ajax\common\html\traits\addToPropertyCtrlCheck (   $name,
  $value,
  $typeCtrl 
)
abstract

Definition at line 91 of file BaseHtmlPropertiesTrait.php.

◆ addToPropertyUnique()

Ajax\common\html\traits\addToPropertyUnique (   $name,
  $value,
  $typeCtrl 
)
protected

Definition at line 78 of file BaseHtmlPropertiesTrait.php.

◆ ctrl()

Ajax\common\html\traits\ctrl (   $name,
  $value,
  $typeCtrl 
)
abstractprotected

◆ execHook()

Ajax\common\html\traits\execHook (   $hookKey,
  $variables 
)

Executes the hook with key $hookKey.

Parameters
string$hookKey
mixed | null$variable
Returns
void|mixed

Definition at line 42 of file BaseHooksTrait.php.

◆ executeOnRun()

Ajax\common\html\traits\executeOnRun (   $jsCode)

Definition at line 233 of file BaseHtmlEventsTrait.php.

◆ fromDispatcher()

Ajax\common\html\traits\fromDispatcher ( JsUtils  $js,
  $dispatcher,
  $startIndex = 0 
)
abstract

◆ getAttr()

Ajax\common\html\traits\getAttr ( )

Definition at line 30 of file NavElementTrait.php.

◆ getElementByPropertyValue()

Ajax\common\html\traits\getElementByPropertyValue (   $propertyName,
  $value,
  $elements 
)
protected

Definition at line 118 of file BaseHtmlPropertiesTrait.php.

◆ getEvents()

Ajax\common\html\traits\getEvents ( )
Returns
array

Definition at line 255 of file BaseHtmlEventsTrait.php.

◆ getHook()

Ajax\common\html\traits\getHook (   $hookKey)
Parameters
string$hookKey
Returns
callable|NULL

Definition at line 20 of file BaseHooksTrait.php.

◆ getOn()

Ajax\common\html\traits\getOn (   $event,
  $url,
  $responseElement = "",
  $parameters = array() 
)
abstract

Performs a get to $url on the event $event on $element and display it in $responseElement.

Parameters
string$eventthe event that triggers the get request
string$urlThe url of the request
string$responseElementThe selector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false)
Returns
$this

Definition at line 152 of file BaseHtmlEventsTrait.php.

◆ getOnClick()

Ajax\common\html\traits\getOnClick (   $url,
  $responseElement = "",
  $parameters = array() 
)

Performs a get to $url on the click event on $element and display it in $responseElement.

Parameters
string$urlThe url of the request
string$responseElementThe selector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false)
Returns
$this

Definition at line 164 of file BaseHtmlEventsTrait.php.

◆ getProperties()

Ajax\common\html\traits\getProperties ( )

Definition at line 17 of file BaseHtmlPropertiesTrait.php.

◆ getProperty()

Ajax\common\html\traits\getProperty (   $name)
abstract

Definition at line 35 of file BaseHtmlPropertiesTrait.php.

◆ getRoot()

Ajax\common\html\traits\getRoot ( )

Definition at line 23 of file NavElementTrait.php.

◆ hookExists()

Ajax\common\html\traits\hookExists (   $hookKey)
Parameters
string$hookKey
Returns
boolean

Definition at line 12 of file BaseHooksTrait.php.

◆ jsDoJquery()

Ajax\common\html\traits\jsDoJquery (   $jqueryCall,
  $param = "" 
)

Definition at line 229 of file BaseHtmlEventsTrait.php.

◆ jsHide()

Ajax\common\html\traits\jsHide ( )

Definition at line 245 of file BaseHtmlEventsTrait.php.

◆ jsHtml()

Ajax\common\html\traits\jsHtml (   $content = "")

Definition at line 237 of file BaseHtmlEventsTrait.php.

◆ jsSetContent()

Ajax\common\html\traits\jsSetContent ( JsUtils  $jsUtils)

Generate the jquery script to set the elements to the HtmlNavElement.

Parameters
JsUtils$jsUtils

Definition at line 19 of file NavElementTrait.php.

◆ jsShow()

Ajax\common\html\traits\jsShow ( )

Definition at line 241 of file BaseHtmlEventsTrait.php.

◆ jsToggle()

Ajax\common\html\traits\jsToggle (   $value)

Definition at line 249 of file BaseHtmlEventsTrait.php.

◆ jsTrigger()

Ajax\common\html\traits\jsTrigger (   $event,
  $params = "[this]" 
)

Definition at line 39 of file BaseHtmlEventsTrait.php.

◆ on()

Ajax\common\html\traits\on (   $event,
  $jsCode,
  $stopPropagation = false,
  $preventDefault = false 
)
Parameters
string$event
string$jsCode
boolean$stopPropagation
boolean$preventDefault
Returns
BaseHtml

Definition at line 70 of file BaseHtmlEventsTrait.php.

◆ onClick()

Ajax\common\html\traits\onClick (   $jsCode,
  $stopPropagation = false,
  $preventDefault = true 
)

Definition at line 74 of file BaseHtmlEventsTrait.php.

◆ onCreate()

Ajax\common\html\traits\onCreate (   $jsCode)
abstract

Definition at line 82 of file BaseHtmlEventsTrait.php.

◆ postFormOn()

Ajax\common\html\traits\postFormOn (   $event,
  $url,
  $form,
  $responseElement = "",
  $parameters = array() 
)

Performs a post form with ajax.

Parameters
string$eventthe event that triggers the post request
string$urlThe url of the request
string$formThe form HTML id
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false)
Returns
$this

Definition at line 212 of file BaseHtmlEventsTrait.php.

◆ postFormOnClick()

Ajax\common\html\traits\postFormOnClick (   $url,
  $form,
  $responseElement = "",
  $parameters = array() 
)

Performs a post form with ajax on click.

Parameters
string$urlThe url of the request
string$formThe form HTML id
string$responseElementselector of the HTML element displaying the answer
array$parametersdefault : array("params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>NULL,"headers"=>null,"historize"=>false)
Returns
$this

Definition at line 225 of file BaseHtmlEventsTrait.php.

◆ postOn()

Ajax\common\html\traits\postOn (   $event,
  $url,
  $params = "{}",
  $responseElement = "",
  $parameters = array() 
)

Performs a post to $url on the event $event on $element and display it in $responseElement.

Parameters
string$eventthe event that triggers the post request
string$urlThe url of the request
string$paramsthe request parameters in JSON format
string$responseElementThe selector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false)
Returns
$this

Definition at line 178 of file BaseHtmlEventsTrait.php.

◆ postOnClick()

Ajax\common\html\traits\postOnClick (   $url,
  $params = "{}",
  $responseElement = "",
  $parameters = array() 
)

Performs a post to $url on the click event on $element and display it in $responseElement.

Parameters
string$urlThe url of the request
string$paramsthe request parameters in JSON format
string$responseElementThe selector of the HTML element displaying the answer
array$parametersdefault : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"ajaxLoader"=>null,"immediatly"=>true,"jqueryDone"=>"html","ajaxTransition"=>null,"jsCondition"=>null,"headers"=>null,"historize"=>false)
Returns
$this

Definition at line 199 of file BaseHtmlEventsTrait.php.

◆ propertyContains()

Ajax\common\html\traits\propertyContains (   $propertyName,
  $value 
)

Definition at line 104 of file BaseHtmlPropertiesTrait.php.

◆ removeOldValues()

Ajax\common\html\traits\removeOldValues ( $oldValue,
  $allValues 
)
abstractprotected

◆ removeProperty()

Ajax\common\html\traits\removeProperty (   $name)

Definition at line 98 of file BaseHtmlPropertiesTrait.php.

◆ removePropertyValue()

Ajax\common\html\traits\removePropertyValue (   $name,
  $value 
)

Definition at line 68 of file BaseHtmlPropertiesTrait.php.

◆ removePropertyValues()

Ajax\common\html\traits\removePropertyValues (   $name,
  $values 
)
protected

Definition at line 73 of file BaseHtmlPropertiesTrait.php.

◆ setAttr()

Ajax\common\html\traits\setAttr (   $attr)

Define the html attribute for each element url in ajax.

Parameters
string$attrhtml attribute
Returns
HtmlNavElement

Definition at line 39 of file NavElementTrait.php.

◆ setClick()

Ajax\common\html\traits\setClick (   $jsCode)

Definition at line 78 of file BaseHtmlEventsTrait.php.

◆ setProperties()

Ajax\common\html\traits\setProperties (   $properties)
Parameters
array$properties
Returns
$this

Definition at line 25 of file BaseHtmlPropertiesTrait.php.

◆ setProperty()

Ajax\common\html\traits\setProperty (   $name,
  $value 
)
abstract

Definition at line 30 of file BaseHtmlPropertiesTrait.php.

◆ setPropertyCtrl()

Ajax\common\html\traits\setPropertyCtrl (   $name,
  $value,
  $typeCtrl 
)
abstractprotected

Definition at line 112 of file BaseHtmlPropertiesTrait.php.

◆ setRoot()

Ajax\common\html\traits\setRoot (   $root)

Definition at line 26 of file NavElementTrait.php.

◆ trigger()

Ajax\common\html\traits\trigger (   $event,
  $params = "[]" 
)

Definition at line 35 of file BaseHtmlEventsTrait.php.

Variable Documentation

◆ BaseHooksTrait

trait BaseHooksTrait
Initial value:
{
protected $_hooks=[]

Definition at line 5 of file BaseHooksTrait.php.

◆ BaseHtmlEventsTrait

trait BaseHtmlEventsTrait
Initial value:
{
protected $_events=array ()

Definition at line 14 of file BaseHtmlEventsTrait.php.

◆ BaseHtmlPropertiesTrait

trait BaseHtmlPropertiesTrait
Initial value:
{
protected $properties=array ()

Definition at line 11 of file BaseHtmlPropertiesTrait.php.

◆ NavElementTrait

trait NavElementTrait
Initial value:
{
abstract public function contentAsString()

Definition at line 12 of file NavElementTrait.php.