Set the title of the page.

@param Request $request
@param Page    $page

@return array
779768
public function postTitle(Request $request, Page $page)
    {
        $this->authorize('edit', $page);

        $oldTitle = $page->getTitle();
        $page->setTitle($request->input('title'));

        Event::fire(new Events\PageTitleWasChanged($page, $oldTitle, $page->getTitle()));

        return [
            'status'   => $page->getCurrentVersion()->getStatus(),
            'location' => (string) URLFacade::page($page),
        ];
    }
968020
public function postAdmin(Request $request, Page $page)
    {
        $this->authorize('editAdmin', $page);

        $page
            ->setInternalName($request->input('internal_name'))
            ->setAddPageBehaviour($request->input('add_behaviour'))
            ->setChildAddPageBehaviour($request->input('child_add_behaviour'))
            ->setDisableDelete($request->has('disable_delete'));

        PageFacade::save($page);
    }
1136992
private function getRequestedPage(Request $request)
    {
        $pageNumber = $request->query->getInt('page', 1);
        if (!$pageNumber || $pageNumber < 1) {
            $pageNumber = 1;
        }

        return $pageNumber;
    }
216204
public function setPage($page)
    {
        $this->page = min($page > 0 ? $page : $this->getFirstPage(), $this->getLastPage());
    }
1287830
public function update(Request $request, FormBuilder $formBuilder, $page)
    {
        // Set roles that have access
        $request->user()->authorizeRoles(['admin', 'editor']);

        // Get page
        $page = Page::withTrashed()->findOrFail($page);

        // Get pagetype, or fail..
        $pagetype = PageType::where('model', $page->pagetype_model)->first();

        // Get fields
        $fields = $pagetype->fields ?: [];

        // Build the form
        $form = $formBuilder->createByArray($fields, [
            'method' => 'POST',
            'url' => route('admin.pages.page.store'),
            'name' => 'content'
        ]);

        // It will automatically use current request, get the rules, and do the validation
        if (!$form->isValid()) {
            return redirect()->back()->withErrors($form->getErrors())->withInput();
        }

        // Page data
        $page->title = $request->input('title');
        $page->content = $request->input('content');
        $page->status = $request->input('status') ? 2 : 1;

        $page->update();

        flash('The page was successfully updated')->success();

        return redirect()->route('admin.pages.index');
    }
689490
public function listAction(Request $request)
    {
        $current_page = $request->get('page', 1);
        $current_page = $current_page > 1 ? $current_page : 1;
        $rep = $this->getRepository();

        // filter list notice
        $filter = $this->createForm('notices_filter')->handleRequest($request);
        if ($filter->isValid()) {
            $query = $rep->getFilteredQuery($filter->getData()['status'], $filter->getData()['type']);
        } else {
            $query = $rep->createQueryBuilder('n');
        }
        $query
            ->orderBy('n.date_created', 'DESC')
            ->setFirstResult(($current_page - 1) * self::NOTICE_PER_PAGE)
            ->setMaxResults(self::NOTICE_PER_PAGE);
        $list = $query->getQuery()->getResult();

        // get count all items
        $count = $query
            ->select('COUNT(n)')
            ->getQuery()
            ->getSingleScalarResult();

        // pagination
        $that = $this;
        $request_query = $request->query->all();
        unset($request_query['page']);
        $pagination = $this->get('anime_db.pagination')
            ->create(ceil($count / self::NOTICE_PER_PAGE), $current_page)
            ->setPageLink(function ($page) use ($that, $request_query) {
                return $that->generateUrl('notice_list', array_merge($request_query, ['page' => $page]));
            })
            ->setFirstPageLink($this->generateUrl('notice_list', $request_query))
            ->getView();

        return $this->render('AnimeDbCatalogBundle:Notice:list.html.twig', [
            'list' => $list,
            'pagination' => $pagination,
            'change_form' => $this->createForm(new ChangeNotice())->createView(),
            'filter' => $filter->createView(),
            'action_remove' => ChangeNotice::ACTION_REMOVE,
        ]);
    }
