PHP Класс 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.
Наследование: extends AbstractModel
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
_flattern_objects ( mixed $arg, boolean $return_comma_list = false ) : string [private] custom json_encoding. called on function arguments.

Описание методов

__call() публичный Метод

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

__get() публичный Метод

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

__toString() публичный Метод

Converting this object into string will produce JavaScript code
public __toString ( ) : string
Результат string

_css() публичный Метод

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

_enclose() публичный Метод

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() защищенный Метод

[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
Результат string

_fn() публичный Метод

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

_library() публичный Метод

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() публичный Метод

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

_prepend() публичный Метод

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

_render() публичный Метод

Render and return js chain as string
public _render ( ) : string
Результат string

_safe_js_string() публичный Метод

[private] used by custom json_encoding
public _safe_js_string ( string $str ) : string
$str string
Результат string

_selector() публичный Метод

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

_selectorDocument() публичный Метод

..
public _selectorDocument ( )

_selectorRegion() публичный Метод

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

_selectorThis() публичный Метод

..
public _selectorThis ( )

_selectorWindow() публичный Метод

..
public _selectorWindow ( )

debug() публичный Метод

Enable debug mode
public debug ( )

each() публичный Метод

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

execute() публичный Метод

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

getString() публичный Метод

Returns js chain as string
public getString ( ) : string
Результат string

redirect() публичный Метод

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

reload() публичный Метод

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() публичный Метод

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

Описание свойств

$app публичное свойство

public App_Web $app
Результат App_Web

$base публичное свойство

It looks that this property is not used
public $base

$debug публичное свойство

public bool $debug
Результат boolean

$enclose публичное свойство

public bool|jQuery_Chain $enclose
Результат boolean | jQuery_Chain

$library публичное свойство

public string $library
Результат string

$owner публичное свойство

public View $owner
Результат View

$prepend публичное свойство

public string $prepend
Результат string

$preventDefault публичное свойство

public bool $preventDefault
Результат boolean

$str публичное свойство

public string $str
Результат string

$univ_called публичное свойство

public bool $univ_called
Результат boolean