Changeset 155
- Timestamp:
- 03/27/07 03:22:33 (2 years ago)
- Files:
-
- trunk/lib/AkActionController.php (modified) (6 diffs)
- trunk/lib/AkActionView.php (modified) (3 diffs)
- trunk/lib/AkActionView/helpers/capture_helper.php (modified) (4 diffs)
- trunk/lib/AkActionView/helpers/form_helper.php (modified) (3 diffs)
- trunk/script/generators/controller/templates/controller.tpl (modified) (1 diff)
- trunk/script/generators/controller/templates/fixture.tpl (modified) (1 diff)
- trunk/script/generators/controller/templates/functional_test.tpl (modified) (1 diff)
- trunk/script/generators/controller/templates/helper.tpl (modified) (1 diff)
- trunk/script/generators/controller/templates/helper_fixture.tpl (modified) (1 diff)
- trunk/script/generators/controller/templates/view.tpl (modified) (1 diff)
- trunk/script/generators/model/templates/installer.tpl (modified) (2 diffs)
- trunk/script/generators/model/templates/installer_fixture.tpl (modified) (1 diff)
- trunk/script/generators/model/templates/model.tpl (modified) (1 diff)
- trunk/script/generators/model/templates/model_fixture.tpl (modified) (1 diff)
- trunk/script/generators/model/templates/unit_test.tpl (modified) (2 diffs)
- trunk/script/generators/scaffold/templates/controller.php (modified) (4 diffs)
- trunk/script/generators/scaffold/templates/form.tpl (modified) (2 diffs)
- trunk/script/generators/scaffold/templates/form_scaffolding.tpl (modified) (1 diff)
- trunk/script/generators/scaffold/templates/helper.php (modified) (1 diff)
- trunk/script/generators/scaffold/templates/installer.tpl (modified) (3 diffs)
- trunk/script/generators/scaffold/templates/installer_fixture.tpl (modified) (1 diff)
- trunk/script/generators/scaffold/templates/layout.tpl (modified) (1 diff)
- trunk/script/generators/scaffold/templates/model.tpl (modified) (1 diff)
- trunk/script/generators/scaffold/templates/model_fixture.tpl (modified) (1 diff)
- trunk/script/generators/scaffold/templates/model_unit_test.tpl (modified) (2 diffs)
- trunk/script/generators/scaffold/templates/view_add.tpl (modified) (1 diff)
- trunk/script/generators/scaffold/templates/view_destroy.tpl (modified) (2 diffs)
- trunk/script/generators/scaffold/templates/view_edit.tpl (modified) (1 diff)
- trunk/script/generators/scaffold/templates/view_listing.tpl (modified) (2 diffs)
- trunk/script/generators/scaffold/templates/view_show.tpl (modified) (1 diff)
- trunk/script/generators/service/templates/service.tpl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/AkActionController.php
r153 r155 441 441 * 442 442 * * Renders "hello, hello, hello, again" 443 * $this->render(array('inline' => "<? =str_repeat('hello, ', 3).'again'?>" ));443 * $this->render(array('inline' => "<?php echo str_repeat('hello, ', 3).'again'?>" )); 444 444 * 445 445 * * Renders "hello david" 446 * $this->render(array('inline' => "<? ='hello ' . $name ?>", 'locals' => array('name' => 'david')));446 * $this->render(array('inline' => "<?php echo 'hello ' . $name ?>", 'locals' => array('name' => 'david'))); 447 447 * 448 448 * … … 1032 1032 * to isolate changes in repeated setups. The inclusion pattern has pages that look like this: 1033 1033 * 1034 * <? =$controller->render('shared/header') ?>1034 * <?php echo $controller->render('shared/header') ?> 1035 1035 * Hello World 1036 * <? =$controller->render('shared/footer') ?>1036 * <?php echo $controller->render('shared/footer') ?> 1037 1037 * 1038 1038 * This approach is a decent way of keeping common structures isolated from the … … 1045 1045 * 1046 1046 * <!-- The header part of this layout --> 1047 * <? =$content_for_layout ?>1047 * <?php echo $content_for_layout ?> 1048 1048 * <!-- The footer part of this layout --> 1049 1049 * … … 1066 1066 * rendering time: 1067 1067 * 1068 * <h1><? =$page_title ?></h1>1069 * <? =$content_for_layout ?>1068 * <h1><?php echo $page_title ?></h1> 1069 * <?php echo $content_for_layout ?> 1070 1070 * 1071 1071 * ...and content pages that fulfill these references _at_ rendering time: 1072 1072 * 1073 * <? $page_title = 'Welcome'; ?>1073 * <?php $page_title = 'Welcome'; ?> 1074 1074 * Off-world colonies offers you a chance to start a new life 1075 1075 * … … 1201 1201 * If a layout is specified, all actions rendered through render and render_action will have their result assigned 1202 1202 * to <tt>$this->content_for_layout</tt>, which can then be used by the layout to insert their contents with 1203 * <tt><? =$$this->content_for_layout ?></tt>. This layout can itself depend on instance variables assigned during action1203 * <tt><?php echo $$this->content_for_layout ?></tt>. This layout can itself depend on instance variables assigned during action 1204 1204 * performance and have access to them as any normal template would. 1205 1205 */ … … 1882 1882 * 1883 1883 * display.tpl 1884 * <? if($flash['notice']) : ?><div class='notice'><?=$flash['notice'] ?></div><?endif; ?>1884 * <?php if($flash['notice']) : ?><div class='notice'><?php echo $flash['notice'] ?></div><?php endif; ?> 1885 1885 * 1886 1886 * This example just places a string in the flash, but you can put any object in there. And of course, you can put as many trunk/lib/AkActionView.php
r153 r155 26 26 * 27 27 * <b>Names of all the people</b> 28 * <? foreach($people as $person) : ?>28 * <?php foreach($people as $person) : ?> 29 29 * Name: <?=$person->name ?><br/> 30 * <? endforeach ?>30 * <?php endforeach ?> 31 31 * 32 32 * == Using sub templates … … 45 45 * variables defined using the regular embedding tags. Like this: 46 46 * 47 * <? $shared->page_title = "A Wonderful Hello" ?>47 * <?php $shared->page_title = "A Wonderful Hello" ?> 48 48 * <?= $controller->render("shared/header") ?> 49 49 * … … 314 314 * <?= $controller->render(array('partial' =>'account','locals'=>array('account'=>$buyer))); ?> 315 315 * 316 * <? foreach($advertisements as $ad) : ?>316 * <?php foreach($advertisements as $ad) : ?> 317 317 * <?= $controller->render(array('partial'=>'ad','locals'=>array('ad'=>$ad))); ?> 318 * <? endforeach; ?>318 * <?php endforeach; ?> 319 319 * 320 320 * This would first render "advertiser/_account.tpl" with $buyer passed in as the local variable $account, then render trunk/lib/AkActionView/helpers/capture_helper.php
r153 r155 24 24 * == Capturing a block into an instance variable 25 25 * 26 * <? $capture_helper->begin (); ?>26 * <?php $capture_helper->begin (); ?> 27 27 * [some html...] 28 * <? $script = $capture_helper->end (); ?>28 * <?php $script = $capture_helper->end (); ?> 29 29 * 30 30 * … … 52 52 * This page shows an alert box! 53 53 * 54 * <? $capture_helper->begin ('script'); ?>54 * <?php $capture_helper->begin ('script'); ?> 55 55 * alert('hello world'); 56 * <? $capture_helper->end (); ?>56 * <?php $capture_helper->end (); ?> 57 57 * 58 58 * Normal view text … … 68 68 * Example: 69 69 * 70 * <? $capture_helper->begin(); ?>70 * <?php $capture_helper->begin(); ?> 71 71 * Welcome To my shiny new web page! 72 72 * <% $greeting = $capture_helper->end(); ?> … … 104 104 * Example: 105 105 * 106 * <? $capture_helper->content_for('header'); ?>106 * <?php $capture_helper->content_for('header'); ?> 107 107 * alert('hello world'); 108 * <? $capture_helper->end(); ?>108 * <?php $capture_helper->end(); ?> 109 109 * 110 110 * You can use $content_for_header anywhere in your templates. trunk/lib/AkActionView/helpers/form_helper.php
r104 r155 93 93 * values for the fields. Examples: 94 94 * 95 * <? $f = $form_helper->form_for('person', $Person, array('url' => array('action' => 'update'))); ?>95 * <?php $f = $form_helper->form_for('person', $Person, array('url' => array('action' => 'update'))); ?> 96 96 * First name: <?= $f->text_field('first_name'); ?> 97 97 * Last name : <?= $f->text_field('last_name'); ?> … … 112 112 * and methods from FormTagHelper. Example: 113 113 * 114 * <? $f = $form_helper->form_for('person', $Person, array('url' => array('action' => 'update'))); ?>114 * <?php $f = $form_helper->form_for('person', $Person, array('url' => array('action' => 'update'))); ?> 115 115 * First name: <?= $f->text_field('first_name'); ?> 116 116 * Last name : <?= $f->text_field('last_name'); ?> … … 133 133 * fields_for suitable for specifying additional model objects in the same form. Example: 134 134 * 135 * <? $person_form = $this->form_for('person', $Person, array('url' => array('action'=>'update'))); ?>135 * <?php $person_form = $this->form_for('person', $Person, array('url' => array('action'=>'update'))); ?> 136 136 * First name: <?= $person_form->text_field('first_name'); ?> 137 137 * Last name : <?= person_form->text_field('last_name'); ?> 138 138 * 139 * <? $permission_fields = $form_helper->fields_for('permission', $Person->permission); ?>139 * <?php $permission_fields = $form_helper->fields_for('permission', $Person->permission); ?> 140 140 * Admin? : <?= $permission_fields->check_box('admin'); ?> 141 141 * <?= $person_form->end_form_tag(); ?> trunk/script/generators/controller/templates/controller.tpl
r2 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 4 class <? =$class_name?>Controller extends ApplicationController4 class <?php echo $class_name?>Controller extends ApplicationController 5 5 { 6 <? if(!empty($options['scaffold'])) :?>7 var $scaffold = '<? =AkInflector::singularize($class_name)?>';6 <?php if(!empty($options['scaffold'])) :?> 7 var $scaffold = '<?php echo AkInflector::singularize($class_name)?>'; 8 8 <?endif;?> 9 <? foreach ($actions as $action) : ?>9 <?php foreach ($actions as $action) : ?> 10 10 11 function <? =$action?> ()11 function <?php echo $action?> () 12 12 { 13 13 } trunk/script/generators/controller/templates/fixture.tpl
r2 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 require_once(AK_BASE_DIR.DS.'app'.DS.'controllers'.DS.array_shift(array_slice(pathinfo(__FILE__),1,1))); trunk/script/generators/controller/templates/functional_test.tpl
r2 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 require_once(dirname(__FILE__).'/../../fixtures/config/config.php'); 4 require_once(AK_CONTROLLERS_DIR.DS.'<? =AkInflector::underscore($class_name)?>_controller.php');4 require_once(AK_CONTROLLERS_DIR.DS.'<?php echo AkInflector::underscore($class_name)?>_controller.php'); 5 5 6 6 7 class <? =$class_name?>ControllerTest extends UnitTestCase7 class <?php echo $class_name?>ControllerTest extends UnitTestCase 8 8 { 9 function test_<? =$class_name?>()9 function test_<?php echo $class_name?>() 10 10 { 11 $this->assertTrue(false, '<? =$class_name?>Controller has not being tested');11 $this->assertTrue(false, '<?php echo $class_name?>Controller has not being tested'); 12 12 } 13 13 } 14 14 15 15 16 Ak::test('<? =$class_name?>ControllerTest',true);16 Ak::test('<?php echo $class_name?>ControllerTest',true); 17 17 18 18 ?> trunk/script/generators/controller/templates/helper.tpl
r2 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 4 class <? =$class_name?>Helper4 class <?php echo $class_name?>Helper 5 5 { 6 6 } trunk/script/generators/controller/templates/helper_fixture.tpl
r2 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 require_once(AK_BASE_DIR.DS.'app'.DS.'helpers'.DS.array_shift(array_slice(pathinfo(__FILE__),1,1))); trunk/script/generators/controller/templates/view.tpl
r2 r155 1 <h1><? =$class_name?>::<?=$action?></h1>2 <p><? ='<?'?>=translate('Find me in %path',array('%path'=><?=$path?>))?></p>1 <h1><?php echo $class_name?>::<?php echo $action?></h1> 2 <p><?php echo '<?php '?>echo translate('Find me in %path',array('%path'=><?php echo $path?>))?></p> trunk/script/generators/model/templates/installer.tpl
r2 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 class <? =$class_name?>Installer extends AkInstaller3 class <?php echo $class_name?>Installer extends AkInstaller 4 4 { 5 5 function up_1() 6 6 { 7 $this->createTable('<? =$table_name?>', "7 $this->createTable('<?php echo $table_name?>', " 8 8 id integer not null auto increment pk 9 9 "); … … 12 12 function down_1() 13 13 { 14 $this->dropTable('<? =$table_name?>');14 $this->dropTable('<?php echo $table_name?>'); 15 15 } 16 16 trunk/script/generators/model/templates/installer_fixture.tpl
r2 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 require_once(AK_BASE_DIR.DS.'app'.DS.'installers'.DS.array_shift(array_slice(pathinfo(__FILE__),1,1))); trunk/script/generators/model/templates/model.tpl
r2 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 4 class <? =$class_name?> extends ActiveRecord4 class <?php echo $class_name?> extends ActiveRecord 5 5 { 6 6 trunk/script/generators/model/templates/model_fixture.tpl
r2 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 require_once(AK_BASE_DIR.DS.'app'.DS.'models'.DS.array_shift(array_slice(pathinfo(__FILE__),1,1))); trunk/script/generators/model/templates/unit_test.tpl
r2 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 defined('AK_TEST_DATABASE_ON') ? null : define('AK_TEST_DATABASE_ON', true); … … 5 5 require_once(AK_LIB_DIR.DS.'AkActiveRecord.php'); 6 6 require_once(AK_APP_DIR.DS.'shared_model.php'); 7 require_once(AK_MODELS_DIR.DS.'<? =AkInflector::underscore($class_name)?>.php');7 require_once(AK_MODELS_DIR.DS.'<?php echo AkInflector::underscore($class_name)?>.php'); 8 8 9 class <? =$class_name?>Test extends UnitTestCase9 class <?php echo $class_name?>Test extends UnitTestCase 10 10 { 11 11 function test_setup() 12 12 { 13 require_once(AK_APP_DIR.DS.'installers'.DS.'<? =AkInflector::underscore($class_name)?>_installer.php');14 $installer = new <? =$class_name?>Installer();13 require_once(AK_APP_DIR.DS.'installers'.DS.'<?php echo AkInflector::underscore($class_name)?>_installer.php'); 14 $installer = new <?php echo $class_name?>Installer(); 15 15 $installer->uninstall(); 16 16 $installer->install(); 17 17 } 18 18 19 function test_<? =$class_name?>()19 function test_<?php echo $class_name?>() 20 20 { 21 $this->assertTrue(false,'Unit test for <? =$class_name?> not implemented');21 $this->assertTrue(false,'Unit test for <?php echo $class_name?> not implemented'); 22 22 } 23 23 } 24 24 25 25 26 Ak::test('<? =$class_name?>Test',true);26 Ak::test('<?php echo $class_name?>Test',true); 27 27 28 28 ?> trunk/script/generators/scaffold/templates/controller.php
r104 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 4 class <? =$controller_class_name?> extends ApplicationController4 class <?php echo $controller_class_name?> extends ApplicationController 5 5 { 6 6 <?php … … 14 14 } 15 15 16 <? foreach((array)@$actions as $action) :?>17 function <? =$action?>()16 <?php foreach((array)@$actions as $action) :?> 17 function <?php echo $action?>() 18 18 { 19 19 } 20 20 21 <? endforeach; ?>21 <?php endforeach; ?> 22 22 function listing() 23 23 { 24 $this-><? =$singular_name?>_pages = $this->pagination_helper->getPaginator($this-><?=$model_name?>, array('items_per_page' => 10));25 $this-><? =$plural_name?> = $this-><?=$model_name?>->find('all', $this->pagination_helper->getFindOptions($this-><?=$model_name?>));24 $this-><?php echo $singular_name?>_pages = $this->pagination_helper->getPaginator($this-><?php echo $model_name?>, array('items_per_page' => 10)); 25 $this-><?php echo $plural_name?> = $this-><?php echo $model_name?>->find('all', $this->pagination_helper->getFindOptions($this-><?php echo $model_name?>)); 26 26 } 27 27 28 28 function show() 29 29 { 30 $this-><? =$singular_name?> = $this-><?=$model_name?>->find(@$this->params['id']);30 $this-><?php echo $singular_name?> = $this-><?php echo $model_name?>->find(@$this->params['id']); 31 31 } 32 32 33 33 function add() 34 34 { 35 if(!empty($this->params['<? =$singular_name?>'])){36 $this-><? =$model_name?>->setAttributes($this->params['<?=$singular_name?>']);37 if ($this->Request->isPost() && $this-><? =$model_name?>->save()){38 $this->flash['notice'] = $this->t('<? =$model_name?> was successfully created.');39 $this->redirectTo(array('action' => 'show', 'id' => $this-><? =$model_name?>->getId()));35 if(!empty($this->params['<?php echo $singular_name?>'])){ 36 $this-><?php echo $model_name?>->setAttributes($this->params['<?php echo $singular_name?>']); 37 if ($this->Request->isPost() && $this-><?php echo $model_name?>->save()){ 38 $this->flash['notice'] = $this->t('<?php echo $model_name?> was successfully created.'); 39 $this->redirectTo(array('action' => 'show', 'id' => $this-><?php echo $model_name?>->getId())); 40 40 } 41 41 } … … 47 47 $this->redirectToAction('listing'); 48 48 } 49 if(!empty($this->params['<? =$singular_name?>']) && !empty($this->params['id'])){49 if(!empty($this->params['<?php echo $singular_name?>']) && !empty($this->params['id'])){ 50 50 <?php 51 51 if($model_name != $controller_name){ // if equal will be handled by the Akelos directly 52 ?>if(empty($this-><? =$singular_name?>->id) || $this-><?=$singular_name?>->id != $this->params['id'])){53 $this-><? =$singular_name?> =& $this-><?=$model_name?>->find($this->params['id']);52 ?>if(empty($this-><?php echo $singular_name?>->id) || $this-><?php echo $singular_name?>->id != $this->params['id'])){ 53 $this-><?php echo $singular_name?> =& $this-><?php echo $model_name?>->find($this->params['id']); 54 54 }<?php 55 55 } 56 56 ?> 57 $this-><? =$singular_name?>->setAttributes($this->params['<?=$singular_name?>']);58 if($this->Request->isPost() && $this-><? =$singular_name?>->save()){59 $this->flash['notice'] = $this->t('<? =$model_name?> was successfully updated.');60 $this->redirectTo(array('action' => 'show', 'id' => $this-><? =$singular_name?>->getId()));57 $this-><?php echo $singular_name?>->setAttributes($this->params['<?php echo $singular_name?>']); 58 if($this->Request->isPost() && $this-><?php echo $singular_name?>->save()){ 59 $this->flash['notice'] = $this->t('<?php echo $model_name?> was successfully updated.'); 60 $this->redirectTo(array('action' => 'show', 'id' => $this-><?php echo $singular_name?>->getId())); 61 61 } 62 62 } … … 66 66 { 67 67 if(!empty($this->params['id'])){ 68 $this-><? =$singular_name?> = $this-><?=$model_name?>->find($this->params['id']);68 $this-><?php echo $singular_name?> = $this-><?php echo $model_name?>->find($this->params['id']); 69 69 if($this->Request->isPost()){ 70 $this-><? =$singular_name?>->destroy();70 $this-><?php echo $singular_name?>->destroy(); 71 71 $this->redirectTo(array('action' => 'listing')); 72 72 } trunk/script/generators/scaffold/templates/form.tpl
r71 r155 1 <? ='<?='?>$active_record_helper->error_messages_for('<?=$singular_name?>');?>1 <?php echo '<?php echo '?>$active_record_helper->error_messages_for('<?php echo $singular_name?>');?> 2 2 3 <? if(empty($content_columns)) : ?>4 <? ='<?='?>$active_record_helper->all_input_tags($<?=$model_name?>, '<?=$singular_name?>', array()) ?>5 <? else :3 <?php if(empty($content_columns)) : ?> 4 <?php echo '<?php echo '?>$active_record_helper->all_input_tags($<?php echo $model_name?>, '<?php echo $singular_name?>', array()) ?> 5 <?php else : 6 6 foreach ($content_columns as $column=>$details){ 7 7 echo " … … 10 10 AkInflector::humanize($details['name']). 11 11 "}</label><br /> 12 <? =\$active_record_helper->input('$singular_name', '$column')?>12 <?php echo \$active_record_helper->input('$singular_name', '$column')?> 13 13 </p> 14 14 "; trunk/script/generators/scaffold/templates/form_scaffolding.tpl
r2 r155 1 <? ='<?='?>$active_record_helper->all_input_tags($<?=$model_name?>, '<?=$singular_name?>', array()) ?>1 <?php echo '<?php echo '?>$active_record_helper->all_input_tags($<?php echo $model_name?>, '<?php echo $singular_name?>', array()) ?> trunk/script/generators/scaffold/templates/helper.php
r2 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 4 class <? =$controller_name?>Helper extends AkActionViewHelper4 class <?php echo $controller_name?>Helper extends AkActionViewHelper 5 5 { 6 6 function cancel($url = array('action' => 'listing')) trunk/script/generators/scaffold/templates/installer.tpl
r142 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 /** 4 * This is the <? =$model_name?> Installer. And installer allows you to perform4 * This is the <?php echo $model_name?> Installer. And installer allows you to perform 5 5 * database migrations in the same way your file versions are managed by subversion. 6 6 * … … 9 9 * Once you've added the database structure, you just need to call 10 10 * 11 * ./script/migrate <? =$model_name?> install11 * ./script/migrate <?php echo $model_name?> install 12 12 * 13 13 * And your database will be upgraded to the latest revision 14 14 */ 15 class <? =$model_name?>Installer extends AkInstaller15 class <?php echo $model_name?>Installer extends AkInstaller 16 16 { 17 17 function up_1() 18 18 { 19 $this->createTable('<? =$plural_name?>', "19 $this->createTable('<?php echo $plural_name?>', " 20 20 id, 21 21 name, … … 28 28 function down_1() 29 29 { 30 $this->dropTable('<? =$plural_name?>');30 $this->dropTable('<?php echo $plural_name?>'); 31 31 } 32 32 trunk/script/generators/scaffold/templates/installer_fixture.tpl
r98 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 require_once(AK_BASE_DIR.DS.'app'.DS.'installers'.DS.array_shift(array_slice(pathinfo(__FILE__),1,1))); trunk/script/generators/scaffold/templates/layout.tpl
r109 r155 3 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 4 <head> 5 <title><? ='<?='?>$text_helper->translate('<?= $controller_human_name ?>',array(),'layout');?>: <?='<?='?> $text_helper->translate($controller->getActionName(),array(),'layout');?></title>5 <title><?php echo '<?php echo '?>$text_helper->translate('<?php echo $controller_human_name ?>',array(),'layout');?>: <?php echo '<?php echo '?> $text_helper->translate($controller->getActionName(),array(),'layout');?></title> 6 6 <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> 7 <? ='<?='?> $asset_tag_helper->stylesheet_link_tag('scaffold') ?>7 <?php echo '<?php echo '?> $asset_tag_helper->stylesheet_link_tag('scaffold') ?> 8 8 </head> 9 9 <body> 10 10 {?flash-notice}<div class="flash_notice">{flash-notice}</div>{end} 11 <? ='<?='?> $content_for_layout ?>11 <?php echo '<?php echo '?> $content_for_layout ?> 12 12 </body> 13 13 </html> trunk/script/generators/scaffold/templates/model.tpl
r2 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 4 class <? =$model_name?> extends ActiveRecord4 class <?php echo $model_name?> extends ActiveRecord 5 5 { 6 6 trunk/script/generators/scaffold/templates/model_fixture.tpl
r98 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 require_once(AK_BASE_DIR.DS.'app'.DS.'models'.DS.array_shift(array_slice(pathinfo(__FILE__),1,1))); trunk/script/generators/scaffold/templates/model_unit_test.tpl
r98 r155 1 <? ='<?php'?>1 <?php echo '<?php'?> 2 2 3 3 defined('AK_TEST_DATABASE_ON') ? null : define('AK_TEST_DATABASE_ON', true); … … 5 5 require_once(AK_LIB_DIR.DS.'AkActiveRecord.php'); 6 6 require_once(AK_APP_DIR.DS.'shared_model.php'); 7 require_once(AK_MODELS_DIR.DS.'<? =$singular_name?>.php');7 require_once(AK_MODELS_DIR.DS.'<?php echo $singular_name?>.php'); 8 8 9 class <? =$model_name?>Test extends AkUnitTest9 class <?php echo $model_name?>Test extends AkUnitTest 10 10 { 11 11 function test_setup() 12 12 { 13 require_once(AK_APP_DIR.DS.'installers'.DS.'<? =$singular_name?>_installer.php');14 $installer = new <? =$model_name?>Installer();13 require_once(AK_APP_DIR.DS.'installers'.DS.'<?php echo $singular_name?>_installer.php'); 14 $installer = new <?php echo $model_name?>Installer(); 15 15 $installer->uninstall(); 16 16 $installer->install(); 17 17 } 18 18 19 function test_<? =$model_name?>()19 function test_<?php echo $model_name?>() 20 20 { 21 $this->assertTrue(false,'Unit test for <? =$model_name?> not implemented');21 $this->assertTrue(false,'Unit test for <?php echo $model_name?> not implemented'); 22 22 } 23 23 } 24 24 25 25 26 Ak::test('<? =$model_name?>Test',true);26 Ak::test('<?php echo $model_name?>Test',true); 27 27 28 28 ?> trunk/script/generators/scaffold/templates/view_add.tpl
r2 r155 2 2 <h1>_{Tasks}:</h1> 3 3 <ul> 4 <li><? ='<?='?>$url_helper->link_to($text_helper->translate('Back to overview'), array('action' => 'listing'))?></li>4 <li><?php echo '<?php echo '?>$url_helper->link_to($text_helper->translate('Back to overview'), array('action' => 'listing'))?></li> 5 5 </ul> 6 6 </div> 7 7 8 8 <div id="content"> 9 <h1>_{<? =AkInflector::humanize($plural_name)?>}</h1>9 <h1>_{<?php echo AkInflector::humanize($plural_name)?>}</h1> 10 10 11 <? ='<?='?> $form_tag_helper->start_form_tag(array('action'=>'add')) ?>11 <?php echo '<?php echo '?> $form_tag_helper->start_form_tag(array('action'=>'add')) ?> 12 12 13 13 <div class="form"> 14 <h2>_{Creating <? =AkInflector::humanize($singular_name)?>}</h2>15 <? ='<?='?> $controller->renderPartial('form') ?>14 <h2>_{Creating <?php echo AkInflector::humanize($singular_name)?>}</h2> 15 <?php echo '<?php echo '?> $controller->renderPartial('form') ?> 16 16 </div> 17 17 18 18 <div id="operations"> 19 <? ='<?='.$helper_var_name?>->save() ?> <?='<?='.$helper_var_name?>->cancel()?>19 <?php echo '<?php echo '.$helper_var_name?>->save() ?> <?php echo '<?php echo '.$helper_var_name?>->cancel()?> 20 20 </div> 21 21 22 <? ='<?='?> $form_tag_helper->end_form_tag() ?>22 <?php echo '<?php echo '?> $form_tag_helper->end_form_tag() ?> 23 23 </div> trunk/script/generators/scaffold/templates/view_destroy.tpl
r2 r155 2 2 <h1>_{Tasks}:</h1> 3 3 <ul> 4 <li><? ='<?='?>$url_helper->link_to($text_helper->translate('Back to overview'), array('action' => 'listing'))?></li>5 <li><? ='<?= '?>$url_helper->link_to($text_helper->translate('Show this <?=AkInflector::humanize($singular_name)?>'), array('action' => 'show', 'id'=>$<?=$singular_name?>->getId()))?></li>4 <li><?php echo '<?php echo '?>$url_helper->link_to($text_helper->translate('Back to overview'), array('action' => 'listing'))?></li> 5 <li><?php echo '<?php echo '?>$url_helper->link_to($text_helper->translate('Show this <?php echo AkInflector::humanize($singular_name)?>'), array('action' => 'show', 'id'=>$<?php echo $singular_name?>->getId()))?></li> 6 6 </ul> 7 7 </div> … … 9 9 10 10 <div id="content"> 11 <h1>_{<? =AkInflector::humanize($plural_name)?>}</h1>11 <h1>_{<?php echo AkInflector::humanize($plural_name)?>}</h1> 12 12 13 <p>_{Are you sure you want to delete this <? =AkInflector::humanize($singular_name)?>?}</p>14 <? ='<?='?> $form_tag_helper->start_form_tag(array('action' => 'destroy', 'id' => $<?=$singular_name ?>->getId())) ?>15 <? ='<?='.$helper_var_name?>->confirm_delete() ?>16 <? ='<?='?> $form_tag_helper->end_form_tag() ?>13 <p>_{Are you sure you want to delete this <?php echo AkInflector::humanize($singular_name)?>?}</p> 14 <?php echo '<?php echo '?> $form_tag_helper->start_form_tag(array('action' => 'destroy', 'id' => $<?php echo $singular_name ?>->getId())) ?> 15 <?php echo '<?php echo '.$helper_var_name?>->confirm_delete() ?> 16 <?php echo '<?php echo '?> $form_tag_helper->end_form_tag() ?> 17 17 </div> trunk/script/generators/scaffold/templates/view_edit.tpl
r2 r155 2 2 <h1>_{Tasks}:</h1> 3 3 <ul> 4 <li><? ='<?='?>$url_helper->link_to($text_helper->translate('Back to overview'), array('action' => 'listing'))?></li>5 <li><? ='<?= '?>$url_helper->link_to($text_helper->translate('Show this <?=AkInflector::humanize($singular_name)?>'), array('action' => 'show', 'id'=>$<?=$singular_name?>->getId()))?></li>4 <li><?php echo '<?php echo '?>$url_helper->link_to($text_helper->translate('Back to overview'), array('action' => 'listing'))?></li> 5 <li><?php echo '<?php echo '?>$url_helper->link_to($text_helper->translate('Show this <?php echo AkInflector::humanize($singular_name)?>'), array('action' => 'show', 'id'=>$<?php echo $singular_name?>->getId()))?></li> 6 6 </ul> 7 7 </div> 8 8 9 9 <div id="content"> 10 <h1>_{<? =AkInflector::humanize($plural_name)?>}</h1>10 <h1>_{<?php echo AkInflector::humanize($plural_name)?>}</h1> 11 11 12 <? ='<?='?> $form_tag_helper->start_form_tag(array('action'=>'edit', 'id' => $<?=$singular_name?>->getId())) ?>12 <?php echo '<?php echo '?> $form_tag_helper->start_form_tag(array('action'=>'edit', 'id' => $<?php echo $singular_name?>->getId())) ?> 13 13 14 14 <div class="form"> 15 <h2>_{Editing <? =AkInflector::humanize($singular_name)?>}</h2>16 <? ='<?='?> $controller->renderPartial('form') ?>15 <h2>_{Editing <?php echo AkInflector::humanize($singular_name)?>}</h2> 16 <?php echo '<?php echo '?> $controller->renderPartial('form') ?> 17 17 </div> 18 18 19 19 <div id="operations"> 20 <? ='<?='.$helper_var_name?>->save() ?> <?='<?='.$helper_var_name?>->cancel()?>20 <?php echo '<?php echo '.$helper_var_name?>->save() ?> <?php echo '<?php echo '.$helper_var_name?>->cancel()?> 21 21 </div> 22 22 23 <? ='<?='?> $form_tag_helper->end_form_tag() ?>23 <?php echo '<?php echo '?> $form_tag_helper->end_form_tag() ?> 24 24 </div> trunk/script/generators/scaffold/templates/view_listing.tpl
r142 r155 2 2 <h1>_{Tasks}:</h1> 3 3 <ul> 4 <li><? ='<?= '?>$url_helper->link_to($text_helper->translate('Create new <?=AkInflector::humanize($singular_name)?>'), array('action' => 'add'))?></li>4 <li><?php echo '<?php echo '?>$url_helper->link_to($text_helper->translate('Create new <?php echo AkInflector::humanize($singular_name)?>'), array('action' => 'add'))?></li> 5 5 </ul> 6 6 </div> 7 7 8 8 <div id="content"> 9 <h1>_{<? =AkInflector::humanize($plural_name)?>}</h1>9 <h1>_{<?php echo AkInflector::humanize($plural_name)?>}</h1> 10 10 11 {?<? =$plural_name?>}11 {?<?php echo $plural_name?>} 12 12 <div class="listing"> 13 <table cellspacing="0" summary="_{Listing available <? =AkInflector::humanize($plural_name)?>}">13 <table cellspacing="0" summary="_{Listing available <?php echo AkInflector::humanize($plural_name)?>}"> 14 14 15 15 <tr> 16 <? ='<? '?>$content_columns = array_keys($<?=$model_name?>->getContentColumns()); ?>16 <?php echo '<?php '?>$content_columns = array_keys($<?php echo $model_name?>->getContentColumns()); ?> 17 17 {loop content_columns} 18 <th scope="col"><? ='<?='?>$pagination_helper->sortable_link($content_column) ?></th>18 <th scope="col"><?php echo '<?php echo '?>$pagination_helper->sortable_link($content_column) ?></th> 19 19 {end} 20 20 <th colspan="3" scope="col"><span class="auraltext">_{Item actions}</span></th> 21 21 </tr> 22 22 23 {loop <? =$plural_name?>}24 <tr {?<? =$singular_name?>_odd_position}class="odd"{end}>23 {loop <?php echo $plural_name?>} 24 <tr {?<?php echo $singular_name?>_odd_position}class="odd"{end}> 25 25 {loop content_columns} 26 <td class="field"><? ='<?= '?>$<?=$singular_name?>->get($content_column) ?></td>26 <td class="field"><?php echo '<?php echo '?>$<?php echo $singular_name?>->get($content_column) ?></td> 27 27 {end} 28 <td class="operation"><? ='<?= '.$helper_var_name?>->link_to_show($<?=$singular_name?>)?></td>29 <td class="operation"><? ='<?= '.$helper_var_name?>->link_to_edit($<?=$singular_name?>)?></td>30 <td class="operation"><? ='<?= '.$helper_var_name?>->link_to_destroy($<?=$singular_name?>)?></td>28 <td class="operation"><?php echo '<?php echo '.$helper_var_name?>->link_to_show($<?php echo $singular_name?>)?></td> 29 <td class="operation"><?php echo '<?php echo '.$helper_var_name?>->link_to_edit($<?php echo $singular_name?>)?></td> 30 <td class="operation"><?php echo '<?php echo '.$helper_var_name?>->link_to_destroy($<?php echo $singular_name?>)?></td> 31 31 </tr> 32 32 {end} … … 35 35 {end} 36 36 37 {?<? =$singular_name?>_pages.links}38
