Development

SymfonyWeek19 (diff)

You must first sign up to be able to contribute.

Changes between Version 4 and Version 5 of SymfonyWeek19

Show
Ignore:
Author:
fabien (IP: 82.243.240.35)
Timestamp:
05/14/06 15:14:39 (11 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SymfonyWeek19

    v4 v5  
    22 
    33== Development highlights == 
     4 
     5r1365: added a new param type to include_partial() calls in admin generator 
     6 
     7In the admin generator, if you want to override the generated HTML for a column, you can create a partial: 
     8 
     9`/modules/movie/config/generator.yml` 
     10{{{ 
     11list: 
     12  display: [id, name, _rating] 
     13}}}  
     14 
     15`/modules/movie/templates/_partial.php` 
     16{{{ 
     17echo image_tag('/images/rating/'.$movie->getRating().'.png'); 
     18}}} 
     19 
     20But this didn't work if you wanted to override the column for the list AND the edit AND the filters. You can now do something like that: 
     21 
     22`/modules/movie/config/generator.yml` 
     23{{{ 
     24list: 
     25  display: [id, name, _rating] 
     26 
     27edit: 
     28  display: [id, name, _rating] 
     29}}}  
     30 
     31`/modules/movie/templates/_partial.php` 
     32{{{ 
     33<?php 
     34 
     35if ($type == 'list') 
     36{ 
     37  $options = array( 
     38    0 => 'awful', 
     39    1 => 'excellent', 
     40  ); 
     41 
     42  echo select_tag('movie[rating]', options_for_select($options, $movie->getRating())); 
     43} 
     44else 
     45{ 
     46  echo image_tag('/images/rating/'.$movie->getRating().'.png'); 
     47} 
     48}}} 
     49 
     50The `$type` variable contains `list`, `edit` or `filter`. 
    451 
    552r1363: added sql queries to the web debug toolbar