src/Slashworks/AppBundle/Controller/RemoteAppController.php
public function createAction(Request $request)
        {

            $oRemoteApp = new RemoteApp();
            $form       = $this->createCreateForm($oRemoteApp);
            $form->handleRequest($request);

            if ($form->isValid()) {

                $sDomain = $oRemoteApp->getDomain();
                if(substr($sDomain,-1,1) !== "/"){
                    $sDomain .= "/";
                    $oRemoteApp->setDomain($sDomain);
                }

                $sModulePath = $oRemoteApp->getApiUrl();
                if(substr($sModulePath,0,1) === "/"){
                    $sModulePath = substr($sModulePath,1);
                    $oRemoteApp->setApiUrl($sModulePath);
                }

                $oRemoteApp->save();

                return $this->redirect($this->generateUrl('remote_app'));
            }

            return $this->render('SlashworksAppBundle:RemoteApp:new.html.twig', array(
                'entity' => $oRemoteApp,
                'form'   => $form->createView(),
            ));
        }
public function createAction(Request $request)
        {

            $oRemoteApp = new RemoteApp();
            $form       = $this->createCreateForm($oRemoteApp);
            $form->handleRequest($request);

            if ($form->isValid()) {

                $sDomain = $oRemoteApp->getDomain();
                if(substr($sDomain,-1,1) !== "/"){
                    $sDomain .= "/";
                    $oRemoteApp->setDomain($sDomain);
                }

                $sModulePath = $oRemoteApp->getApiUrl();
                if(substr($sModulePath,0,1) === "/"){
                    $sModulePath = substr($sModulePath,1);
                    $oRemoteApp->setApiUrl($sModulePath);
                }

                $oRemoteApp->save();

                return $this->redirect($this->generateUrl('remote_app'));
            }

            return $this->render('SlashworksAppBundle:RemoteApp:new.html.twig', array(
                'entity' => $oRemoteApp,
                'form'   => $form->createView(),
            ));
        }
public function createAction ( Request $ request ) { $ oRemoteApp = new RemoteApp ( ) ; $ form = $ this -> createCreateForm ( $ oRemoteApp ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isValid ( ) ) { $ sDomain = $ oRemoteApp -> getDomain ( ) ; if ( substr ( $ sDomain , - 1 , 1 ) !== "/" ) { $ sDomain .= "/" ; $ oRemoteApp -> setDomain ( $ sDomain ) ; } $ sModulePath = $ oRemoteApp -> getApiUrl ( ) ; if ( substr ( $ sModulePath , 0 , 1 ) === "/" ) { $ sModulePath = substr ( $ sModulePath , 1 ) ; $ oRemoteApp -> setApiUrl ( $ sModulePath ) ; } $ oRemoteApp -> save ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'remote_app' ) ) ; } return $ this -> render ( 'SlashworksAppBundle:RemoteApp:new.html.twig' , array ( 'entity' => $ oRemoteApp , 'form' => $ form -> createView ( ) , ) ) ; }
Create new remote app

@param \Symfony\Component\HttpFoundation\Request $request

@return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
@throws \Exception
@throws \PropelException
Create new remote app