Created
November 21, 2011 13:13
-
-
Save arthuralmeidap/1382590 to your computer and use it in GitHub Desktop.
IndexController
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace Condominio\SystemBundle\Controller; | |
| use Symfony\Component\HttpFoundation\Response; | |
| use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
| use Condominio\SystemBundle\Domain\Entity\User; | |
| class IndexController extends Controller | |
| { | |
| public function indexAction( $name ) { | |
| return new Response( '<html><body>Hellowww '.$name.'!</body></html>' ); | |
| } | |
| public function saveUserAction( $firstName, $lastName ) { | |
| $user = new User( $firstName, $lastName ); | |
| $em = $this->getDoctrine()->getEntityManager(); | |
| $em->persist( $user ); | |
| $em->flush(); | |
| return new Response( '<html><body> Gongratz!!! User: '. $user->getFullName() .'</body></html>' ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment