1

I am new to symfony2 and and now i have installed Sonata Admin bundle. I am reading their documentaion but its not clear what should i do after installing it.

How should i start. I mean there is no example where i can start learning how to use that bundle. Can anyone please help me with this

1 Answer 1

2

Follow this installation instruction: http://sonata-project.org/bundles/admin/master/doc/reference/installation.html Then you have to create a new Admin class that references an existing entity class of your bundle: http://sonata-project.org/bundles/admin/master/doc/reference/getting-started.html

Please add more specific question if you want further support, thanks!

-- EDIT:

You can declare it wherever you want. Just notice that it has to extend base Admin class and must be a service tagged with 'sonata.admin'. IE:

namespace Acme\FooBundle\Admin; use Sonata\AdminBundle\Admin\Admin; class FooAdmin extends Admin { } 

and in services.xml of your bundle you have to add the declaration of the service:

<container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> <services> <service id="sonata.admin.foo" class="Acme\FooBundle\Admin\FooAdmin"> <tag name="sonata.admin" manager_type="orm" group="Foos" label="Foo"/> <argument /> <argument>Acme\FooBundle\Entity\Foo</argument> <argument>SonataAdminBundle:CRUD</argument> </service> </services> </container> 

Whenever you have the class and the declaration, if your setup is correct, you will see the new link in the Admin Dashboard of Sonata (it should be at the url /admin).

Sign up to request clarification or add additional context in comments.

3 Comments

I am confused where to declare that Admin class. Also i have installed SonataNewsBUndle but i have not seen anywhere in that bundle where that Admin class is declared. because in the admin/dashboard i can see it
thanks stef. Can you please edit the xml file to yml file. i find it hard to convert

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.