Helper Class Reference

Inheritance diagram for Helper:

Overloadable Object Object AppHelper AppHelper AjaxHelper CacheHelper FormHelper HtmlHelper JavascriptHelper NumberHelper PaginatorHelper TextHelper TimeHelper XmlHelper AjaxHelper CacheHelper FormHelper HtmlHelper JavascriptHelper NumberHelper PaginatorHelper TextHelper TimeHelper XmlHelper

List of all members.


Public Member Functions

 _parseAttributes ($options, $exclude=null, $insertBefore= ' ', $insertAfter=null)
 addClass ($options=array(), $class=null, $key= 'class')
 afterLayout ()
 afterRender ()
 assign ($keyName, $values)
 beforeLayout ()
 beforeRender ()
 clean ($output)
 domId ($options=null, $id= 'id')
 field ()
 loadConfig ($name= 'tags')
 model ()
 modelID ()
 output ($str)
 setEntity ($entity, $setScope=false)
 setFormTag ($tagValue, $setScope=false)
 tagIsInvalid ($model=null, $field=null, $modelID=null)
 url ($url=null, $full=false)
 value ($options=array(), $field=null, $key= 'value')
 webroot ($file)

Public Attributes

 $action = null
 $argSeparator = null
 $base = null
 $data = null
 $helpers = null
 $here = null
 $namedArgs = null
 $params = array()
 $plugin = null
 $tags = array()
 $themeWeb = null
 $validationErrors = null
 $webroot = null

Detailed Description

Definition at line 44 of file helper.php.


Member Function Documentation

Helper::_parseAttributes ( options,
exclude = null,
insertBefore = ' ',
insertAfter = null 
)

Returns a space-delimited string with items of the $options array. If a key of $options array happens to be one of: + 'compact' + 'checked' + 'declare' + 'readonly' + 'disabled' + 'selected' + 'defer' + 'ismap' + 'nohref' + 'noshade' + 'nowrap' + 'multiple' + 'noresize'

And its value is one of: + 1 + true + 'true'

Then the value will be reset to be identical with key's name. If the value is not one of these 3, the parameter is not output.

Parameters:
array $options Array of options.
array $exclude Array of options to be excluded.
string $insertBefore String to be inserted before options.
string $insertAfter String to be inserted ater options.
Returns:
string

Definition at line 260 of file helper.php.

References $out.

Referenced by AjaxHelper::div(), HtmlHelper::link(), HtmlHelper::meta(), and FormHelper::radio().

Helper::addClass ( options = array(),
class = null,
key = 'class' 
)

Adds the given class to the element options

Parameters:
array $options
string $class
string $key
Returns:
array

Definition at line 630 of file helper.php.

Referenced by FormHelper::input().

Helper::afterLayout (  ) 

After layout callback. Overridden in subclasses.

Definition at line 689 of file helper.php.

Helper::afterRender (  ) 

After render callback. Overridden in subclasses.

Reimplemented in AjaxHelper, and JavascriptHelper.

Definition at line 677 of file helper.php.

Helper::assign ( keyName,
values 
)

Assigns values to tag templates.

Finds a tag template by $keyName, and replaces $values's keys with $values's keys.

Parameters:
string $keyName Name of the key in the tag array.
array $values Values to be inserted into tag.
Returns:
string Tag with inserted values.

Definition at line 659 of file helper.php.

References $out.

Helper::beforeLayout (  ) 

Before layout callback. Overridden in subclasses.

Definition at line 683 of file helper.php.

Helper::beforeRender (  ) 

Before render callback. Overridden in subclasses.

Definition at line 671 of file helper.php.

Helper::clean ( output  ) 

Used to remove harmful tags from content

Parameters:
mixed $output
Returns:
cleaned content for output public

Definition at line 214 of file helper.php.

References $output.

Helper::domId ( options = null,
id = 'id' 
)

Generates a DOM ID for the selected element, if one is not set.

Parameters:
mixed $options
string $id
Returns:
mixed

Definition at line 483 of file helper.php.

References Inflector::camelize(), field(), ClassRegistry::getObject(), model(), modelID(), and setEntity().

Referenced by FormHelper::input(), and FormHelper::label().

Helper::field (  ) 

Gets the currently-used model field of the rendering context.

Returns:
string

Definition at line 445 of file helper.php.

References ClassRegistry::getObject().

