Perforce Chronicle 2012.2/486814
API Documentation

Content_Form_Decorator_ContentLink Class Reference

Extends Zend_Form_Decorator_HtmlTag to make it aware of content records. More...

Inheritance diagram for Content_Form_Decorator_ContentLink:
P4Cms_Content_EnhancedDecoratorInterface

List of all members.

Public Member Functions

 getContentRecord ()
 Get the associated content record (if set).
 render ($content)
 Sets the href option to the uri of the content record, then renders using the parent method.
 setContentRecord ($content)
 Set the associated content record for this element.

Protected Attributes

 $_contentRecord = null
 $_tag = 'a'

Detailed Description

Extends Zend_Form_Decorator_HtmlTag to make it aware of content records.

This allows the decorator to create links to view the content.

Copyright:
2011-2012 Perforce Software. All rights reserved
License:
Please see LICENSE.txt in top-level folder of this distribution.
Version:
2012.2/486814

Member Function Documentation

Content_Form_Decorator_ContentLink::getContentRecord ( )

Get the associated content record (if set).

Returns:
null|P4Cms_Content the associated content record or null if none set.

Implements P4Cms_Content_EnhancedDecoratorInterface.

    {
        return $this->_contentRecord;
    }
Content_Form_Decorator_ContentLink::render ( content)

Sets the href option to the uri of the content record, then renders using the parent method.

Parameters:
string$contentThe content to decorate.
Returns:
string The decorated content.
    {
        $this->setOption('href', $this->getContentRecord()->getUri());
        
        return parent::render($content);
    }
Content_Form_Decorator_ContentLink::setContentRecord ( content)

Set the associated content record for this element.

Parameters:
P4Cms_Content$contentthe associated content record for this element.
Returns:
Content_Form_Decorator_ContentLink return this instance, for chaining

Implements P4Cms_Content_EnhancedDecoratorInterface.

     {
         $this->_contentRecord = $content;
         return $this;
     }

Member Data Documentation

Content_Form_Decorator_ContentLink::$_contentRecord = null [protected]
Content_Form_Decorator_ContentLink::$_tag = 'a' [protected]

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