Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Combining bundles that use Sonata Admin
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Lars Janssen  
View profile  
 More options Oct 24 2012, 12:49 pm
From: Lars Janssen <l...@fazy.net>
Date: Wed, 24 Oct 2012 09:49:27 -0700 (PDT)
Local: Wed, Oct 24 2012 12:49 pm
Subject: Combining bundles that use Sonata Admin

Hi,

I'm involved in building a number of Symfony 2 applications, many of which
will need to share similar admin functionality based on the Sonata Admin
bundle. Of course, I don't want to copy and paste code between projects. :)

Suppose I have a bundle src/Acme/AdminBundle that provides the following:

    * Log in/out (using entities in
src/Application/Sonata/UserBundle/Entity)
    * Dashboard
    * Administer users and groups (using entities in
src/Application/Sonata/UserBundle/Entity)
    * Administer Feature X (using entities in
src/Acme/FeatureXBundle/Entity)
    * Administer Feature Y (using entities in
src/Acme/FeatureYBundle/Entity)

If Feature X and Feature Y both have several admin pages, and could be used
by several different web applications, I might be tempted to create the
following bundles:

    * src/Acme/AdminBundle - base admin bundle including the user/group
admin, default dashboard and log in/out
    * src/Acme/FeatureXAdminBundle - bundle that adds admin pages for
Feature X
    * src/Acme/FeatureYAdminBundle - bundle that adds admin pages for
Feature Y

The idea is that any application could bring in the admin bundles needed,
with the appropriate entries in config.yml.

So my questions are:

1. Is the above possible using Symfony 2 / Sonata Admin?
2. Is it a desirable approach anyway?
3. Is there an alternative way to provide this flexibility?

I've tried putting the above into practice, but it seems the closest I can
get involves having one 'main' AdminBundle with a config/services.yml
defining services with reference to all the other Admin bundles. Also
tried, unsuccessfully so far, to use bundle inheritance.

Thanks,

Lars.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Buchmann  
View profile  
 More options Oct 26 2012, 5:29 am
From: David Buchmann <da...@liip.ch>
Date: Fri, 26 Oct 2012 11:29:37 +0200
Local: Fri, Oct 26 2012 5:29 am
Subject: Re: [sonata-users] Combining bundles that use Sonata Admin
why do you want to separate the admins from the entities?

we just put the Admin for the respective entities into the bundle of
that entity. and define the service in that same bundle and tag it.

for an example with PhpcrOdm admin see
https://github.com/symfony-cmf/MenuBundle/blob/master/Resources/confi...
(note that your "manager_type" attribute will be different with orm
https://github.com/symfony-cmf/MenuBundle/tree/master/Admin

cheers,david

Am 24.10.2012 18:49, schrieb Lars Janssen:

--
Liip AG // Agile Web Development // T +41 26 422 25 11
CH-1700 Fribourg // PGP 0xA581808B // www.liip.ch

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lars Janssen  
View profile  
 More options Oct 29 2012, 2:11 pm
From: Lars Janssen <l...@fazy.net>
Date: Mon, 29 Oct 2012 11:11:55 -0700 (PDT)
Local: Mon, Oct 29 2012 2:11 pm
Subject: Re: [sonata-users] Combining bundles that use Sonata Admin

Hi David,

Regarding separating bundles from entities - in the beginning we had an
Admin bundle for all the admin functionality separate from all the other
bundles. Now that we've moved to something pretty much as you suggested,
there's no reason to have the admin classes in separate bundles from their
entities.

The one step we haven't made yet is to define all the services in their
respective bundles. For now we have:

AdminBundle - containing the services configuration, pulling it all
together, and the dashboard
FeatureXBundle - including admin classes, entities
FeatureYBundle - including admin classes, entities

Do you think it's possible to eliminate need for the AdminBundle
altogether? i.e. by moving all service configuration to the feature bundles.

If we did that, the only possible other reason to keep the AdminBundle is
to keep any style/layout that we might do differently from Sonata.

Thanks,

Lars.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »