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

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

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