PHP Class Devise\Pages\Interpreter\DeviseTag

ファイルを表示 Open project: devisephp/cms Class Usage Examples

Public Properties

Property Type Description
$alternateTarget string Alternate target for live updates
$bindingType string This could be a model, field or collection binding type
$category string Category name provides us with a dropdown in the sidebar for a group.
$chain string The chain array of string value pairs for a model or attribute
$collection string Collection name
$collectionName string The human name of the collection
$defaults string Default values to set on this devise tag
$group string Group name of the tag. We can group together different nodes.
$humanName string Human name of the devise tag
$id string Identifier of the devise tag
$key string Key name
$type string Type of the devise tag (text, image, etc)
$value string String value of the entire matched string that was regex out. This parameters above are extracted from this value

Public Methods

Method Description
__construct ( string $str, $parsed = null ) Create a new devise tag
__toString ( ) : string Convert this object to a string
toArray ( $escaped = '', $hasKeys = false ) : array Converts our devise tag into a giant ass array

Protected Methods

Method Description
arrayAsString ( array $array ) : string Converts this array to a string version that we can read in a blade php view later
createChainArray ( string $key ) : string We can't assume that the model will just be a single variable it might be nested inside of another variable such as $page->someModel
extractBindingType ( [type] $collection, [type] $key ) : [type] [extractBindingType description]
extractKeyAndCollection ( string $str ) : array Extracts out the key and collection from a string
extractParametersForCollection ( string $key, array $params ) : void Extracts out parameters for collection. They are different because collections have a collection name in the place where a group name should be. So this throws everything off by one
extractParametersForVariable ( string $key, array $params ) : void Extracts out parameters for a variable binding type which is essentially a model or model attribute type
extractParametersFromParsedStr ( $params ) : void Extracts out the parameters from a parsed devise string
extractParametersFromUnparsedCreatorStr ( string $params ) : void Extracts out the parameters from an unparsed devise create model
extractParametersFromUnparsedStr ( $params ) : void Extracts out the parameters from an unparsed devise string
humanize ( string $str ) : string Create a human version name of this string
isStringParsed ( string $str ) : boolean Checks the string to see if it is parsed or not
stripquotes ( string $str ) : string Strips off the quotes from the beginning and end of string

Method Details

__construct() public method

Create a new devise tag
public __construct ( string $str, $parsed = null )
$str string

__toString() public method

Convert this object to a string
public __toString ( ) : string
return string

arrayAsString() protected method

Converts this array to a string version that we can read in a blade php view later
protected arrayAsString ( array $array ) : string
$array array
return string

createChainArray() protected method

Furthermore we cannot assume that this is a model, we will have to check to ensure it is a Eloquent model later when the code is actually running. At this point we are just passing variables, the check actually happens in the devise_model method which is an alias for dvsPageData->addModel.
protected createChainArray ( string $key ) : string
$key string
return string

extractBindingType() protected method

[extractBindingType description]
protected extractBindingType ( [type] $collection, [type] $key ) : [type]
$collection [type]
$key [type]
return [type]

extractKeyAndCollection() protected method

Extracts out the key and collection from a string
protected extractKeyAndCollection ( string $str ) : array
$str string
return array

extractParametersForCollection() protected method

Extracts out parameters for collection. They are different because collections have a collection name in the place where a group name should be. So this throws everything off by one
protected extractParametersForCollection ( string $key, array $params ) : void
$key string
$params array
return void

extractParametersForVariable() protected method

Extracts out parameters for a variable binding type which is essentially a model or model attribute type
protected extractParametersForVariable ( string $key, array $params ) : void
$key string
$params array
return void

extractParametersFromParsedStr() protected method

Extracts out the parameters from a parsed devise string
protected extractParametersFromParsedStr ( $params ) : void
return void

extractParametersFromUnparsedCreatorStr() protected method

Extracts out the parameters from an unparsed devise create model
protected extractParametersFromUnparsedCreatorStr ( string $params ) : void
$params string
return void

extractParametersFromUnparsedStr() protected method

Extracts out the parameters from an unparsed devise string
protected extractParametersFromUnparsedStr ( $params ) : void
return void

humanize() protected method

Create a human version name of this string
protected humanize ( string $str ) : string
$str string
return string

isStringParsed() protected method

Checks the string to see if it is parsed or not
protected isStringParsed ( string $str ) : boolean
$str string
return boolean

stripquotes() protected method

Strips off the quotes from the beginning and end of string
protected stripquotes ( string $str ) : string
$str string
return string

toArray() public method

Converts our devise tag into a giant ass array
public toArray ( $escaped = '', $hasKeys = false ) : array
return array

Property Details

$alternateTarget public_oe property

Alternate target for live updates
public string $alternateTarget
return string

$bindingType public_oe property

This could be a model, field or collection binding type
public string $bindingType
return string

$category public_oe property

Category name provides us with a dropdown in the sidebar for a group.
public string $category
return string

$chain public_oe property

The chain array of string value pairs for a model or attribute
public string $chain
return string

$collection public_oe property

Collection name
public string $collection
return string

$collectionName public_oe property

The human name of the collection
public string $collectionName
return string

$defaults public_oe property

Default values to set on this devise tag
public string $defaults
return string

$group public_oe property

Group name of the tag. We can group together different nodes.
public string $group
return string

$humanName public_oe property

Human name of the devise tag
public string $humanName
return string

$id public_oe property

Identifier of the devise tag
public string $id
return string

$key public_oe property

Key name
public string $key
return string

$type public_oe property

Type of the devise tag (text, image, etc)
public string $type
return string

$value public_oe property

String value of the entire matched string that was regex out. This parameters above are extracted from this value
public string $value
return string