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
파일 보기 프로젝트 열기: atk4/atk4 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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