PHP Class Gdn_Module, vanilla

Provides basic functionality when extended by real modules.
Since: 2.0
Author: Mark O'Sullivan ([email protected])
Author: Todd Burry ([email protected])
Inheritance: extends Gdn_Pluggable, implements Gdn_IModule
Mostrar archivo Open project: vanilla/vanilla Class Usage Examples

Public Properties

Property Type Description
$AssetName The name of the current asset that is being rendered.
$Data Data that is passed into the view.
$Visible boolean

Protected Properties

Property Type Description
$_ApplicationFolder The name of the application folder that this module resides within.
$_Sender The object that constructed this object. Typically this should be a Controller object.
$_ThemeFolder The name of the theme folder that the application is currently using.
$view The filename of view to render, excluding the extension.

Public Methods

Method Description
__construct ( object $Sender = '', $ApplicationFolder = false ) Class constructor
__toString ( ) : string Magic method for type casting to string.
allowed ( boolean | string | array $isAllowed ) : boolean Checks whether an item is allowed by returning it if it is already a boolean, or checking the permission if it is a string or array.
assetTarget ( ) Returns the name of the asset where this component should be rendered.
data ( null $Name = null, string $Default = '' ) : array | mixed
fetchView ( $view = '' ) : string Returns the xhtml for this module as a fully parsed and rendered string.
fetchViewLocation ( string $View = '', string $ApplicationFolder = '' ) : array Returns the location of the view for this module in the filesystem.
getView ( ) : string
name ( ) : string Returns the name of this module. Unless it is overridden, it will simply return the class name.
path ( boolean $NewValue = false ) : boolean | string
render ( ) Output HTML.
setData ( $Name, $Value )
setView ( string $view )
toString ( ) : string Returns the component as a string to be rendered to the screen.

Method Details

__construct() public method

Class constructor
public __construct ( object $Sender = '', $ApplicationFolder = false )
$Sender object

__toString() public method

Magic method for type casting to string.
public __toString ( ) : string
return string

allowed() public method

Checks whether an item is allowed by returning it if it is already a boolean, or checking the permission if it is a string or array.
public allowed ( boolean | string | array $isAllowed ) : boolean
$isAllowed boolean | string | array Either a boolean to indicate whether to actually add the item or a permission string or array of permission strings (full match) to check.
return boolean Whether the item has permission to be added to the items list.

assetTarget() public method

Returns the name of the asset where this component should be rendered.
public assetTarget ( )

data() public method

public data ( null $Name = null, string $Default = '' ) : array | mixed
$Name null
$Default string
return array | mixed

fetchView() public method

Returns the xhtml for this module as a fully parsed and rendered string.
public fetchView ( $view = '' ) : string
return string

fetchViewLocation() public method

Returns the location of the view for this module in the filesystem.
public fetchViewLocation ( string $View = '', string $ApplicationFolder = '' ) : array
$View string
$ApplicationFolder string
return array

getView() public method

public getView ( ) : string
return string The filename of view to render, excluding the extension.

name() public method

Returns the name of this module. Unless it is overridden, it will simply return the class name.
public name ( ) : string
return string

path() public method

public path ( boolean $NewValue = false ) : boolean | string
$NewValue boolean
return boolean | string

render() public method

Output HTML.
public render ( )

setData() public method

public setData ( $Name, $Value )
$Name
$Value

setView() public method

public setView ( string $view )
$view string The filename of view to render, excluding the extension.

toString() public method

Unless this method is overridden, it will attempt to find and return a view related to this module automatically.
public toString ( ) : string
return string

Property Details

$AssetName public_oe property

The name of the current asset that is being rendered.
public $AssetName

$Data public_oe property

Data that is passed into the view.
public $Data

$Visible public_oe property

public bool $Visible
return boolean

$_ApplicationFolder protected_oe property

The name of the application folder that this module resides within.
protected $_ApplicationFolder

$_Sender protected_oe property

The object that constructed this object. Typically this should be a Controller object.
protected $_Sender

$_ThemeFolder protected_oe property

The name of the theme folder that the application is currently using.
protected $_ThemeFolder

$view protected_oe property

The filename of view to render, excluding the extension.
protected $view