winter/modules/cms/components/UnknownComponent.php
Samuel Georges 31ba5e29bd Introduce Resources component for testing
This should be considered experimental at this stage, however this component is used in every October website we've built thus far, it makes sense for it to be included in the core. Once tested we will look at documenting it with an accompanying screencast video.
2017-03-20 17:32:20 +11:00

36 lines
790 B
PHP

<?php namespace Cms\Components;
use Cms\Classes\CodeBase;
use Cms\Classes\ComponentBase;
class UnknownComponent extends ComponentBase
{
/**
* @var string Error message that is shown with this error component.
*/
protected $errorMessage;
/**
* @inheritDoc
*/
public function __construct($cmsObject, $properties, $errorMessage)
{
$this->errorMessage = $errorMessage;
$this->componentCssClass = 'error-component';
$this->inspectorEnabled = false;
parent::__construct($cmsObject, $properties);
}
/**
* @return array
*/
public function componentDetails()
{
return [
'name' => 'Unknown component',
'description' => $this->errorMessage
];
}
}