1

I know how to read parameters from config.yml

$par = $this->container->getParameter('locale');

My problem is how to read Easyadmin Bundle configuration. The structure is presented below.

easy_admin:
  entities:
    Ksiazka:
        class: SklepBundle\Entity\Ksiazka
        label: 'Ksiazka'
        list:
            title: "Most recent customers"
            fields: ['id','autor','cena']

    Kategoria:
        class: SklepBundle\Entity\Kategoria
        label: 'Kategoria'
        list:
            title: "Most recent categories"

I would like to read e.g. Ksiazka class in controller. How?

Thank you for help in advance

appson
  • 173
  • 1
  • 18
  • If the class is the only thing you need then just define it as a parameter then use the parameter in your easy_admin section as well as the controller. Of course, you probably don't need it at all. – Cerad Nov 09 '16 at 20:27
  • Is it only one solution - define something as a parameter? Is it not possible to read config.yml like in this case? – appson Nov 10 '16 at 08:42
  • check that http://stackoverflow.com/questions/4821692/how-do-i-read-configuration-settings-from-symfony2-config-yml – Stephan Yamilov Nov 10 '16 at 08:45
  • You can of course use Yaml:Parse but it will be slow and again, you probably don't really need the info anyways. Make sure you understand the bundle thoroughly before trying to hack around it. – Cerad Nov 10 '16 at 12:36

0 Answers0