PHP Class jQuery_Chain, atk4

jQuery chain proxy. Returned by view->js(). Calls to this class will be converted into jQuery calls. Feel free to call _XX functions in this class. There are some of JS functions which you can call directly from this class. You can call any jQuery function. We name them here just to pass PHP Analyzer checks.
Inheritance: extends AbstractModel
Afficher le fichier Open project: atk4/atk4 Class Usage Examples

Méthodes publiques

Свойство Type Description
$app App_Web
$base It looks that this property is not used
$debug boolean
$enclose boolean | jQuery_Chain
$library string
$owner View
$prepend string
$preventDefault boolean
$str string
$univ_called boolean

Méthodes publiques

Méthode Description
__call ( string $name, mixed $arguments ) Call any jQuery library method
__get ( string $property ) This enables you to have syntax like this:
__toString ( ) : string Converting this object into string will produce JavaScript code
_css ( string $file ) Specify requirement for stylesheet. Will load dynamically.
_enclose ( jQuery_Chain $fn = null, boolean $preventDefault = false ) Chain will not be called but will return callable function instead.
_fn ( string $name, array $arguments = [] ) Convert reserved words or used methods into js calls, such as "execute"
_library ( string $library ) Allows to chain calls on different library.
_load ( string $file ) Specify requirement for extra javascript include. Will load dynamically.
_prepend ( array | string $code ) Execute more JavaScript code before chain. Avoid using.
_render ( ) : string Render and return js chain as string
_safe_js_string ( string $str ) : string [private] used by custom json_encoding
_selector ( mixed $selector = null ) Chain binds to parent object by default. Use this to use other selector $('selector')
_selectorDocument ( ) Use this to bind chain to document $(document).
_selectorRegion ( ) Use this to bind chain to "region" $(region). Region is defined by ATK when reloading.
_selectorThis ( ) Use this to bind chain to "this" $(this).
_selectorWindow ( ) Use this to bind chain to window $(window).
debug ( ) Enable debug mode
each ( ) Some methods shouldn't be special!
execute ( ) Send chain in response to form submit, button click or ajaxec() function for AJAX control output.
getLink ( string $text ) : string Returns HTML for a link with text $text. When clicked will execute this chain.
getString ( ) : string Returns js chain as string
redirect ( string $page = null, array $arg = [] ) Calls real redirect (from univ), but accepts page name.
reload ( array $arg = [], jQuery_Chain $fn = null, string $url = null, integer $interval = null ) Reload object.
univ ( ) Prevents calling univ() multiple times.

Méthodes protégées

Méthode Description
_flattern_objects ( mixed $arg, boolean $return_comma_list = false ) : string [private] custom json_encoding. called on function arguments.

Method Details

__call() public méthode

Call any jQuery library method
public __call ( string $name, mixed $arguments )
$name string
$arguments mixed

__get() public méthode

$this->js()->offset()->top <-- access object items, if object is returned by chained method call.
public __get ( string $property )
$property string

__toString() public méthode

Converting this object into string will produce JavaScript code
public __toString ( ) : string
Résultat string

_css() public méthode

Specify requirement for stylesheet. Will load dynamically.
public _css ( string $file )
$file string

_enclose() public méthode

Chain will not be called but will return callable function instead.
public _enclose ( jQuery_Chain $fn = null, boolean $preventDefault = false )
$fn jQuery_Chain
$preventDefault boolean

_flattern_objects() protected méthode

[private] custom json_encoding. called on function arguments.
protected _flattern_objects ( mixed $arg, boolean $return_comma_list = false ) : string
$arg mixed
$return_comma_list boolean
Résultat string

_fn() public méthode

Convert reserved words or used methods into js calls, such as "execute"
public _fn ( string $name, array $arguments = [] )
$name string
$arguments array

_library() public méthode

If you are using jQuery, then you can call _selector('blah') which will result in $('blah') prefix, however if you want to chain to any other library you can use this modifier instead: _library('window.player').play(); will result in window.player.play(); You must be sure to properly escape the string!
public _library ( string $library )
$library string

_load() public méthode

Specify requirement for extra javascript include. Will load dynamically.
public _load ( string $file )
$file string

_prepend() public méthode

Execute more JavaScript code before chain. Avoid using.
public _prepend ( array | string $code )
$code array | string

_render() public méthode

Render and return js chain as string
public _render ( ) : string
Résultat string

_safe_js_string() public méthode

[private] used by custom json_encoding
public _safe_js_string ( string $str ) : string
$str string
Résultat string

_selector() public méthode

Chain binds to parent object by default. Use this to use other selector $('selector')
public _selector ( mixed $selector = null )
$selector mixed

_selectorDocument() public méthode

..
public _selectorDocument ( )

_selectorRegion() public méthode

Use this to bind chain to "region" $(region). Region is defined by ATK when reloading.
public _selectorRegion ( )

_selectorThis() public méthode

..
public _selectorThis ( )

_selectorWindow() public méthode

..
public _selectorWindow ( )

debug() public méthode

Enable debug mode
public debug ( )

each() public méthode

Some methods shouldn't be special!
public each ( )

execute() public méthode

Send chain in response to form submit, button click or ajaxec() function for AJAX control output.
public execute ( )

getString() public méthode

Returns js chain as string
public getString ( ) : string
Résultat string

redirect() public méthode

Use url() for 1st argument manually anyway.
public redirect ( string $page = null, array $arg = [] )
$page string Page name
$arg array Arguments

reload() public méthode

You can bind this to custom event and trigger it if object is not directly accessible. If interval is given, then object will periodically reload itself.
public reload ( array $arg = [], jQuery_Chain $fn = null, string $url = null, integer $interval = null )
$arg array
$fn jQuery_Chain
$url string
$interval integer Interval in milisec. how often to reload object

univ() public méthode

Useful for backwards compatibility and in case of human mistake
public univ ( )

Property Details

$app public_oe property

public App_Web $app
Résultat App_Web

$base public_oe property

It looks that this property is not used
public $base

$debug public_oe property

public bool $debug
Résultat boolean

$enclose public_oe property

public bool|jQuery_Chain $enclose
Résultat boolean | jQuery_Chain

$library public_oe property

public string $library
Résultat string

$owner public_oe property

public View $owner
Résultat View

$prepend public_oe property

public string $prepend
Résultat string

$preventDefault public_oe property

public bool $preventDefault
Résultat boolean

$str public_oe property

public string $str
Résultat string

$univ_called public_oe property

public bool $univ_called
Résultat boolean