I want to use FOSElasticaBundle on my symfony2 project.
Both bundles are correctly configured and functionals.
I already use Gedmo Translatable to handle multilingual but I cannot find how to implement gedmo translations in my elastic mapping or to build an elastic query which get results with a chosen locale.
Anyone already experienced this problem ?
Related
is it possible to use in a Symfony project Gedmo Doctrine Extension Translatable with YAML configuration and to generate the entities with php bin/console doctrine:generate:entities ?
I tried the StofDoctrineExtensionsBundle, I tried Gedmo on its own. But I didn't get it working.
When I write the entities by hand and use annotations everything works fine. But in my project every entity is defined by YAML.
I read this doc in order to understand how the doctrine uploadable extension works so I can use it in my Symfony projects.
The problem is at the usage example, where I see an object called $listener and I really can not figure out where does it come from.
I intend to use a similar piece of code in one of my controllers, but I don't know to instantiate that listener, or where to grab it from.
If you look into the github project in question, you can see that they have a documentation in how to install and use them with symfony 2:
Install Gedmo Doctrine2 extensions in Symfony2
And if you don't want to do the hard work, there is also a pre-made bundle:
Integration bundle for DoctrineExtensions by l3pp4rd in Symfony2 (documentation)
Please note that while the bundle should be easier to install, it is made by a third party, not by the extensions developer, and it might not be as up to date.
I am migrating from symfony1 to symfony2, I have hard time implementing propel behaviors. Where do I actually have the propel.ini in symfony2?
Well in sf1.4, it was inside root config directory. How about symfony2?
The Propel ORM Symfony2 page says this:
You can add a app/config/propel.ini file in your project to specify some configuration parameters. ... However, the recommended way to configure Propel is to rely on build properties.
You can define build properties by creating a propel.ini file in app/config like below, but you can also follow the Symfony2 convention by adding build properties in app/config/config.yml
So I believe you can come close to the Symfony1 behaviour by creating app/config/propel.ini, but the more idiomatic way is to use app/config/config.yml as that page illustrates.
Caveat: I haven't used Propel with Symfony2, so this answer is solely based on the manual.
I was wondering if someone managed to add I18n forms in the SonataAdminBundle to be able to Edit both english fields and other languages fields like we used to do in Symfony 1.4.
Our fields are I18n'ed with the Gedmo Doctrine Extensions
PS: We are using Symfony 2.1-DEV.
Thanks.
personal translations can be used in symfony2 forms I guess including sonata. Using recent stof extensions bundle from master branch. You will need to configure mapping manually, follow the docs on stof bundle.
By default translatable uses a common table for all translations. Which does not have a direct foreign key constraint. You need to specify the #Gedmo\TranslationEntity(class="your\personal\translation\entity\class") class annotation in order to use personal translations.
Is it possible to use Twig in Silex from Symfony2 project instead from the standalone bundle?
I already have Symfony integrated as submodule, so is it still necessary to use Twig alongside symfony in the vendor dir?
That would save me one submodule, i mean its no problem thou, i am just curious.
It would be great if i just would have to change the *twig.class_path* to some dir in symfony.
$app->register(new Silex\Provider\TwigServiceProvider(), array(
'twig.path' => __DIR__.'/../views',
'twig.class_path' => __DIR__.'/../vendor/twig/lib',
));
I am a bit lost in symfony, there is some Twig in Bridges and some in Bundle, but first i need to know if its possible at all.
No, that is not possible.
There are following libraries in existence:
Twig - a standalone template engine for PHP.
TwigServiceProvider - integration between twig and silex, this is included with silex.
TwigBridge - a Symfony2 bridge which adds useful features to twig, allowing tighter integration with Symfony2
TwigBundle - a Symfony2 core bundle that provides integration between Symfony2 and twig, depends on the TwigBridge
As you can see, twig is not included with the Symfony2 core. It is an external dependency, that you have to tie in to Symfony2, and you also have to tie into silex.