BookStack\Http\Controllers\PageController::create PHP Метод

create() публичный Метод

Show the form for creating a new page.
public create ( string $bookSlug, string $chapterSlug = null ) : Response
$bookSlug string
$chapterSlug string
Результат Response
    public function create($bookSlug, $chapterSlug = null)
    {
        $book = $this->bookRepo->getBySlug($bookSlug);
        $chapter = $chapterSlug ? $this->chapterRepo->getBySlug($chapterSlug, $book->id) : null;
        $parent = $chapter ? $chapter : $book;
        $this->checkOwnablePermission('page-create', $parent);
        // Redirect to draft edit screen if signed in
        if ($this->signedIn) {
            $draft = $this->pageRepo->getDraftPage($book, $chapter);
            return redirect($draft->getUrl());
        }
        // Otherwise show edit view
        $this->setPageTitle('Create New Page');
        return view('pages/guest-create', ['parent' => $parent]);
    }