public
|
#
__construct( mixed[] $config = [], $owner = null )
Create widget with optional config
Create widget with optional config
Parameters
|
abstract public
|
|
abstract public
|
|
public
mixed
|
#
__get( string $name )
Forward to owner
Parameters
Returns
mixed
|
public
|
#
__set( string $name, mixed $value )
Forward to owner
Parameters
|
public
|
#
__call( string $name, mixed[] $arguments )
Forward to owner
Parameters
|
public
boolean
|
#
__isset( string $name )
Forward to owner
Parameters
Returns
boolean
|
public
|
#
__unset( string $name )
Forward to owner
Parameters
|
public
string
|
#
getId( )
Returns the ID of the widget or generates a new one if not set.
Returns the ID of the widget or generates a new one if not set.
Returns
string id of the widget.
|
public
|
#
setId( string $value )
Sets the ID of the widget.
Sets the ID of the widget.
Parameters
|
public
object
|
#
getOwner( )
Returns the owner/creator of this widget.
Returns the owner/creator of this widget.
Returns
object owner/creator of this widget. It could be either a widget or a controller.
|
public
|
#
setViewsPath( string $path )
Set views path. This is relative path for view resolving.
By default it's views folder.
Set views path. This is relative path for view resolving.
By default it's views folder.
Parameters
|
public
string
|
#
render( string $view, mixed[] $data = null, boolean $return = false )
Render view with data provided.
View name must not contain php extension.
Render view with data provided.
View name must not contain php extension.
Parameters
Returns
string
|
public
string
|
#
renderFile( string $file, mixed[] $data = null, boolean $return = false )
Render file with data provided.
Render file with data provided.
Parameters
Returns
string
|
public static
string
|
#
widget( mixed[] $config = [] )
Create and run widget. Use this in templates to properly initialize widgets.
This must be called from extending class.
Example:
echo ProgressBar::widget([
'percent' => 40
]);
Create and run widget. Use this in templates to properly initialize widgets.
This must be called from extending class.
Example:
echo ProgressBar::widget([
'percent' => 40
]);
Parameters
Returns
string HTML widget
|
public
string
|
#
__toString( )
This is equivalent of calling ::widget() with config from constructor.
Could be used for convenient outputting of simple widgets.
Example:
echo new Flags([], $this);
echo new Head(['title' => 'foot'], $this);
This is equivalent of calling ::widget() with config from constructor.
Could be used for convenient outputting of simple widgets.
Example:
echo new Flags([], $this);
echo new Head(['title' => 'foot'], $this);
Returns
string HTML output of widget.
|