Ojs\JournalBundle\Controller\JournalPostController::newAction PHP Метод

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

Displays a form to create a new JournalPost entity.
public newAction ( Request $request ) : Response
$request Symfony\Component\HttpFoundation\Request
Результат Symfony\Component\HttpFoundation\Response
    public function newAction(Request $request)
    {
        $journal = $this->get('ojs.journal_service')->getSelectedJournal();
        if (!$this->isGranted('CREATE', $journal, 'posts')) {
            throw new AccessDeniedException("You are not authorized for this post!");
        }
        $entity = new JournalPost();
        $entity->setCurrentLocale($request->getDefaultLocale());
        $form = $this->createCreateForm($entity);
        return $this->render('OjsJournalBundle:JournalPost:new.html.twig', ['entity' => $entity, 'form' => $form->createView()]);
    }