Example #1
0
 /**
  * {@inheritdoc}
  */
 public function __set($property, $value)
 {
     switch ($property) {
         case 'template':
             $this->type = Utilities::getContentType($value);
         case 'data':
         case 'withLayout':
             $this->{$property} = $value;
             return;
     }
     parent::__set($property, $value);
 }
Example #2
0
 /**
  * Construct asset response.
  * @param string $file Path to asset.
  */
 public function __construct($file)
 {
     parent::__construct(Http::OK, Utilities::getContentType($file));
     $this->file = $file;
     $this->modified = filemtime($file);
 }