diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ffdd3ba --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +/.idea diff --git a/DependencyInjection/LifoTypeaheadExtension.php b/DependencyInjection/LifoTypeaheadExtension.php index 6caecdf..4029eb8 100644 --- a/DependencyInjection/LifoTypeaheadExtension.php +++ b/DependencyInjection/LifoTypeaheadExtension.php @@ -82,7 +82,7 @@ protected function configureAsseticBundle(ContainerBuilder $container, array $co protected function configureTwigBundle(ContainerBuilder $container, array $config) { if ($container->hasExtension('twig')) { - $resources = array('LifoTypeaheadBundle:Form:typeahead.html.twig'); + $resources = array('@LifoTypeahead\Form\typeahead.html.twig'); if (Kernel::VERSION_ID >= '20600') { $container->prependExtensionConfig('twig', array('form_themes' => $resources)); } else { diff --git a/Resources/views/Form/typeahead.html.twig b/Resources/views/Form/typeahead.html.twig index ae97dc6..d93da2c 100644 --- a/Resources/views/Form/typeahead.html.twig +++ b/Resources/views/Form/typeahead.html.twig @@ -1,6 +1,6 @@ {% block entity_typeahead_widget %} {% spaceless %} - {% set required, main_full_name, main_id, main_value, main_attr = false, full_name, id, value, attr %} + {% set main_full_name, main_id, main_value, main_attr = full_name, id, value, attr %} {# create visible autocomplete input #} {% set id = main_id ~ '_text' %} @@ -56,7 +56,7 @@ {% block entity_typeahead_list_widget %} {% spaceless %} - {% if simple %} + {% if simple or child == null %} {% set _id, _value, _render = child, child, child %} {% else %} {% set _id, _value, _render = child.id, attribute(child, property ?: 'id'), attribute(child, render) %} diff --git a/composer.json b/composer.json index 027f2ee..e19386b 100644 --- a/composer.json +++ b/composer.json @@ -10,9 +10,6 @@ "email": "lifo2013@gmail.com" } ], - "require": { - "symfony/symfony": "^2.6 || ^3.0" - }, "suggest": { "twbs/bootstrap": "Bootstrap framework", "mopa/bootstrap-bundle": "Bundle to automatically enable Bootstrap styles for Symfony"