sonata-project/SonataAdminBundle — Issue #337: Two questions from a newbie
Author: mgws
Created: 2011-10-13 10:41:49+00:00
State: open

Hi,
I use SonataAdminBundle in my web app, but I have a few question that I cannot find response with the tutorial and documentation of this bundle and from symfony documentation official:

1) Take for example the tutorial in the official documentation about the creation of a post with comments and tags. Consider also the case that the registered user has the ability to change only one post (where the ID of the post is saved in a table associated with that of their account), but not create other posts or view the list of posts included. How can I do, with SonataAdmin, to see only the edit page of the post without putting the ID in the URL.??
It is as if I should take the ID from the session instead of passing via URL. Where I have to modify the PostAdmin class for insert this ID? It is possibile or it can do in another way?

2) Also in the class PostAdmin.php, if I want to show a checkbox only after being pressed, for example, a button or antother checkbox, can I use Javascript or PHP (with page reload in this case)? Can you give me an example of this two ways if they are applicable? For example, in the first case with JS I get the ID of the button (which can be a thing like id-_profiler-token_button) and then with a script I show the checkbox? Or with PHP where I have to put the PHP directives? In the template or class PostAdmin.php?

Pls help!
Thanks all!