Tale\Jade\Parser\Node::findArray PHP Method

findArray() public method

Plus all it's children-children recursively and returns an array with all of them I you want to do further searching on it, you should rather use the Generator-version ->find() to improve memory-usage
public findArray ( string $type ) : array
$type string the node type to search for
return array an array containing all found children
    public function findArray($type)
    {
        return iterator_to_array($this->find($type));
    }

Usage Example

Beispiel #1
0
 /**
  * Finds all mixins and loops them through handleMixin.
  *
  * Duplicated mixins will throw an exception if the replaceMixins-options
  * is false
  *
  * @param Node $node the node to search mixins in
  *
  * @return $this
  * @throws Exception when a mixin name occurs twice and replaceMixins is false
  */
 protected function handleMixins(Node $node)
 {
     $mixins = $node->findArray('mixin');
     //Save all mixins in $this->mixins for our mixinCalls to reference them
     foreach ($mixins as $mixinNode) {
         if (isset($this->mixins[$mixinNode->name]) && !$this->options['replaceMixins']) {
             $this->throwException("Duplicate mixin name {$mixinNode->name}", $mixinNode);
         }
         $this->mixins[$mixinNode->name] = $mixinNode;
     }
     //Handle the mixins
     foreach ($this->mixins as $mixinNode) {
         $this->handleMixin($mixinNode);
     }
     return $this;
 }
All Usage Examples Of Tale\Jade\Parser\Node::findArray