/** * Gets the user input, if any, or returns false if there is none. * @return array|bool the user input, or false if none is present */ protected function getUserInput() { $input = parent::getUserInput(); $model = $this->staticModel(); $modelClass = get_class($model); if (isset($input[$modelClass]) && count($input[$modelClass])) { $input = $input[$modelClass]; } return $input; }
/** * Gets the user input, if any, or returns false if there is none. * @return array|bool the user input, or false if none is present */ protected function getUserInput() { $input = \Restyii\Action\Base::getUserInput(); $model = $this->staticRelatedModel(); $modelClass = get_class($model); if (isset($input[$modelClass]) && count($input[$modelClass])) { $input = $input[$modelClass]; } return $input; }
/** * Prepare the given action * @param \Restyii\Action\Base $action * * @return array */ protected function prepareAction(\Restyii\Action\Base $action) { return array('label' => $action->label(), 'description' => $action->description(), 'verb' => is_array($action->verb) ? $action->verb[0] : $action->verb, 'params' => $action->params(), 'headers' => $action->requestHeaders(), 'link' => array('href' => $action->createUrlTemplate(), 'templated' => true, 'title' => $action->label())); }