Zend Framework  3.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
HeadStyle Class Reference

Helper for setting and retrieving stylesheets. More...

Public Member Functions

 __construct ()
 Constructor.
 
 __invoke ($content=null, $placement= 'APPEND', $attributes=[])
 Return headStyle object.
 
 __call ($method, $args)
 Overload method calls.
 
 toString ($indent=null)
 Create string representation of placeholder.
 
 captureStart ($type=Placeholder\Container\AbstractContainer::APPEND, $attrs=null)
 Start capture action.
 
 captureEnd ()
 End capture action and store.
 
 createData ($content, array $attributes)
 Create data item for use in stack.
 
 itemToString (stdClass $item, $indent)
 Convert content and attributes into valid style tag.
 
 append ($value)
 Override append to enforce style creation.
 
 offsetSet ($index, $value)
 Override offsetSet to enforce style creation.
 
 prepend ($value)
 Override prepend to enforce style creation.
 
 set ($value)
 Override set to enforce style creation.
 
- Public Member Functions inherited from AbstractStandalone
 __construct ()
 Constructor.
 
 __call ($method, $args)
 Overload.
 
 __set ($key, $value)
 Overloading: set property value.
 
 __get ($key)
 Overloading: retrieve property.
 
 __isset ($key)
 Overloading: check if property is set.
 
 __unset ($key)
 Overloading: unset property.
 
 __toString ()
 Cast to string representation.
 
 toString ()
 String representation.
 
 setAutoEscape ($autoEscape=true)
 Set whether or not auto escaping should be used.
 
 getAutoEscape ()
 Return whether autoEscaping is enabled or disabled.
 
 setContainer (AbstractContainer $container)
 Set container on which to operate.
 
 getContainer ()
 Retrieve placeholder container.
 
 deleteContainer ()
 Delete a container.
 
 setContainerClass ($name)
 Set the container class to use.
 
 getContainerClass ()
 Retrieve the container class.
 
 setEscaper (Escaper $escaper)
 Set Escaper instance.
 
 getEscaper ($enc= 'UTF-8')
 Get Escaper instance.
 
 count ()
 Countable.
 
 offsetExists ($offset)
 ArrayAccess: offsetExists.
 
 offsetGet ($offset)
 ArrayAccess: offsetGet.
 
 offsetSet ($offset, $value)
 ArrayAccess: offsetSet.
 
 offsetUnset ($offset)
 ArrayAccess: offsetUnset.
 
 getIterator ()
 IteratorAggregate: get Iterator.
 
- Public Member Functions inherited from AbstractHelper
 setView (Renderer $view)
 Set the View object.
 
 getView ()
 Get the view object.
 

Protected Member Functions

 isValid ($value)
 Determine if a value is a valid style tag.
 
- Protected Member Functions inherited from AbstractStandalone
 escape ($string)
 Escape a string.
 

Protected Attributes

 $regKey = 'Zend_View_Helper_HeadStyle'
 
 $optionalAttributes = ['lang', 'title', 'media', 'dir']
 
 $mediaTypes
 
 $captureAttrs = null
 
 $captureLock
 
 $captureType
 
- Protected Attributes inherited from AbstractStandalone
 $autoEscape = true
 
 $container
 
 $containerClass = 'Zend\View\Helper\Placeholder\Container'
 
 $escapers = []
 
- Protected Attributes inherited from AbstractHelper
 $view = null
 

Detailed Description

Helper for setting and retrieving stylesheets.

Allows the following method calls: HeadStyle appendStyle($content, $attributes = array()) HeadStyle offsetSetStyle($index, $content, $attributes = array()) HeadStyle prependStyle($content, $attributes = array()) HeadStyle setStyle($content, $attributes = array())

Constructor & Destructor Documentation

__construct ( )

Constructor.

Set separator to PHP_EOL.

Member Function Documentation

__call (   $method,
  $args 
)

Overload method calls.

Parameters
string$method
array$args
Exceptions
Exception\BadMethodCallExceptionWhen no $content provided or invalid method
Returns
void
__invoke (   $content = null,
  $placement = 'APPEND',
  $attributes = [] 
)

Return headStyle object.

Returns headStyle helper object; optionally, allows specifying

Parameters
string$contentStylesheet contents
string$placementAppend, prepend, or set
string | array$attributesOptional attributes to utilize
Returns
HeadStyle
append (   $value)

Override append to enforce style creation.

Parameters
mixed$value
Exceptions
Exception\InvalidArgumentException
Returns
void
captureEnd ( )

End capture action and store.

Returns
void
captureStart (   $type = Placeholder\Container\AbstractContainer::APPEND,
  $attrs = null 
)

Start capture action.

Parameters
string$type
string$attrs
Exceptions
Exception\RuntimeException
Returns
void
createData (   $content,
array  $attributes 
)

Create data item for use in stack.

Parameters
string$content
array$attributes
Returns
stdClass
isValid (   $value)
protected

Determine if a value is a valid style tag.

Parameters
mixed$value
Returns
bool
itemToString ( stdClass  $item,
  $indent 
)

Convert content and attributes into valid style tag.

Parameters
stdClass$itemItem to render
string$indentIndentation to use
Returns
string
offsetSet (   $index,
  $value 
)

Override offsetSet to enforce style creation.

Parameters
string | int$index
mixed$value
Exceptions
Exception\InvalidArgumentException
Returns
void
prepend (   $value)

Override prepend to enforce style creation.

Parameters
mixed$value
Exceptions
Exception\InvalidArgumentException
Returns
void
set (   $value)

Override set to enforce style creation.

Parameters
mixed$value
Exceptions
Exception\InvalidArgumentException
Returns
void
toString (   $indent = null)

Create string representation of placeholder.

Parameters
string | int$indent
Returns
string

Member Data Documentation

$captureAttrs = null
protected
$captureLock
protected
$captureType
protected
$mediaTypes
protected
Initial value:
= [
'all', 'aural', 'braille', 'handheld', 'print',
'projection', 'screen', 'tty', 'tv'
]
$optionalAttributes = ['lang', 'title', 'media', 'dir']
protected
$regKey = 'Zend_View_Helper_HeadStyle'
protected