PHP Class Pocket, addons

显示文件 Open project: vanilla/addons Class Usage Examples

Public Properties

Property Type Description
$Body $var string The text to display in the pocket.
$Disabled Whether or not the pocket is disabled. The pocket can also be in testing-mode.
$EmbeddedNever $var bool Whether to disable the pocket for embedded comments. *
$Format The format of the pocket.
$Location $var string The location on the page to display the pocket.
$MobileNever $var array The repeat frequency.
$MobileOnly $var array The repeat frequency.
$Name $var string A descriptive name for the pocket to help keep it organized.
$NameTranslations array
$Page $var string The name of the page to put the pocket on.
$RepeatFrequency $var array The repeat frequency.
$RepeatType $var string How the pocket repeats on the page.
$ShowInDashboard boolean
$Type $var string Pocket type

Public Methods

Method Description
__construct ( string $Location = '' ) Pocket constructor.
canRender ( array $Data ) : boolean Whether or not this pocket should be processed based on its state.
isAd ( ) : boolean Determine whether the pocket is of type 'ad'.
load ( array $Data ) Load the pocket's data from an array.
pageName ( null $NameOrObject = null ) : mixed | null | string
parseRepeat ( $Repeat ) : array
render ( array $Data = NULL ) Render the pocket to the page.
repeat ( string $Type, integer | array $Frequency ) Set the repeat of the pocket.
toString ( null $Data = NULL ) : mixed | string
touch ( $Name, $Value )

Method Details

__construct() public method

Pocket constructor.
public __construct ( string $Location = '' )
$Location string

canRender() public method

Whether or not this pocket should be processed based on its state.
public canRender ( array $Data ) : boolean
$Data array Data specific to the request.
return boolean

isAd() public method

Determine whether the pocket is of type 'ad'.
public isAd ( ) : boolean
return boolean

load() public method

Load the pocket's data from an array.
public load ( array $Data )
$Data array

pageName() public static method

public static pageName ( null $NameOrObject = null ) : mixed | null | string
$NameOrObject null
return mixed | null | string

parseRepeat() public static method

public static parseRepeat ( $Repeat ) : array
$Repeat
return array

render() public method

@param array $Data additional data for the pocket.
public render ( array $Data = NULL )
$Data array

repeat() public method

@param string $Type The repeat type, contained in the various Pocket::REPEAT_* constants. - every: Repeats every x times. If $Frequency is an array then it will be interpretted as array($Frequency, $Begin). - indexes: Renders only at the given indexes, starting at 1.
public repeat ( string $Type, integer | array $Frequency )
$Type string
$Frequency integer | array The frequency of the repeating, see the $Type parameter for how this works.

toString() public method

public toString ( null $Data = NULL ) : mixed | string
$Data null
return mixed | string

touch() public static method

public static touch ( $Name, $Value )
$Name
$Value

Property Details

$Body public_oe property

$var string The text to display in the pocket.
public $Body

$Disabled public_oe property

Whether or not the pocket is disabled. The pocket can also be in testing-mode.
public $Disabled

$EmbeddedNever public_oe property

$var bool Whether to disable the pocket for embedded comments. *
public $EmbeddedNever

$Format public_oe property

The format of the pocket.
public $Format

$Location public_oe property

$var string The location on the page to display the pocket.
public $Location

$MobileNever public_oe property

$var array The repeat frequency.
public $MobileNever

$MobileOnly public_oe property

$var array The repeat frequency.
public $MobileOnly

$Name public_oe property

$var string A descriptive name for the pocket to help keep it organized.
public $Name

$NameTranslations public_oe static_oe property

public static array $NameTranslations
return array

$Page public_oe property

$var string The name of the page to put the pocket on.
public $Page

$RepeatFrequency public_oe property

$var array The repeat frequency.
public $RepeatFrequency

$RepeatType public_oe property

$var string How the pocket repeats on the page.
public $RepeatType

$ShowInDashboard public_oe property

public bool $ShowInDashboard
return boolean

$Type public_oe property

$var string Pocket type
public $Type