class HamlHelperNode in Sassy 7
HamlHelperNode class. Represent a helper in the Haml source. The helper is run on the output from child nodes when the node is rendered. @package PHamlP @subpackage Haml.tree
Hierarchy
- class \HamlNode
- class \HamlHelperNode
Expanded class hierarchy of HamlHelperNode
File
- phamlp/
haml/ tree/ HamlHelperNode.php, line 19
View source
class HamlHelperNode extends HamlNode {
const MATCH = '/(.*?)(\\w+)\\((.+?)\\)(?:\\s+(.*))?$/';
const PRE = 1;
const NAME = 2;
const ARGS = 3;
const BLOCK = 4;
/**
* @var string the helper class name
*/
private $class;
/**
* @var string helper method name
*/
private $pre;
/**
* @var string helper method name
*/
private $name;
/**
* @var string helper method arguments
*/
private $args;
/**
* HamlFilterNode constructor.
* Sets the filter.
* @param string helper class.
* @param string helper call.
* @return HamlHelperNode
*/
public function __construct($class, $pre, $name, $args, $parent) {
$this->class = $class;
$this->pre = $pre;
$this->name = $name;
$this->args = $args;
$this->parent = $parent;
$this->root = $parent->root;
$parent->children[] = $this;
}
/**
* Render this node.
* The filter is run on the content of child nodes before being returned.
* @return string the rendered node
*/
public function render() {
$children = '';
foreach ($this->children as $child) {
$children .= trim($child
->render());
}
// foreach
$output = '<?php ' . (empty($this->pre) ? 'echo' : $this->pre) . " {$this->class}::{$this->name}('{$children}',{$this->args}); ?>";
return $this
->debug($output);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
HamlHelperNode:: |
private | property | * | |
HamlHelperNode:: |
private | property | * | |
HamlHelperNode:: |
private | property | * | |
HamlHelperNode:: |
private | property | * | |
HamlHelperNode:: |
constant | |||
HamlHelperNode:: |
constant | |||
HamlHelperNode:: |
constant | |||
HamlHelperNode:: |
constant | |||
HamlHelperNode:: |
constant | |||
HamlHelperNode:: |
public | function |
* Render this node.
* The filter is run on the content of child nodes before being returned.
* Overrides HamlNode:: |
|
HamlHelperNode:: |
public | function |
* HamlFilterNode constructor.
* Sets the filter.
* Overrides HamlNode:: |
|
HamlNode:: |
protected | property | * | |
HamlNode:: |
public | property | * | |
HamlNode:: |
protected | property | * | |
HamlNode:: |
protected | property | * | |
HamlNode:: |
protected | property | * | |
HamlNode:: |
public | property | * | |
HamlNode:: |
public | property | * | |
HamlNode:: |
public | property | * | |
HamlNode:: |
private | property | * | |
HamlNode:: |
private | property | * | |
HamlNode:: |
protected | function | ||
HamlNode:: |
public | function | * Returns the node's children * | |
HamlNode:: |
public | function | * Returns the node's content and that of its child nodes * | |
HamlNode:: |
private | function | * Returns the filename for this node * | |
HamlNode:: |
public | function | * Returns the last child node of this node. * | |
HamlNode:: |
private | function | * Returns the indent level of this node. * | |
HamlNode:: |
private | function | * Returns the source for this node * | |
HamlNode:: |
public | function | * Returns the options. * | |
HamlNode:: |
public | function | * Returns the node's parent * | |
HamlNode:: |
public | function | * Returns the renderer. * | |
HamlNode:: |
private | function | * Returns the source for this node * | |
HamlNode:: |
public | function | * Returns a value indicating if this node has children * | |
HamlNode:: |
public | function | * Return a value indicating if this node has a parent * | |
HamlNode:: |
private | function | * Sets the indent level of this node. * Used during rendering to give correct indentation. * | |
HamlNode:: |
protected | function | * Adds a comment with source debug information for the current line to the output. * The debug information is: * + source file (relative to the application path) * + line number * + indent level * + source code * | |
HamlNode:: |
public | function | * Getter. * | |
HamlNode:: |
public | function | * Setter. * |