Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>i did this last week and was also a bit lost at first. I can tell you what i did, and you adapt to your solution. In my solution i had a module called Notifications, with the following fields: id, content, state, sent_at, instance, created_at. In my problem notifications could be sent to a list of users, so the users are foreing data, not saved in the notification table (1 to n relation). So when you Edit o create a notification i only show a few fields of the notification (like it content, and the instance) the other fields like the date are not editable (my choice). So in the creation i show only 2 of the 6 fields of the class. And also i want to see a list of users to multi-select, so i use a partial located in the template folder called "_get_all_users_list.php" that has a criteria and returns a multi-select tag.</p> <p>_get_all_users_list.php file</p> <pre><code>&lt;?php echo select_tag('users', objects_for_select( UserPeer::doSelect(new Criteria),"getId","getUsername") ,array( "multiple"=&gt;1, "size"=&gt;15) ); ?&gt; </code></pre> <p>And to be able to show the list of users in the generator.yml i do this:</p> <pre><code>generator: </code></pre> <p>class: sfPropelAdminGenerator param: model_class: Notification theme: default</p> <pre><code>list: title: Notificaciones max_per_page: 20 display: [ id, content, state, sent_at, sknow_instance, created_at] object_actions: _edit: ~ _delete: ~ batch_actions: _delete: ~ edit: title: Modificar notificacion: display: [content, sknow_instance, _getAllUsersList ] fields: content: { name: Notification content, type: textarea_tag, params: size=80x5 } get_all_users_list: { name: Select one or more users to be notified} </code></pre> <p>as you see in the "display:" area of the generator.yml on edit, you can declare the fields you want to be editable/enabled on creation, and if you want to include a partial, you must declare it with a _ in the begining and in the camelCase format, and the name of the partial must start with a _ and the name must be separated by _ .</p> <p>I found very useful this chapter of symfony's book <a href="http://www.symfony-project.org/book/1_2/14-Generators" rel="nofollow noreferrer">Admin Generator</a></p> <p>i hope it help, and sorry for my english.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload