Skip to content

Commit

Permalink
Merge pull request #48 from jmsche/symfony-4
Browse files Browse the repository at this point in the history
Updated for Symfony 4 compatibility
  • Loading branch information
Simon Guionniere authored Feb 5, 2018
2 parents c9b40ee + 03267b6 commit c14a5a9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DependencyInjection/KMSFroalaEditorExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private function loadResources( ContainerBuilder $p_container )
// ------------------------- DECLARE ---------------------------//

$p_container->setParameter( "twig.form.resources", array_merge( array(
"KMSFroalaEditorBundle:Form:froala_widget.html.twig"
"@KMSFroalaEditor/Form/froala_widget.html.twig"
),
$p_container->getParameter( "twig.form.resources" ) ) );
}
Expand Down
2 changes: 1 addition & 1 deletion Form/Type/FroalaEditorType.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function getParent()
{
// ------------------------- DECLARE ---------------------------//

if( $this->m_version == 3 )
if( $this->m_version >= 3 )
{
return "Symfony\Component\Form\Extension\Core\Type\TextareaType";
}
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

[![knpbundles.com](http://knpbundles.com/froala/KMSFroalaEditorBundle/badge)](http://knpbundles.com/froala/KMSFroalaEditorBundle)

## Symfony 3 update
## Symfony 3 & 4 update

This bundle is now compatible with Symfony 2 and 3 on the same branch (dev-master).
This bundle is now compatible with Symfony 2, 3 and 4 on the same branch (dev-master).

## Migration to Froala Editor v2

Expand Down Expand Up @@ -134,7 +134,7 @@ Just add a froala type in your form:

``` php
$builder->add( "yourField", "froala" ); // Symfony 2
$builder->add( "yourField", FroalaEditorType::class ); // Symfony 3
$builder->add( "yourField", FroalaEditorType::class ); // Symfony 3 & 4
```

All configuration items can be overridden:
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Form/froala_widget.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
key : "{{ serialNumber }}",
{% endif %}
{% for option, value in arrOption %}
{{ option }} : {% include "KMSFroalaEditorBundle:Form:value.html.twig" %}
{{ option }} : {% include "@KMSFroalaEditor/Form/value.html.twig" %}
{% endfor %} })
.on( "froalaEditor.image.error", function ( e, editor, error )
{
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kms/froala-editor-bundle",
"type": "symfony-bundle",
"description": "Provides a Froala editor integration for Symfony 2/3.",
"description": "Provides a Froala editor integration for Symfony 2/3/4.",
"keywords": [ "froala", "editor", "wysiwyg" ],
"license": "MIT",
"authors": [
Expand All @@ -16,13 +16,13 @@
],
"require": {
"php": "^5.3.3|^7.0",
"symfony/framework-bundle": "^2.3|^3.0",
"symfony/form": "^2.3|^3.0",
"symfony/framework-bundle": "^2.3|^3.0|^4.0",
"symfony/form": "^2.3|^3.0|^4.0",
"twig/twig": "^1.1|^2.0"
},
"require-dev": {
"symfony/twig-bundle": "^2.3|^3.0",
"symfony/yaml": "^2.3|^3.0"
"symfony/twig-bundle": "^2.3|^3.0|^4.0",
"symfony/yaml": "^2.3|^3.0|^4.0"
},
"autoload": {
"psr-4": { "KMS\\FroalaEditorBundle\\": "" }
Expand Down

0 comments on commit c14a5a9

Please sign in to comment.