createDir() public method

Create a new page (and initial page version)
public createDir ( string $cabin, string $path, array $post = [] ) : boolean
$cabin string
$path string
$post array
return boolean
示例#1
0
 /**
  * @param string $cabin
  * @param string $parent
  * @param array $post
  * @return bool
  */
 protected function processNewDir(string $cabin, string $parent, array $post = []) : bool
 {
     if (!\Airship\all_keys_exist(['url', 'save_btn'], $post)) {
         return false;
     }
     if ($this->pg->createDir($cabin, $parent, $post)) {
         \Airship\redirect($this->airship_cabin_prefix . '/pages/' . $cabin, ['dir' => $parent]);
     }
     return true;
 }