예제 #1
0
 /**
  * Catch calls to fields on
  * the page's related entry.
  *
  * @param string $key
  * @return mixed
  */
 public function __get($key)
 {
     $entry = $this->object->getEntry();
     if ($entry->hasField($key)) {
         return (new Decorator())->decorate($entry)->{$key};
     }
     return parent::__get($key);
 }
예제 #2
0
 /**
  * Create a new FilePresenter instance.
  *
  * @param UrlGenerator $url
  * @param Request      $request
  * @param              $object
  */
 public function __construct(UrlGenerator $url, Request $request, $object)
 {
     $this->url = $url;
     $this->request = $request;
     parent::__construct($object);
 }