API Documentation

Zend/View/Helper/HeadScript.php

Show: inherited
Table of Contents

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_View  
Subpackage
Helper  
Version
$Id: HeadScript.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_View_Helper_HeadScript

Package: Zend\View\Helper

Helper for setting and retrieving script elements for HTML head section

Parent(s)
\Zend_View_Helper_Placeholder_Container_Standalone < \Zend_View_Helper_Abstract
Children
\Zend_View_Helper_InlineScript
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Uses
\Zend_View_Helper_Placeholder_Container_Standalone  

Constants

Constant  FILE = 'FILE'
Constant  SCRIPT = 'SCRIPT'

Properties

Propertyprotectedbool  $_arbitraryAttributes= 'false'

Are arbitrary attributes allowed?

Default valuefalseDetails
Type
bool
Propertyprotected  $_captureLock= ''
Details
Type
Propertyprotected  $_captureScriptAttrs= 'null'
Default valuenullDetails
Type
Propertyprotected  $_captureScriptType= 'null'
Default valuenullDetails
Type
Propertyprotected  $_captureType= ''
Details
Type
Propertyprotectedarray  $_optionalAttributes= 'array( 'charset''

Optional allowed attributes for script tag

Default valuearray( 'charset'Details
Type
array
Propertyprotectedstring  $_regKey= ''Zend_View_Helper_HeadScript''

Registry key for placeholder

Default value'Zend_View_Helper_HeadScript'Details
Type
string
Propertyprotectedstring  $_requiredAttributes= 'array('type')'

Required attributes for script tag

Default valuearray('type')Details
Type
string
Propertypublicbool  $useCdata= 'false'

Whether or not to format scripts using CDATA; used only if doctype helper is not accessible

Default valuefalseDetails
Type
bool

Methods

methodpublic__call( string $method, array $args ) : \Zend_View_Helper_HeadScript

Overload method access

Allows the following method calls: - appendFile($src, $type = 'text/javascript', $attrs = array()) - offsetSetFile($index, $src, $type = 'text/javascript', $attrs = array()) - prependFile($src, $type = 'text/javascript', $attrs = array()) - setFile($src, $type = 'text/javascript', $attrs = array()) - appendScript($script, $type = 'text/javascript', $attrs = array()) - offsetSetScript($index, $src, $type = 'text/javascript', $attrs = array()) - prependScript($script, $type = 'text/javascript', $attrs = array()) - setScript($script, $type = 'text/javascript', $attrs = array())

Parameters
Name Type Description
$method string
$args array
Returns
Type Description
\Zend_View_Helper_HeadScript
Throws
Exception Description
\Zend_View_Exception if too few arguments or invalid method
methodpublic__construct( ) : void

Constructor

Set separator to PHP_EOL.

methodprotected_isDuplicate( string $file ) : bool

Is the file specified a duplicate?

Parameters
Name Type Description
$file string
Returns
Type Description
bool
methodprotected_isValid( mixed $value ) : bool

Is the script provided valid?

Parameters
Name Type Description
$value mixed
Returns
Type Description
bool
methodpublicappend( string $value ) : void

Override append

Parameters
Name Type Description
$value string
methodpublicarbitraryAttributesAllowed( ) : bool

Are arbitrary attributes allowed?

Returns
Type Description
bool
methodpubliccaptureEnd( ) : void

End capture action and store

methodpubliccaptureStart( mixed $captureType = Zend_View_Helper_Placeholder_Container_Abstract::APPEND,  $type = 'text/javascript',  $attrs = array() ) : void

Start capture action

Parameters
Name Type Description
$captureType mixed
$type
$attrs
methodpubliccreateData( string $type, array $attributes, string $content = null ) : \stdClass

Create data item containing all necessary components of script

Parameters
Name Type Description
$type string
$attributes array
$content string
Returns
Type Description
\stdClass
methodpublicheadScript( string $mode = Zend_View_Helper_HeadScript::FILE, string $spec = null, string $placement = 'APPEND', array $attrs = array(), string $type = 'text/javascript' ) : \Zend_View_Helper_HeadScript

Return headScript object

Returns headScript helper object; optionally, allows specifying a script or script file to include.

Parameters
Name Type Description
$mode string

Script or file

$spec string

Script/url

$placement string

Append, prepend, or set

$attrs array

Array of script attributes

$type string

Script type and/or array of script attributes

Returns
Type Description
\Zend_View_Helper_HeadScript
methodpublicitemToString(  $item, string|int $indent,  $escapeStart,  $escapeEnd ) : string

Create script HTML

Parameters
Name Type Description
$item
$indent string|int
$escapeStart
$escapeEnd
Returns
Type Description
string
methodpublicoffsetSet( string|int $index, mixed $value ) : void

Override offsetSet

Parameters
Name Type Description
$index string|int
$value mixed
methodpublicprepend( string $value ) : void

Override prepend

Parameters
Name Type Description
$value string
methodpublicset( string $value ) : void

Override set

Parameters
Name Type Description
$value string
methodpublicsetAllowArbitraryAttributes( bool $flag ) : \Zend_View_Helper_HeadScript

Set flag indicating if arbitrary attributes are allowed

Parameters
Name Type Description
$flag bool
Returns
Type Description
\Zend_View_Helper_HeadScript
methodpublictoString( string|int $indent = null ) : string

Retrieve string representation

Parameters
Name Type Description
$indent string|int
Returns
Type Description
string
Documentation was generated by DocBlox 0.15.1.