Пример #1
0
 /**
  * Inject content
  */
 public function injectContent(NodeInterface $child, NodeInterface $parent)
 {
     if ($child instanceof BlockInterface or !$child->isPhp()) {
         $source = $child->compile();
     } else {
         $source = $this->php($child->compile());
     }
     if (!($validate = $child->validate())) {
         $this->getLexicon()->getFoundation()->getNodeFactory()->getCollection()->forget($child->getId());
     }
     $content = preg_replace($this->search($child->getExtractionId()), $source, $parent->getCurrentContent(), self::LIMIT);
     $parent->setCurrentContent($content);
 }