Questions tagged [symfony-sonata]

The goal of the Sonata Project is to provide an e-commerce framework solution based on the Symfony (version 2 and 3) framework.

The goal of the Sonata Project is to provide an e-commerce framework solution based on the Symfony2 framework. Think of it as a toolkit based on Symfony2 components to make building e-commerce sites easy and fun!

http://sonata-project.org/about

599 questions
29
votes
4 answers

How to use Ajax within Sonata Admin forms?

I have a Merchant entity with the following fields and associations:- /** * @ORM\ManyToMany(targetEntity="Category", inversedBy="merchants") */ public $categories; /** * @ORM\ManyToMany(targetEntity="Tag", inversedBy="merchants") */ public…
Amit
  • 3,644
  • 9
  • 38
  • 49
25
votes
5 answers

Sonata Admin Bundle: DatePicker range

How would I create a doctrine_orm_datetime_range filter in the Sonata Admin Bundle which uses the jQuery UI datepicker? I tried the following, but it doesn't work: protected function configureDatagridFilters(DatagridMapper $datagridMapper) { …
24
votes
2 answers

Nested collection fields in Sonata Admin (2.3)

I'm having problems creating my form for creating a course. This is a part of my database scheme for which I'm trying to create a form: So which I'm trying to do is create a course where I can create sessions and dates (moment) attached to that…
nielsv
  • 6,540
  • 35
  • 111
  • 215
24
votes
4 answers

Sonataadminbundle: Multiple admin section for same entity

I have entity class Page with column type=integer. When I do:
Zeljko
  • 5,048
  • 5
  • 36
  • 46
23
votes
6 answers

How to get container instance in sonata Admin class?

I need to parse some configurations parameters from my config.yml such as enabled languages. But when i try to do that by using the normal symfony method: $this->container->get('my_params'); it fails because my admin class extends…
skonsoft
  • 1,786
  • 5
  • 22
  • 43
20
votes
4 answers

setting default value in symfony2 sonata admin bundle

how can i set default value in sonata admin bundle the data option is missing in configureFormFields method protected function configureFormFields(FormMapper $formMapper) { $formMapper ->add('name', null, array('required' => true,…
Anil Gupta
  • 2,329
  • 4
  • 24
  • 30
19
votes
7 answers

How to display the current picture above the upload field in SonataAdminBundle?

I am using SonataAdminBundle (with Doctrine2 ORM) and I have successfully added a file upload feature to my Picture model. I would like, on the Show and Edit pages, to display a simple tag just…
RockTheShow
  • 328
  • 1
  • 2
  • 10
18
votes
4 answers

Doctrine inserting in postPersist event

I want add new Feed item on entity persist and update. I write this event listener (postUpdate is same): public function postPersist(LifecycleEventArgs $args) { $entity = $args->getEntity(); $em = $args->getEntityManager(); if ($entity…
nucleartux
  • 1,381
  • 1
  • 14
  • 36
16
votes
2 answers

Stop SonataAdmin / Symfony2 from creating empty objects with sonata_type_admin embedded admins

First of all, I'm not sure if this is a Sonata issue or a Symfony2 one, this is the first time I'm working with Sf2 forms to edit a relationship. Here's the problem: I have two classes, let's call them the old favourites: Car and Wheel. Car has an…
caponica
  • 3,788
  • 4
  • 32
  • 48
16
votes
2 answers

SonataMediaBundle - how to upload images?

Probably should be titled: "SonataMediaBundle - where's the missing howto?". I've made some admin backend with sonataAdminBundle and sonataDoctrineORMAdminBundle (and some other), most of the things worked as expected, but I left file upload and…
heliogabal
  • 613
  • 2
  • 7
  • 16
15
votes
2 answers

Sonata admin bundle order

How to change default entity order in SonataAdminBundle for list action? answer :) add this to your admin class protected $datagridValues = array( '_page' => 1, '_sort_order' => 'DESC', // sort direction '_sort_by' => 'id' // field…
rtyshyk
  • 942
  • 1
  • 15
  • 29
15
votes
7 answers

Bundle "ApplicationSonataUserBundle" does not exist or it is not enabled

I need to install the SonataUserBundle to be able to install the SonataNewsBundle. I followed the installation Tutorial step by step but i got this error : ./app/console sonata:easy-extends:generate SonataUserBundle [InvalidArgumentException] …
skonsoft
  • 1,786
  • 5
  • 22
  • 43
13
votes
7 answers

PHP Fatal error: Class 'Application\Sonata\MediaBundle\ApplicationSonataMediaBundle' not found in /var/www/znata.com/app/AppKernel.php on line 47

i followed this doc to install SonataMediaBundle but i got this error: PHP Fatal error: Class 'Application\Sonata\MediaBundle\ApplicationSonataMediaBundle' not found in /var/www/znata.com/app/AppKernel.php on line 47 After using the sonata command…
skonsoft
  • 1,786
  • 5
  • 22
  • 43
12
votes
3 answers

Symfony2 Sonata Admin show attribute only as a readyonly text

I have some immutable attributes on my entity to administrate with sonata-admin bundle. I want to show them in the edit-view of the entity, but don't want to provide any mechanism to change it (e.g. the value shall not be inside a input field) I…
eav
  • 2,123
  • 7
  • 25
  • 34
12
votes
1 answer

Sonata Admin: Add custom triggers/actions to list/edit action

I'm using SonataAdminBundle for managing entities in my application. The admins of the site can add videos, and some of them first need to be approved by their speakers. There is an authorization system working already - I have working code which…
Teo.sk
  • 2,619
  • 5
  • 25
  • 30
1
2 3
39 40