diff --git a/app/config/routing.yml b/app/config/routing.yml index 5e493e5..721aaac 100644 --- a/app/config/routing.yml +++ b/app/config/routing.yml @@ -1,5 +1,6 @@ -GergelyPolonkaiFrontBundle: - resource: "@GergelyPolonkaiFrontBundle/Resources/config/routing.yml" +gergely_polonkai_front: + resource: "@GergelyPolonkaiFrontBundle/Controller/" + type: annotation prefix: / # Internal routing configuration to handle ESI diff --git a/composer.json b/composer.json index 8f905d7..257c1c9 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,12 @@ "autoload": { "psr-0": { "": "src/" } }, + "repositories": [ + { + "type": "vcs", + "url": "http://github.com/w00d5t0ck/IoTcpdfBundle" + } + ], "require": { "php": ">=5.3.3", "symfony/symfony": "2.1.*", @@ -17,7 +23,8 @@ "sensio/framework-extra-bundle": "2.1.*", "sensio/generator-bundle": "2.1.*", "jms/security-extra-bundle": "1.2.*", - "jms/di-extra-bundle": "1.1.*" + "jms/di-extra-bundle": "1.1.*", + "gergelypolonkai/tcpdfbundle": "dev-master" }, "scripts": { "post-install-cmd": [ diff --git a/src/GergelyPolonkai/FrontBundle/Controller/DefaultController.php b/src/GergelyPolonkai/FrontBundle/Controller/DefaultController.php index 2c13aed..d12d8c9 100644 --- a/src/GergelyPolonkai/FrontBundle/Controller/DefaultController.php +++ b/src/GergelyPolonkai/FrontBundle/Controller/DefaultController.php @@ -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, + ); + } + } } diff --git a/src/GergelyPolonkai/FrontBundle/DependencyInjection/GergelyPolonkaiFrontExtension.php b/src/GergelyPolonkai/FrontBundle/DependencyInjection/GergelyPolonkaiFrontExtension.php index 9c4f0f4..6923971 100644 --- a/src/GergelyPolonkai/FrontBundle/DependencyInjection/GergelyPolonkaiFrontExtension.php +++ b/src/GergelyPolonkai/FrontBundle/DependencyInjection/GergelyPolonkaiFrontExtension.php @@ -22,7 +22,7 @@ class GergelyPolonkaiFrontExtension extends Extension $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('services.yml'); + $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('services.xml'); } } diff --git a/src/GergelyPolonkai/FrontBundle/Resources/config/routing.yml b/src/GergelyPolonkai/FrontBundle/Resources/config/routing.yml deleted file mode 100644 index 1dfd9c9..0000000 --- a/src/GergelyPolonkai/FrontBundle/Resources/config/routing.yml +++ /dev/null @@ -1,13 +0,0 @@ -GergelyPolonkaiFrontBundle_homepage: - pattern: / - defaults: { _controller: GergelyPolonkaiFrontBundle:Default: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/config/services.xml b/src/GergelyPolonkai/FrontBundle/Resources/config/services.xml new file mode 100644 index 0000000..303a5bc --- /dev/null +++ b/src/GergelyPolonkai/FrontBundle/Resources/config/services.xml @@ -0,0 +1,20 @@ + + + + + + diff --git a/src/GergelyPolonkai/FrontBundle/Resources/config/services.yml b/src/GergelyPolonkai/FrontBundle/Resources/config/services.yml deleted file mode 100644 index 187176c..0000000 --- a/src/GergelyPolonkai/FrontBundle/Resources/config/services.yml +++ /dev/null @@ -1,7 +0,0 @@ -parameters: -# gergely_polonkai_front.example.class: GergelyPolonkai\FrontBundle\Example - -services: -# gergely_polonkai_front.example: -# class: %gergely_polonkai_front.example.class% -# arguments: [@service_id, "plain_value", %parameter%] diff --git a/vendor/doctrine b/vendor/doctrine deleted file mode 160000 index 03d2b0f..0000000 --- a/vendor/doctrine +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 03d2b0f30c35d313339478d24337dd1a28a2f2f2 diff --git a/vendor/monolog b/vendor/monolog deleted file mode 160000 index b704c49..0000000 --- a/vendor/monolog +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b704c49a3051536f67f2d39f13568f74615b9922 diff --git a/vendor/swiftmailer b/vendor/swiftmailer deleted file mode 160000 index d02e07b..0000000 --- a/vendor/swiftmailer +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d02e07b2cc4e35234119033c6d0cc8805a893b11 diff --git a/vendor/symfony b/vendor/symfony deleted file mode 160000 index c2480c1..0000000 --- a/vendor/symfony +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c2480c1e73879593ef6b88571fc733ada5a26bba diff --git a/vendor/twig b/vendor/twig deleted file mode 160000 index 2afc513..0000000 --- a/vendor/twig +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2afc513620e7f8dadda92a0f4ed04cb157e048df