Inject a custom Controller in Sonata

I had this problem, I needed to inject a Storage to my controller so I can create a custom action and connect to my db using a storage service. All I needed was configure the services as following: [cc_yaml] services: app.admin.document: class: AppBundle\Admin\DocumentAdmin arguments: [~, AppBundle\Entity\Document, ‘app.controller.document’] tags: – { name: sonata.admin, manager_type: orm, group:

Ignore modified file from commit

Sometimes you need to change some files, just for your development environment and you don’t want to commit those changes. With Git there a way to fix your problem. First of all, made all the change you need in the file(s) to ignore then run this command: [cc_shell] $ git update-index –assume-unchanged path/to/the/file/to/ignore [/cc] and

Install FOS User in Symfony 2

After finished the tutorial I needed a user Bundle, the FOS Bundle (Friend of Symfony) is for Symfony 2 what SfGuardUser was for Symfony 1, so we gonna continue the tutorial started in the previous post. Installing the bunddles: [cce_bash] composer require sonata-project/user-bundle –no-update composer update [/cce_bash] Add to your registerbundles function in the AppKernel

Shell “ls -l” sort by list column

It’s common to list the files on directory, but it usefull to list them order sometimes. One way to do that is to simply add the | sort -k instruction. The value of k is the column who will be ordered. [cce_bash] 15:42 $ ls -lh total 712 drwxr-xr-x 2 walter staff 68B Jan 19