Changed old code to benefit from old framework
Signed-off-by: Gergely POLONKAI (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
@@ -3,33 +3,55 @@
|
||||
namespace GergelyPolonkai\FrontBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
|
||||
|
||||
|
||||
/**
|
||||
* @Route("/")
|
||||
*/
|
||||
class DefaultController extends Controller
|
||||
{
|
||||
public function homepageAction()
|
||||
{
|
||||
return $this->render('GergelyPolonkaiFrontBundle:Default:index.html.twig', array());
|
||||
}
|
||||
/**
|
||||
* @Route("/", name="GergelyPolonkaiFrontBundle_homepage")
|
||||
* @Template
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
public function disclaimerAction()
|
||||
{
|
||||
return $this->render('GergelyPolonkaiFrontBundle:Default:disclaimer.html.twig', array());
|
||||
}
|
||||
/**
|
||||
* @Route("/disclaimer.html", name="GergelyPolonkaiFrontBundle_disclaimer")
|
||||
* @Template
|
||||
*/
|
||||
public function disclaimerAction()
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
public function resumeAction($_format)
|
||||
{
|
||||
if ($_format == 'pdf')
|
||||
{
|
||||
return $this->get('io_tcpdf')->quick_pdf($this->renderView('GergelyPolonkaiFrontBundle:Default:resume.html.twig', array(
|
||||
'format' => $_format,
|
||||
)));
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->render('GergelyPolonkaiFrontBundle:Default:resume.html.twig', array(
|
||||
'format' => $_format,
|
||||
));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param string $_format
|
||||
*
|
||||
* @Route("/resume.{_format}", name="GergelyPolonkaiFrontBundle_resume")
|
||||
* @Template
|
||||
*/
|
||||
public function resumeAction($_format)
|
||||
{
|
||||
if ($_format === 'pdf') {
|
||||
return $this
|
||||
->get('io_tcpdf')
|
||||
->quick_pdf(
|
||||
$this->renderView(
|
||||
'GergelyPolonkaiFrontBundle:Default:resume.html.twig',
|
||||
array(
|
||||
'format' => $_format
|
||||
)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
return array(
|
||||
'format' => $_format,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user