Changeset 142
- Timestamp:
- 03/14/07 21:03:21 (2 years ago)
- Files:
-
- trunk/lib/AkActionView/TemplateEngines/AkSintags/AkSintagsLexer.php (modified) (1 diff)
- trunk/lib/AkActionView/TemplateEngines/AkSintags/AkSintagsParser.php (modified) (1 diff)
- trunk/script/generators/scaffold/templates/functional_test.php (deleted)
- trunk/script/generators/scaffold/templates/installer.tpl (modified) (1 diff)
- trunk/script/generators/scaffold/templates/view.tpl (deleted)
- trunk/script/generators/scaffold/templates/view_listing.tpl (modified) (2 diffs)
- trunk/test/fixtures/data/sintags_test_data.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/AkActionView/TemplateEngines/AkSintags/AkSintagsLexer.php
r140 r142 98 98 function _addLoopTokens() 99 99 { 100 $this->addSpecialPattern('{loop [A-Za-z][\.A-Za-z0-9_-]+ }','Text','Loop');100 $this->addSpecialPattern('{loop [A-Za-z][\.A-Za-z0-9_-]+\??}','Text','Loop'); 101 101 } 102 102 trunk/lib/AkActionView/TemplateEngines/AkSintags/AkSintagsParser.php
r140 r142 239 239 { 240 240 if(AK_LEXER_SPECIAL === $state){ 241 $sintags_var = substr($match, 6,-1);241 $sintags_var = rtrim(substr($match, 6,-1),'?'); 242 242 $php_variable = $this->_convertSintagsVarToPhp($sintags_var); 243 243 if($php_variable){ trunk/script/generators/scaffold/templates/installer.tpl
r98 r142 18 18 { 19 19 $this->createTable('<?=$plural_name?>', " 20 id integer not null auto increment pk 20 id, 21 name, 22 description, 23 created_at, 24 updated_at 21 25 "); 22 26 } trunk/script/generators/scaffold/templates/view_listing.tpl
r2 r142 15 15 <tr> 16 16 <?='<? '?>$content_columns = array_keys($<?=$model_name?>->getContentColumns()); ?> 17 {loop content_columns ?}17 {loop content_columns} 18 18 <th scope="col"><?='<?= '?>$pagination_helper->sortable_link($content_column) ?></th> 19 19 {end} … … 21 21 </tr> 22 22 23 {loop <?=$plural_name?> ?}23 {loop <?=$plural_name?>} 24 24 <tr {?<?=$singular_name?>_odd_position}class="odd"{end}> 25 {loop content_columns ?}25 {loop content_columns} 26 26 <td class="field"><?='<?= '?>$<?=$singular_name?>->get($content_column) ?></td> 27 27 {end} trunk/test/fixtures/data/sintags_test_data.txt
r138 r142 279 279 280 280 281 =================================== 282 283 {loop posts?} 284 <q> {post.comment?} {post.author?} </q> 285 {end} 286 287 ----------------------------------- 288 289 290 <?php 291 empty($posts) ? null : $post_loop_counter = 0; 292 empty($posts) ? null : $posts_available = count($posts); 293 if(!empty($posts)) 294 foreach ($posts as $post_loop_key=>$post){ 295 $post_loop_counter++; 296 $post_is_first = $post_loop_counter === 1; 297 $post_is_last = $post_loop_counter === $posts_available; 298 $post_odd_position = $post_loop_counter%2; 299 ?> 300 <q> <?php echo empty($post->comment) ? '' : $post->comment; ?> <?php echo empty($post->author) ? '' : $post->author; ?> </q> 301 <?php } ?> 302 303 304
