Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
License.php
Go to the documentation of this file.
1 <?php
7 
8 use Magento\Setup\Model\License as LicenseModel;
9 use Zend\Mvc\Controller\AbstractActionController;
10 use Zend\View\Model\ViewModel;
11 
17 class License extends AbstractActionController
18 {
24  protected $license;
25 
31  public function __construct(LicenseModel $license)
32  {
33  $this->license = $license;
34  }
35 
41  public function indexAction()
42  {
43  $contents = $this->license->getContents();
44  $view = new ViewModel;
45  if ($contents === false) {
46  $view->setTemplate('error/404');
47  $view->setVariable('message', 'Cannot find license file.');
48  } else {
49  $view->setTerminal(true);
50  $view->setVariable('license', $contents);
51  }
52  return $view;
53  }
54 }
$contents
Definition: website.php:14
__construct(LicenseModel $license)
Definition: License.php:31