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

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

Displays a form to create a new ArticleAuthor entity.
public newAction ( $articleId ) : Response
$articleId
Результат Symfony\Component\HttpFoundation\Response
    public function newAction($articleId)
    {
        $em = $this->getDoctrine()->getManager();
        $journalService = $this->get('ojs.journal_service');
        $journal = $journalService->getSelectedJournal();
        $article = $em->getRepository('OjsJournalBundle:Article')->find($articleId);
        if (!$this->isGranted('EDIT', $journal, 'articles')) {
            throw new AccessDeniedException("You not authorized for this page!");
        }
        $entity = new ArticleAuthor();
        $entity->setArticle($article);
        $form = $this->createCreateForm($entity, $journal, $article)->add('create', 'submit', array('label' => 'c'));
        return $this->render('OjsJournalBundle:ArticleAuthor:new.html.twig', array('entity' => $entity, 'form' => $form->createView(), 'article' => $article));
    }