Example #1
0
 /**
  * Parses current routes and loads the module that matched for that route
  */
 public function resolve()
 {
     $query = $this->request->query;
     if (in_array($query->get('page'), array_keys($this->routes))) {
         $name = $this->routes[$query->get('page')];
     } else {
         /** @var Rsc_Mvc_Module $module */
         $name = $query->get('module', $this->environment->getConfig()->get('default_module'));
     }
     if (!$this->modules->has($name)) {
         wp_die('The module that you requested is not found');
     }
     /** @var Rsc_Http_Response $response */
     $response = $module = $this->modules->get(strtolower($name))->setRequest($this->request)->handle();
     if (!is_object($response) || !$response instanceof Rsc_Http_Response) {
         wp_die('The controller must return the response');
     }
     echo $response->getContent();
 }
 /**
  * Returns the asset by handle
  * @param array|string $key
  * @param null $default
  * @return SupsysticSlider_Ui_Asset
  */
 public function get($key, $default = null)
 {
     return parent::get($key, $default);
 }
 /**
  * {@inheritdoc}
  */
 public function get($key, $default = null)
 {
     $this->callListener('onGet', $key);
     return parent::get($key, $default);
 }