diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3268211 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.*.sw? diff --git a/app/AppKernel.php b/app/AppKernel.php index 8fddcb8..9e16e2d 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -17,6 +17,7 @@ class AppKernel extends Kernel new Symfony\Bundle\AsseticBundle\AsseticBundle(), new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(), + new Io\TcpdfBundle\IoTcpdfBundle(), new GergelyPolonkai\FrontBundle\GergelyPolonkaiFrontBundle(), ); diff --git a/app/autoload.php b/app/autoload.php index 64ba187..3abbfcc 100644 --- a/app/autoload.php +++ b/app/autoload.php @@ -3,6 +3,8 @@ use Symfony\Component\ClassLoader\UniversalClassLoader; use Doctrine\Common\Annotations\AnnotationRegistry; +require_once __DIR__.'/../vendor/tcpdf/tcpdf.php'; + $loader = new UniversalClassLoader(); $loader->registerNamespaces(array( 'Symfony' => array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'), @@ -14,6 +16,7 @@ $loader->registerNamespaces(array( 'Monolog' => __DIR__.'/../vendor/monolog/src', 'Assetic' => __DIR__.'/../vendor/assetic/src', 'Metadata' => __DIR__.'/../vendor/metadata/src', + 'Io' => __DIR__.'/../vendor/bundles', )); $loader->registerPrefixes(array( 'Twig_Extensions_' => __DIR__.'/../vendor/twig-extensions/lib', diff --git a/src/GergelyPolonkai/FrontBundle/Controller/DefaultController.php b/src/GergelyPolonkai/FrontBundle/Controller/DefaultController.php index 473f395..2c13aed 100644 --- a/src/GergelyPolonkai/FrontBundle/Controller/DefaultController.php +++ b/src/GergelyPolonkai/FrontBundle/Controller/DefaultController.php @@ -11,4 +11,25 @@ class DefaultController extends Controller { return $this->render('GergelyPolonkaiFrontBundle:Default:index.html.twig', array()); } + + public function disclaimerAction() + { + return $this->render('GergelyPolonkaiFrontBundle:Default:disclaimer.html.twig', 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, + )); + } + } } diff --git a/src/GergelyPolonkai/FrontBundle/Resources/config/routing.yml b/src/GergelyPolonkai/FrontBundle/Resources/config/routing.yml index f05a6c6..1dfd9c9 100644 --- a/src/GergelyPolonkai/FrontBundle/Resources/config/routing.yml +++ b/src/GergelyPolonkai/FrontBundle/Resources/config/routing.yml @@ -5,3 +5,9 @@ GergelyPolonkaiFrontBundle_homepage: GergelyPolonkaiFrontBundle_disclaimer: pattern: /disclaimer.html defaults: { _controller: GergelyPolonkaiFrontBundle:Default:disclaimer } + +GergelyPolonkaiFrontBundle_resume: + pattern: /resume.{_format} + defaults: { _controller: GergelyPolonkaiFrontBundle:Default:resume } + requirements: + _format: html|pdf diff --git a/src/GergelyPolonkai/FrontBundle/Resources/views/Default/disclaimer.html.twig b/src/GergelyPolonkai/FrontBundle/Resources/views/Default/disclaimer.html.twig new file mode 100644 index 0000000..9f4db2e --- /dev/null +++ b/src/GergelyPolonkai/FrontBundle/Resources/views/Default/disclaimer.html.twig @@ -0,0 +1,6 @@ +{% extends 'GergelyPolonkaiFrontBundle:Default:front_base.html.twig' %} +{% block title %} - Disclaimer{% endblock %} +{% block content %} +
The articles and thoughts on this site is originated from me, unless otherwise stated. Please use them with this statement in your mind. If you use anything, please put a backlink on your site to the given article(s) or the main page.
+{% endblock content %} diff --git a/src/GergelyPolonkai/FrontBundle/Resources/views/Default/front_base.html.twig b/src/GergelyPolonkai/FrontBundle/Resources/views/Default/front_base.html.twig index 51a41b5..d6b2bab 100644 --- a/src/GergelyPolonkai/FrontBundle/Resources/views/Default/front_base.html.twig +++ b/src/GergelyPolonkai/FrontBundle/Resources/views/Default/front_base.html.twig @@ -4,6 +4,7 @@