Last active
December 21, 2015 22:59
-
-
Save Nek-/6379021 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
{# Template for Nekland Editor #} | |
{% block nekland_editor_widget %} | |
{% spaceless %} | |
{# Adding a special class to the textarea #} | |
{% set attr = attr|merge({'class': attr.class|default('') ~ 'nekland_editor' }) %} | |
<textarea {{ block('widget_attributes') }}>{{ value }}</textarea> | |
{% endspaceless %} | |
{% endblock %} |
This file contains hidden or 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
<?php | |
/** | |
* Author: nek | |
* Date: 29/08/13 | |
* Copyleft Nekland | |
*/ | |
namespace Nekland\Bundle\BaseAdminBundle\Form\Type; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\OptionsResolver\OptionsResolverInterface; | |
/** | |
* Class NeklandEditorType | |
* | |
* Allow users to use nekland editor easily | |
* The template is defined in "NeklandBaseAdminBundle::form.html.twig" | |
* | |
* @package Nekland\Bundle\BaseAdminBundle\Form\Type | |
*/ | |
class NeklandEditorType extends AbstractType | |
{ | |
public function getParent() | |
{ | |
return 'textarea'; | |
} | |
public function getName() | |
{ | |
return 'nekland_editor'; | |
} | |
} |
This file contains hidden or 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
services: | |
form.type.nekland_editor: | |
class: Nekland\Bundle\BaseAdminBundle\Form\Type\NeklandEditorType | |
tags: | |
- { name: form.type, alias: nekland_editor } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment