HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/ASmits/kemi.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();
    }

}