src/Contao/View/Contao2BackendView/ActionHandler/CopyHandler.php
protected function redirect($environment, $copiedModelId)
    {
        // Build a clean url to remove the copy related arguments instead of using the AddToUrlEvent.
        $urlBuilder = new UrlBuilder();
        $urlBuilder
            ->setPath('contao')
            ->setQueryParameter('do', $environment->getInputProvider()->getParameter('do'))
            ->setQueryParameter('table', $copiedModelId->getDataProviderName())
            ->setQueryParameter('act', 'edit')
            ->setQueryParameter('id', $copiedModelId->getSerialized())
            ->setQueryParameter('pid', $environment->getInputProvider()->getParameter('pid'));

        $securityUrlBuilder = System::getContainer()->get('cca.dc-general.security-url-builder-factory');

        $redirectEvent = new RedirectEvent($securityUrlBuilder->create($urlBuilder->getUrl())->getUrl());
        $environment->getEventDispatcher()->dispatch(ContaoEvents::CONTROLLER_REDIRECT, $redirectEvent);
    }
protected function redirect($environment, $copiedModelId)
    {
        // Build a clean url to remove the copy related arguments instead of using the AddToUrlEvent.
        $urlBuilder = new UrlBuilder();
        $urlBuilder
            ->setPath('contao')
            ->setQueryParameter('do', $environment->getInputProvider()->getParameter('do'))
            ->setQueryParameter('table', $copiedModelId->getDataProviderName())
            ->setQueryParameter('act', 'edit')
            ->setQueryParameter('id', $copiedModelId->getSerialized())
            ->setQueryParameter('pid', $environment->getInputProvider()->getParameter('pid'));

        $securityUrlBuilder = System::getContainer()->get('cca.dc-general.security-url-builder-factory');

        $redirectEvent = new RedirectEvent($securityUrlBuilder->create($urlBuilder->getUrl())->getUrl());
        $environment->getEventDispatcher()->dispatch(ContaoEvents::CONTROLLER_REDIRECT, $redirectEvent);
    }
protected function redirect ( $ environment , $ copiedModelId ) { // Build a clean url to remove the copy related arguments instead of using the AddToUrlEvent. $ urlBuilder = new UrlBuilder ( ) ; $ urlBuilder -> setPath ( 'contao' ) -> setQueryParameter ( 'do' , $ environment -> getInputProvider ( ) -> getParameter ( 'do' ) ) -> setQueryParameter ( 'table' , $ copiedModelId -> getDataProviderName ( ) ) -> setQueryParameter ( 'act' , 'edit' ) -> setQueryParameter ( 'id' , $ copiedModelId -> getSerialized ( ) ) -> setQueryParameter ( 'pid' , $ environment -> getInputProvider ( ) -> getParameter ( 'pid' ) ) ; $ securityUrlBuilder = System :: getContainer ( ) -> get ( 'cca.dc-general.security-url-builder-factory' ) ; $ redirectEvent = new RedirectEvent ( $ securityUrlBuilder -> create ( $ urlBuilder -> getUrl ( ) ) -> getUrl ( ) ) ; $ environment -> getEventDispatcher ( ) -> dispatch ( ContaoEvents :: CONTROLLER_REDIRECT , $ redirectEvent ) ; }
Redirect to edit mask.

@param EnvironmentInterface $environment   The environment.
@param ModelIdInterface     $copiedModelId The model id.

@return void
Redirect to edit mask .