Exemple #1
0
 /**
  * Buffers the layout
  *
  * @return $this
  */
 protected function addLayout()
 {
     if ($this->parent->configHas('layout')) {
         $name = $this->parent->getName();
         $layout = secure_string(config('cms.path.layouts') . '/' . $this->parent->getConfig('layout'));
         $this->parent->setLayout($layout);
         Helper::setBufferKey($layout, 'page', $name);
     }
     return $this;
 }
Exemple #2
0
 public function buffer($key, $withLayout, $value = null)
 {
     $name = $this->getName();
     // If no value is defined, assume it resides in the config
     if (is_null($value)) {
         $value = Helper::getConfigKey($name, $key);
     }
     if (is_null($value)) {
         throw new \InvalidArgumentException("Cannot buffer an empty value.");
     }
     // If a layout is present, add the value to it's buffer instead
     $name = $withLayout ? $this->getLayout() : $this->getName();
     Helper::setBufferKey($name, $key, $value);
 }