Skip to content

Instantly share code, notes, and snippets.

@Nek-
Last active December 21, 2015 22:59
Show Gist options
  • Save Nek-/6379021 to your computer and use it in GitHub Desktop.
Save Nek-/6379021 to your computer and use it in GitHub Desktop.
{# 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 %}
<?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';
}
}
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