File: D:/HostingSpaces/SBogers33/bbec.nl/workbench/komma/kms/src/Komma/Kms/Core/Attributes/KmsView.php
<?php
/**
* Short description for the file.
*
* @author Komma <info@komma.pro>
* @copyright (c) 2012-2015, Komma Mediadesign
*/
namespace Komma\Kms\Core\Attributes;
class KmsView extends KmsAttribute{
public $label;
public $viewName;
public $viewComposer;
public $data;
function __construct($key, $value, array $options = [], array $errors = [], $languageId = null, $section = null)
{
parent::__construct($key, $value, $options, $errors, $languageId, $section);
$this->label = $this->getOption('label', $key);
$this->viewName = $this->getOption('viewName', $key);
$this->viewComposer = $this->getOption('viewComposer', $key);
$this->data = $this->getOption('data', $key);
if($this->viewComposer)
\View::composer($this->viewName, $this->viewComposer);
}
public function render()
{
return \View::make('kms::attributes.view', [
'viewName' => $this->viewName,
'attribute' => $this,
'data' => $this->data
]);
}
}