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
Afficher le fichier Open project: vanilla/vanilla Class Usage Examples

Méthodes publiques

Свойство 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

Свойство 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.

Méthodes publiques

Méthode 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 méthode

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

__toString() public méthode

Magic method for type casting to string.
public __toString ( ) : string
Résultat string

allowed() public méthode

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.
Résultat boolean Whether the item has permission to be added to the items list.

assetTarget() public méthode

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

data() public méthode

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

fetchView() public méthode

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

fetchViewLocation() public méthode

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

getView() public méthode

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

name() public méthode

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

path() public méthode

public path ( boolean $NewValue = false ) : boolean | string
$NewValue boolean
Résultat boolean | string

render() public méthode

Output HTML.
public render ( )

setData() public méthode

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

setView() public méthode

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

toString() public méthode

Unless this method is overridden, it will attempt to find and return a view related to this module automatically.
public toString ( ) : string
Résultat 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
Résultat 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