Changed old code to benefit from old framework

Signed-off-by: Gergely POLONKAI (W00d5t0ck) <polesz@w00d5t0ck.info>
This commit is contained in:
Gergely POLONKAI (W00d5t0ck) 2012-09-03 21:42:49 +02:00
parent 5a51a05629
commit 24536b07df
12 changed files with 79 additions and 54 deletions

View File

@ -1,5 +1,6 @@
GergelyPolonkaiFrontBundle: gergely_polonkai_front:
resource: "@GergelyPolonkaiFrontBundle/Resources/config/routing.yml" resource: "@GergelyPolonkaiFrontBundle/Controller/"
type: annotation
prefix: / prefix: /
# Internal routing configuration to handle ESI # Internal routing configuration to handle ESI

View File

@ -4,6 +4,12 @@
"autoload": { "autoload": {
"psr-0": { "": "src/" } "psr-0": { "": "src/" }
}, },
"repositories": [
{
"type": "vcs",
"url": "http://github.com/w00d5t0ck/IoTcpdfBundle"
}
],
"require": { "require": {
"php": ">=5.3.3", "php": ">=5.3.3",
"symfony/symfony": "2.1.*", "symfony/symfony": "2.1.*",
@ -17,7 +23,8 @@
"sensio/framework-extra-bundle": "2.1.*", "sensio/framework-extra-bundle": "2.1.*",
"sensio/generator-bundle": "2.1.*", "sensio/generator-bundle": "2.1.*",
"jms/security-extra-bundle": "1.2.*", "jms/security-extra-bundle": "1.2.*",
"jms/di-extra-bundle": "1.1.*" "jms/di-extra-bundle": "1.1.*",
"gergelypolonkai/tcpdfbundle": "dev-master"
}, },
"scripts": { "scripts": {
"post-install-cmd": [ "post-install-cmd": [

View File

@ -3,33 +3,55 @@
namespace GergelyPolonkai\FrontBundle\Controller; namespace GergelyPolonkai\FrontBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
/**
* @Route("/")
*/
class DefaultController extends Controller class DefaultController extends Controller
{ {
public function homepageAction() /**
{ * @Route("/", name="GergelyPolonkaiFrontBundle_homepage")
return $this->render('GergelyPolonkaiFrontBundle:Default:index.html.twig', array()); * @Template
} */
public function indexAction()
{
return array();
}
public function disclaimerAction() /**
{ * @Route("/disclaimer.html", name="GergelyPolonkaiFrontBundle_disclaimer")
return $this->render('GergelyPolonkaiFrontBundle:Default:disclaimer.html.twig', array()); * @Template
} */
public function disclaimerAction()
{
return array();
}
public function resumeAction($_format) /**
{ * @param string $_format
if ($_format == 'pdf') *
{ * @Route("/resume.{_format}", name="GergelyPolonkaiFrontBundle_resume")
return $this->get('io_tcpdf')->quick_pdf($this->renderView('GergelyPolonkaiFrontBundle:Default:resume.html.twig', array( * @Template
'format' => $_format, */
))); public function resumeAction($_format)
} {
else if ($_format === 'pdf') {
{ return $this
return $this->render('GergelyPolonkaiFrontBundle:Default:resume.html.twig', array( ->get('io_tcpdf')
'format' => $_format, ->quick_pdf(
)); $this->renderView(
} 'GergelyPolonkaiFrontBundle:Default:resume.html.twig',
} array(
'format' => $_format
)
)
);
} else {
return array(
'format' => $_format,
);
}
}
} }

View File

@ -22,7 +22,7 @@ class GergelyPolonkaiFrontExtension extends Extension
$configuration = new Configuration(); $configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs); $config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml'); $loader->load('services.xml');
} }
} }

View File

@ -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

View File

@ -0,0 +1,20 @@
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<!--
<parameters>
<parameter key="gergely_polonkai_front.example.class">GergelyPolonkai\FrontBundle\Example</parameter>
</parameters>
<services>
<service id="gergely_polonkai_front.example" class="%gergely_polonkai_front.example.class%">
<argument type="service" id="service_id" />
<argument>plain_value</argument>
<argument>%parameter_name%</argument>
</service>
</services>
-->
</container>

View File

@ -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%]

1
vendor/doctrine vendored

@ -1 +0,0 @@
Subproject commit 03d2b0f30c35d313339478d24337dd1a28a2f2f2

1
vendor/monolog vendored

@ -1 +0,0 @@
Subproject commit b704c49a3051536f67f2d39f13568f74615b9922

1
vendor/swiftmailer vendored

@ -1 +0,0 @@
Subproject commit d02e07b2cc4e35234119033c6d0cc8805a893b11

1
vendor/symfony vendored

@ -1 +0,0 @@
Subproject commit c2480c1e73879593ef6b88571fc733ada5a26bba

1
vendor/twig vendored

@ -1 +0,0 @@
Subproject commit 2afc513620e7f8dadda92a0f4ed04cb157e048df