Referenced by domId(), FormHelper::error(), FormHelper::input(), FormHelper::radio(), setEntity(), tagIsInvalid(), and value().

Helper::loadConfig ( name = 'tags'  ) 

Parses tag templates into $this->tags.

Parameters:
$name file name
Returns:
array merged tags from config/$name.php

Definition at line 157 of file helper.php.

References $tags.

Helper::modelID (  ) 

Gets the ID of the currently-used model of the rendering context.

Returns:
mixed

Definition at line 436 of file helper.php.

References ClassRegistry::getObject().

Referenced by domId(), tagIsInvalid(), and value().

Helper::setEntity ( entity,
setScope = false 
)

Sets this helper's model and field properties to the dot-separated value-pair in $entity.

Parameters:
mixed $entity A field name, like "ModelName.fieldName" or "ModelName.ID.fieldName"
boolean $setScope Sets the view scope to the model specified in $tagValue
Returns:
void

Definition at line 311 of file helper.php.

References field(), Set::filter(), ClassRegistry::getObject(), ClassRegistry::isKeySet(), and model().

Referenced by FormHelper::create(), domId(), FormHelper::end(), FormHelper::error(), FormHelper::input(), FormHelper::isFieldError(), and value().

Helper::setFormTag ( tagValue,
setScope = false 
)

Deprecated:

Definition at line 760 of file helper.php.

Helper::tagIsInvalid ( model = null,
field = null,
modelID = null 
)

Returns false if given FORM field has no errors. Otherwise it returns the constant set in the array Model->validationErrors.

Parameters:
string $model Model name as string
string $field Fieldname as string
integer $modelID Unique index identifying this record within the form
Returns:
boolean True on errors.

Definition at line 457 of file helper.php.

References field(), ClassRegistry::getObject(), model(), and modelID().

Referenced by FormHelper::error(), and FormHelper::isFieldError().

Helper::url ( url = null,
full = false 
)

Finds URL for specified action.

Returns an URL pointing to a combination of controller and action. Param $url can be: + Empty - the method will find adress to actuall controller/action. + '/' - the method will find base URL of application. + A combination of controller/action - the method will find url for it.

Parameters:
mixed $url Cake-relative URL, like "/products/edit/92" or "/presidents/elect/4" or an array specifying any of the following: 'controller', 'action', and/or 'plugin', in addition to named arguments (keyed array elements), and standard URL arguments (indexed array elements)
boolean $full If true, the full base URL will be prepended to the result
Returns:
string Full translated URL with base path.

Definition at line 182 of file helper.php.

References $url, and Router::url().

Referenced by RssHelper::channel(), FormHelper::create(), AjaxHelper::editor(), AjaxHelper::form(), RssHelper::item(), HtmlHelper::link(), AjaxHelper::link(), HtmlHelper::meta(), AjaxHelper::remoteFunction(), and AjaxHelper::sortable().

Helper::value ( options = array(),
field = null,
key = 'value' 
)

Helper::webroot ( file  ) 

Checks if a file exists when theme is used, if no file is found default location is returned

Parameters:
string $file
Returns:
string $webPath web path to file.

Definition at line 191 of file helper.php.

References $file, and env().

Referenced by HtmlHelper::meta().


Member Data Documentation

Helper::$action = null

Reimplemented in HtmlHelper, and RssHelper.

Definition at line 87 of file helper.php.

Helper::$argSeparator = null

Definition at line 111 of file helper.php.

Helper::$base = null

Reimplemented in HtmlHelper, and RssHelper.

Definition at line 57 of file helper.php.

Helper::$helpers = null

Reimplemented in AjaxHelper, FormHelper, PaginatorHelper, and RssHelper.

Definition at line 51 of file helper.php.

Helper::$here = null

Reimplemented in HtmlHelper, and RssHelper.

Definition at line 75 of file helper.php.

Helper::$namedArgs = null

Definition at line 105 of file helper.php.

Helper::$plugin = null

Definition at line 93 of file helper.php.

Helper::$tags = array()

Reimplemented in HtmlHelper, and JavascriptHelper.

Definition at line 125 of file helper.php.

Referenced by loadConfig().

Helper::$themeWeb = null

Definition at line 69 of file helper.php.

Helper::$validationErrors = null

Definition at line 118 of file helper.php.

Helper::$webroot = null

Definition at line 63 of file helper.php.


The documentation for this class was generated from the following file: