Skip to content

Instantly share code, notes, and snippets.

@arthuralmeidap
Created November 21, 2011 13:13
Show Gist options
  • Select an option

  • Save arthuralmeidap/1382590 to your computer and use it in GitHub Desktop.

Select an option

Save arthuralmeidap/1382590 to your computer and use it in GitHub Desktop.
IndexController
<?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