예제 #1
0
 /**
  * Dynamically handle calls into the controller instance.
  * @param string $method
  * @param array $parameters
  * @return mixed
  */
 public function __call($method, $parameters)
 {
     try {
         parent::__call($method, $parameters);
     } catch (BadMethodCallException $ex) {
     }
     if (method_exists($this->controller, $method)) {
         return call_user_func_array([$this->controller, $method], $parameters);
     }
     throw new BadMethodCallException(Lang::get('cms::lang.component.method_not_found', ['name' => get_class($this), 'method' => $method]));
 }
예제 #2
0
 /**
  * Handle dynamic method calls into the model.
  *
  * @param  string  $method
  * @param  array  $parameters
  * @return mixed
  */
 public function __call($method, $parameters)
 {
     try {
         return parent::__call($method, $parameters);
     } catch (BadMethodCallException $ex) {
         $query = $this->newQuery();
         return call_user_func_array([$query, $method], $parameters);
     }
 }