Builds a create route object.

@param Request  $req
@param Response $res

@return CreateModelRoute
334583
protected function getCreateRoute(Request $req, Response $res)
    {
        $route = new CreateModelRoute($req, $res);
        $route->setApp($this->app)
              ->setSerializer($this->getSerializer($req));

        return $route;
    }
856662
public function create(PageRequest $request)
    {

        $page = $this->repository->newInstance([]);
        return $this->response->setMetaTitle(trans('app.new') . ' ' . trans('page::page.name')) 
            ->view('page::page.create', true) 
            ->data(compact('page'))
            ->output();
    }
76857
protected function buildRouteMaps($refresh = false)
    {
        if ($this->routeMaps && !$this->debug && !$refresh) {
            return $this;
        }

        foreach ($this->routes as $key => $routeItem) {
            $this->routeMaps[$routeItem->getName()] = $key;
        }

        return $this;
    }
1202052
public function createAction(Request $request)
    {
        $mailingList = new MailingList();

        $form = $this->createForm(MailingListType::class, $mailingList, [
            'action' => $this->generateUrl('opifer_mailing_list_mailing_list_create'),
        ]);

        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($mailingList);
            $em->flush();

            return $this->redirectToRoute('opifer_mailing_list_mailing_list_index');
        }

        return $this->render('OpiferMailingListBundle:MailingList:create.html.twig', [
            'form' => $form->createView(),
        ]);
    }
68765
public function createPreflightCorsResponseWithRouteOptions(HttpRequest $request, $routeMatch = null)
    {
        $options = $this->options;
        if ($routeMatch instanceof RouteMatch || $routeMatch instanceof DeprecatedRouteMatch) {
            $options->setFromArray($routeMatch->getParam(CorsOptions::ROUTE_PARAM) ?: []);
        }
        $response = $this->createPreflightCorsResponse($request);

        return $response;
    }
159702
public function postCreate(PostRequest $request)
    {
        $command = new CreatePostCommand($request->all());

        try 
        {
            $this->bus->execute($command);
        }
        catch(ValidationException $e)
        {
            return Redirect::to(\OogleeBConfig::get('config.post_routes.base_uri_admin').'/post/create')->withErrors($e->getErrors());

        }
        catch(\DomainException $e)
        {
            return Redirect::to(\OogleeBConfig::get('config.post_routes.base_uri_admin').'/post/create')->withErrors($e->getErrors());
        }

        return Redirect::to(\OogleeBConfig::get('config.post_routes.base_uri_admin').'/posts')->with(['message' => 'success!']);
    }
1111885
function create(req, res, next) {
  var body = req.body;
  body.user_id = req.session.user.id;

  db.posts.create(req.body, function(err, post) {
    if(err) { return next(err); }

    res.json(201, post);
    signals.emit('post:create', post);
  });
}
1115865
public function newAction(Request $request)
    {
        $redirection = new Redirection();

        $form = $this->getRedirectionForm($redirection, '#new-redirection-form-container');
        $form->handleRequest($request);

        if ($request->query->get('novalidate', false) === false) {
            if ($form->isValid()) {
                if ($redirection->getLink()->getLinkType() !== Link::TYPE_NONE) {
                    $em = $this->getDoctrine()->getManager();
                    $em->persist($redirection);
                    $em->flush();

                    $this->congrat($this->get('translator')->trans('victoire.redirection.create.success'));

                    return new Response($this->renderView('@VictoireSeo/Redirection/_newForm.html.twig', [
                        'isOpened'  => true,
                        'form'      => $this->getRedirectionForm(new Redirection(), '#new-redirection-form-container')->createView(),
                        'icTrigger' => [
                            'target' => '#redirections-list-container',
                            'url'    => $this->generateUrl('victoire_redirection_showListItem', [
                                'id' => $redirection->getId(),
                            ]),
                        ],
                    ]), 200, [
                        'X-Inject-Alertify' => true,
                    ]);
                } else {
                    // force form error when no link submitted
                    $form->addError(new FormError('This value should not be blank.'));
                }
            } else {
                $this->warn($this->get('translator')->trans('victoire.404.form.error.unvalid'));
            }

            return new Response($this->renderView('@VictoireSeo/Redirection/_newForm.html.twig', [
                'form'     => $form->createView(),
                'isOpened' => true,
            ]), 200, [
                'X-Inject-Alertify' => true,
            ]);
        }

        // rebuild form to avoid wrong form error
        $form = $this->getRedirectionForm($redirection, '#new-redirection-form-container');

        return new JsonResponse([
            'html' => $this->renderView('@VictoireSeo/Redirection/_newForm.html.twig', [
                'form'      => $form->createView(),
                'isOpened'  => true,
            ]),
        ]);
    }