1201340
public function update(PageRequest $request, Page $page)
    {
        $page->update($request->all());
        return new PageResource($page);
    }
861807
public function postAction(Request $request)
    {
        $name = $request->get('title');

        try {
            if (null == $name) {
                throw new RestException(
                    'There is no title-name for the given title'
                );
            }

            $em = $this->getDoctrine()->getManager();
            $title = new ContactTitle();
            $title->setTitle($name);

            $em->persist($title);
            $em->flush();

            $view = $this->view($title, 200);
        } catch (EntityNotFoundException $enfe) {
            $view = $this->view($enfe->toArray(), 404);
        } catch (RestException $re) {
            $view = $this->view($re->toArray(), 400);
        }

        return $this->handleView($view);
    }
998987
public function restore(Request $request, $page)
    {
        // Set roles that have access
        $request->user()->authorizeRoles(['admin', 'editor']);

        $page = Page::withTrashed()->findOrFail($page);
        $page->restore();

        flash('Page has been successfully restored')->success();

        return back();
    }
676424
public function setPage(\Fulgurio\LightCMSBundle\Entity\Page $page = null)
    {
        $this->page = $page;

        return $this;
    }
307372
public function changePriorityAction(Request $request, BasePage $page)
    {
        $em = $this->get('doctrine.orm.entity_manager');

        $pageSeo = $page->getSeo() ?: new PageSeo();
        $pageSeo->setCurrentLocale($request->getLocale());

        $form = $this->createSitemapPriorityType($page, $pageSeo);
        $form->handleRequest($request);
        $params = [
            'success' => $form->isValid(),
        ];

        if ($form->isValid()) {
            $page->setSeo($pageSeo);
            $em->persist($pageSeo);
            $em->flush();
        }

        return new JsonResponse($params);
    }
1135602
public function setRcmPageTitle()
    {
        if ($this->rcmPageIsSet) {
            return;
        }

        $view = $this->getView();

        if (empty($view->page)) {
            return;
        }

        $pageTitle = $view->page->getPageTitle();

        if (!empty($pageTitle)) {
            $this->append(strip_tags($pageTitle));
        }

        $this->rcmPageIsSet = true;
    }
1089263
public function listAction(Request $request): Response
    {
        $page = $request->query->get('page', 1);

        $pagerfanta = new Pagerfanta(
            new BookmarkAdapter($this->bookmarkService, $this->datasetFactory)
        );

        $pagerfanta->setMaxPerPage($this->defaultPaginationLimit);
        $pagerfanta->setCurrentPage(min($page, $pagerfanta->getNbPages()));

        $editForm = $this->formFactory->contentEdit(
            new ContentEditData()
        );

        $removeBookmarkForm = $this->formFactory->removeBookmark(
            new BookmarkRemoveData($this->getChoices($pagerfanta->getCurrentPageResults()))
        );

        return $this->render(
            '@ezdesign/admin/bookmark/list.html.twig',
            $viewParameters = [
                'pager' => $pagerfanta,
                'form_edit' => $editForm->createView(),
                'form_remove' => $removeBookmarkForm->createView(),
            ]
        );
    }
727859
public function setPage(\VFou\CmsBundle\Entity\Page $page = null)
    {
        $this->page = $page;

        return $this;
    }
1144053
public function setPage(\Amulen\PageBundle\Entity\Page $page = null) {
        $this->page = $page;

        return $this;
    }
1293878
public function store(Page $page, PageSectionFormRequest $request)
    {
        $section = $this->repository->create($request->all());
        Pages::forgetCache();

        return $this->redirect($request, $section);
    }
312732
public function store(PageRequest $request)
    {
        $page = Page::create($request->all());

        return (new PageResource($page));
    }