/** * Constructor. * * @param ObjectConfig $config An optional ObjectConfig object with configuration options. */ public function __construct(ObjectConfig $config) { parent::__construct($config); //Authenticate none safe requests $this->registerCallback('before.post', array($this, 'authenticateRequest')); $this->registerCallback('before.put', array($this, 'authenticateRequest')); $this->registerCallback('before.delete', array($this, 'authenticateRequest')); //Sign GET request with a cookie token $this->registerCallback('after.get', array($this, 'signResponse')); //Force the controller to the information found in the request if ($config->request->query->has('view')) { $this->_controller = $config->request->query->get('view', 'alpha'); } }
/** * Constructor. * * @param ObjectConfig $config An optional ObjectConfig object with configuration options. */ public function __construct(ObjectConfig $config) { parent::__construct($config); //Resolve the request $this->addCommandCallback('before.include', '_resolveRequest'); }
/** * Constructor. * * @param ObjectConfig $config An optional ObjectConfig object with configuration options. */ public function __construct(ObjectConfig $config) { parent::__construct($config); //Set the supported methods $this->_methods = ObjectConfig::unbox($config->methods); }