File: D:/HostingSpaces/Eurotools/euro-tools.nl/app/KommaApp/Kms/Core/Attributes/KmsView.php
<?php
/**
*
*
* @author Komma <info@komma.pro>
* @copyright (c) 2012-2016, Komma
*/
namespace App\KommaApp\Kms\Core\Attributes;
class KmsView extends KmsAttribute{
public $label;
public $viewName;
public $viewComposer;
public $data;
function __construct($key, $value, array $options = [], array $errors = [], $siteId = null, $languageId = null, $section = null)
{
parent::__construct($key, $value, $options, $errors, $siteId, $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
])->render();
}
}