forked from genemu/GenemuFormBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
84 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,25 +11,19 @@ | |
|
||
namespace Genemu\Bundle\FormBundle\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\DependencyInjection\ContainerAware; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
|
||
/** | ||
* Class Base64Controller | ||
* | ||
* @author Olivier Chauvel <[email protected]> | ||
*/ | ||
class Base64Controller extends Controller | ||
class Base64Controller extends ContainerAware | ||
{ | ||
/** | ||
* @Route("/genemu_base64", name="genemu_base64") | ||
*/ | ||
public function base64Action(Request $request) | ||
public function base64Action() | ||
{ | ||
$query = $request->server->get('QUERY_STRING'); | ||
$query = $this->container->get('request')->server->get('QUERY_STRING'); | ||
$datas = preg_split('([;,]{1})', $query); | ||
|
||
return new Response(base64_decode($datas[2]), 200, array('Content-Type' => $datas[0])); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,26 +11,21 @@ | |
|
||
namespace Genemu\Bundle\FormBundle\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\DependencyInjection\ContainerAware; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
|
||
use Genemu\Bundle\FormBundle\Gd\File\Image; | ||
|
||
/** | ||
* Class ImageController | ||
* | ||
* @author Olivier Chauvel <[email protected]> | ||
*/ | ||
class ImageController extends Controller | ||
class ImageController extends ContainerAware | ||
{ | ||
/** | ||
* @Route("/genemu_change_image", name="genemu_form_image") | ||
*/ | ||
public function changeAction(Request $request) | ||
public function changeAction() | ||
{ | ||
$request = $this->container->get('request'); | ||
$rootDir = rtrim($this->container->getParameter('genemu.form.file.root_dir'), '/\\') . DIRECTORY_SEPARATOR; | ||
$folder = rtrim($this->container->getParameter('genemu.form.file.folder'), '/\\') . DIRECTORY_SEPARATOR; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,27 +11,21 @@ | |
|
||
namespace Genemu\Bundle\FormBundle\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\DependencyInjection\ContainerAware; | ||
use Symfony\Component\HttpFoundation\Response; | ||
|
||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
|
||
use Genemu\Bundle\FormBundle\Gd\File\Image; | ||
|
||
/** | ||
* Upload Controller | ||
* | ||
* @author Olivier Chauvel <[email protected]> | ||
*/ | ||
class UploadController extends Controller | ||
class UploadController extends ContainerAware | ||
{ | ||
/** | ||
* @Route("/genemu_upload", name="genemu_upload") | ||
*/ | ||
public function uploadAction(Request $request) | ||
public function uploadAction() | ||
{ | ||
$handle = $request->files->get('Filedata'); | ||
$handle = $this->container->get('request')->files->get('Filedata'); | ||
|
||
$folder = $this->container->getParameter('genemu.form.file.folder'); | ||
$uploadDir = $this->container->getParameter('genemu.form.file.upload_dir'); | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<routes xmlns="http://symfony.com/schema/routing" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<route id="genemu_base64" pattern="/genemu_base64"> | ||
<default key="_controller">GenemuFormBundle:Base64:base64</default> | ||
</route> | ||
|
||
</routes> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<routes xmlns="http://symfony.com/schema/routing" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<route id="genemu_form_image" pattern="/genemu_change_image"> | ||
<default key="_controller">GenemuFormBundle:Image:change</default> | ||
</route> | ||
|
||
</routes> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<routes xmlns="http://symfony.com/schema/routing" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> | ||
|
||
<route id="genemu_upload" pattern="/genemu_upload"> | ||
<default key="_controller">GenemuFormBundle:Upload:upload</default> | ||
</route> | ||
|
||
</routes> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
UPGRADE to Symfony 2.1 | ||
====================== | ||
|
||
### JQuery Chosen | ||
|
||
[BC BREAK] Widget option cannot specify the choice type anymore, you have to append the widget in the type name instead : | ||
|
||
Before : | ||
``` php | ||
$formBuilder | ||
->add('country', 'genemu_jquerychosen', array( | ||
'widget' => 'country', | ||
)); | ||
``` | ||
Now : | ||
``` php | ||
$formBuilder->add('country', 'genemu_jquerychosen_country'); | ||
``` | ||
|
||
### Routing | ||
|
||
[BC BREAK] Routing is defined in xml files instead of annotations (to remove the depency with SensioFrameworkExtraBundle) | ||
|
||
Before : | ||
``` yml | ||
# app/config/routing.yml | ||
genemu_base64: | ||
resource: "@GenemuFormBundle/Controller/Base64Controller.php" | ||
type: annotation | ||
``` | ||
Now : | ||
``` yml | ||
# app/config/routing.yml | ||
genemu_base64: | ||
resource: "@GenemuFormBundle/Resources/config/routing/base64.xml" | ||
``` |