-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default default formatter configuration
- Loading branch information
1 parent
1d0ec9f
commit 9a7057e
Showing
7 changed files
with
133 additions
and
80 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
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 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 |
---|---|---|
@@ -1,75 +1,75 @@ | ||
.. index:: | ||
single: Installation; Bundle; Configuration | ||
|
||
Installation | ||
============ | ||
|
||
To begin, add the dependent bundles: | ||
|
||
.. code-block:: bash | ||
$ php composer.phar require sonata-project/formatter-bundle | ||
Register the bundle in ``app/AppKernel.php``: | ||
|
||
.. code-block:: php | ||
<?php | ||
// app/AppKernel.php | ||
$bundles = array( | ||
// ... | ||
// SonataMarkItUpBundle is deprecated. All assets are now available in formatter bundle | ||
// new Sonata\MarkItUpBundle\SonataMarkItUpBundle(), | ||
new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle(), | ||
new Ivory\CKEditorBundle\IvoryCKEditorBundle(), | ||
new Sonata\FormatterBundle\SonataFormatterBundle(), | ||
); | ||
Configuration | ||
============= | ||
|
||
Edit the ``config.yml`` file and add these lines: | ||
|
||
.. code-block:: yaml | ||
sonata_formatter: | ||
formatters: | ||
markdown: | ||
service: sonata.formatter.text.markdown | ||
extensions: | ||
- sonata.formatter.twig.control_flow | ||
- sonata.formatter.twig.gist | ||
# - sonata.media.formatter.twig #keep this commented unless you are using media bundle. | ||
text: | ||
service: sonata.formatter.text.text | ||
extensions: | ||
- sonata.formatter.twig.control_flow | ||
- sonata.formatter.twig.gist | ||
# - sonata.media.formatter.twig | ||
rawhtml: | ||
service: sonata.formatter.text.raw | ||
extensions: | ||
- sonata.formatter.twig.control_flow | ||
- sonata.formatter.twig.gist | ||
# - sonata.media.formatter.twig | ||
richhtml: | ||
service: sonata.formatter.text.raw | ||
extensions: | ||
- sonata.formatter.twig.control_flow | ||
- sonata.formatter.twig.gist | ||
# - sonata.media.formatter.twig | ||
twig: | ||
service: sonata.formatter.text.twigengine | ||
extensions: [] # Twig formatter cannot have extensions | ||
.. index:: | ||
single: Installation; Bundle; Configuration | ||
|
||
Installation | ||
============ | ||
|
||
To begin, add the dependent bundles: | ||
|
||
.. code-block:: bash | ||
$ php composer.phar require sonata-project/formatter-bundle | ||
Register the bundle in ``app/AppKernel.php``: | ||
|
||
.. code-block:: php | ||
<?php | ||
// app/AppKernel.php | ||
$bundles = array( | ||
// ... | ||
// SonataMarkItUpBundle is deprecated. All assets are now available in formatter bundle | ||
// new Sonata\MarkItUpBundle\SonataMarkItUpBundle(), | ||
new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle(), | ||
new Ivory\CKEditorBundle\IvoryCKEditorBundle(), | ||
new Sonata\FormatterBundle\SonataFormatterBundle(), | ||
); | ||
Configuration | ||
============= | ||
|
||
Edit the ``config.yml`` file and add these lines: | ||
|
||
.. code-block:: yaml | ||
sonata_formatter: | ||
formatters: | ||
markdown: | ||
service: sonata.formatter.text.markdown | ||
extensions: | ||
- sonata.formatter.twig.control_flow | ||
- sonata.formatter.twig.gist | ||
# - sonata.media.formatter.twig #keep this commented unless you are using media bundle. | ||
text: | ||
service: sonata.formatter.text.text | ||
extensions: | ||
- sonata.formatter.twig.control_flow | ||
- sonata.formatter.twig.gist | ||
# - sonata.media.formatter.twig | ||
rawhtml: | ||
service: sonata.formatter.text.raw | ||
extensions: | ||
- sonata.formatter.twig.control_flow | ||
- sonata.formatter.twig.gist | ||
# - sonata.media.formatter.twig | ||
richhtml: | ||
service: sonata.formatter.text.raw | ||
extensions: | ||
- sonata.formatter.twig.control_flow | ||
- sonata.formatter.twig.gist | ||
# - sonata.media.formatter.twig | ||
twig: | ||
service: sonata.formatter.text.twigengine | ||
extensions: [] # Twig formatter cannot have extensions |
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
9a7057e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have an Exception after updating:
Can you tell me what I have to do?
9a7057e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tophsic can you please post the output of
composer show -i | grep sonata
?@sagikazarmark can you please help and if this is a bug, add a test case?
9a7057e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9a7057e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and please post the config part from
sonata_formatter
9a7057e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I have time to help today. Will have a look later if you do not have time neither.
9a7057e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 but the config would be helpful, afterwards we can try to reproduce the error, IMO it is weird, that no formatters are available...
9a7057e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it is. Is it possible that the check for a valid formatter is executed prior to the actual config schema check?
9a7057e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Till now I did not have any
sonata_formatter
config part. Did I miss something ?Here is a
var_dump
of$config
variable fromSonataFormatterExtension.php:59
file9a7057e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but you already use the formatter/ckeditor in your project?
9a7057e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to remember when I activate ckeditor 😉. I assume it is related to richhtml fields in my forms.
9a7057e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember now and find what I did in my project. We use ckeditor because we have rich fields in our forms. But I wanted to have only one format available so I did this simple field configuration
When I did this, the
sonata_formatter
configuration appeared to be uselees so I removed it.I just get it back and described only the
richhtml
part and all went good. So I assume you do not have anything to do ;).Thank you very much for your reactivity and your rubber duck advices 😉
9a7057e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please next time, open issues instead of commenting a commit when you got problems.