866743
public function createAction(Request $request)
    {
        $form = $this->getForm();

        if ('POST' == $request->getMethod()) {
            $form->handleRequest($request);
            if ($form->isValid()) {

                $this->getManager()->create($form->getData());
                $this->get('session')->getFlashBag()->add('success', 'Repository created successfully');

                return new RedirectResponse($this->generateUrl('snide_travinizer_dashboard'));
            } else {
                $this->get('session')->getFlashBag()->add('error', 'Some errors have been found');

            }
        }
        return array(
            'form' => $form->createView(),
            'errors' => $form->getErrors()
        );
    }
676323
public function createResetByEmailAction($req)
    {
        $ret = wei()->userPassword->createResetByEmail($req);

        return $this->ret($ret);
    }
416239
public static function create(RouteCollection $routes, ?string $prefix = null): self
    {
        $uriFactory = new UriFactory();

        return new self($routes, $uriFactory, $prefix);
    }
155702
private function createRedirectResponse(Request $request)
    {
        $url = $this->loginUrl.'?'.http_build_query([
            'redirect_to' => $request->getUri(),
            'reauth'      => 0,
        ]);

        return RedirectResponse::create($url, 302);
    }
1039979
function (req, res) {
        var {name} = new {modelName}({{createFields}
        });

        {name}.save(function (err, {name}) {
            if (err) {
                return res.status(500).json({
                    message: 'Error when creating {name}',
                    error: err
                });
            }
            return res.status(201).json({name});
        });
    }
484761
protected final <REQ, RESP> Route get(RouteAction<Request<REQ>, Response<RESP>> action,
		RequestType<REQ> req, ResponseType<RESP> resp) {
		return createEntityRoute(HttpMethod.GET, "", action, req, resp);
	}
478959
public function createResponse(View $view, Request $request, $format)
    {
        $route = $view->getRoute();

        $location = $route
            ? $this->urlGenerator->generate($route, (array) $view->getRouteParameters(), UrlGeneratorInterface::ABSOLUTE_URL)
            : $view->getLocation();

        if ($location) {
            return $this->createRedirectResponse($view, $location, $format);
        }

        $response = $this->initResponse($view, $format);

        if (!$response->headers->has('Content-Type')) {
            $mimeType = $request->attributes->get('media_type');
            if (null === $mimeType) {
                $mimeType = $request->getMimeType($format);
            }

            $response->headers->set('Content-Type', $mimeType);
        }

        return $response;
    }
11455
public function createAction(Request $request)
    {
        $manager = $this->get('opifer.redirect.redirect_manager');

        $redirect = $manager->createNew();

        $form = $this->createForm(RedirectType::class, $redirect);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {

            $manager->save($redirect);
            $this->addFlash('success', $this->get('translator')->trans('opifer_redirect.flash.created'));

            if ($form->get('saveAndAdd')->isClicked()){
                return $this->redirectToRoute('opifer_redirect_redirect_create');
            }

            return $this->redirectToRoute('opifer_redirect_redirect_edit', ['id' => $redirect->getId()]);
        }

        return $this->render($this->container->getParameter('opifer_redirect.redirect_create_view'), [
            'form' => $form->createView(),
        ]);
    }
250157
protected function createRoute(RouteInterface $route, Request $request)
    {
        $routePath = $this->decodePathInfo($request->getPathInfo());

        if ($route->isHistory()) {
            return new Route(
                $routePath,
                [
                    '_controller' => 'SuluWebsiteBundle:Redirect:redirect',
                    'url' => $request->getSchemeAndHttpHost()
                        . $this->requestAnalyzer->getResourceLocatorPrefix()
                        . $route->getTarget()->getPath()
                        . ($request->getQueryString() ? ('?' . $request->getQueryString()) : ''),
                ]
            );
        }

        $symfonyRoute = $this->proxyFactory->createProxy(
            Route::class,
            function(&$wrappedObject, LazyLoadingInterface $proxy, $method, array $parameters, &$initializer) use (
                $routePath,
                $route,
                $request
            ) {
                $initializer = null; // disable initialization
                $wrappedObject = new Route(
                    $routePath,
                    $this->routeDefaultsProvider->getByEntity(
                        $route->getEntityClass(),
                        $route->getEntityId(),
                        $request->getLocale()
                    )
                );

                return true;
            }
        );

        return $this->symfonyRouteCache[$route->getId()] = $symfonyRoute;
    }