createNewPage() public method

Validates and creates a page with the given input
public createNewPage ( $input ) : boolean
return boolean
Exemplo n.º 1
0
 /**
  * Request a new page be created
  *
  * @param  array $input
  * @return Redirector
  */
 public function requestCreateNewPage($input)
 {
     if (isset($input['response_class']) && isset($input['response_method'])) {
         $input['response_path'] = $input['response_class'] . '.' . $input['response_method'];
     }
     $page = $this->ApiPagesManager->createNewPage($input);
     if ($page) {
         return $this->Redirect->route('dvs-api');
     }
     return $this->Redirect->route('dvs-api-create')->withInput()->withErrors($this->ApiPagesManager->errors)->with('message', $this->ApiPagesManager->message);
 }