Changeset 155

Show
Ignore:
Timestamp:
03/27/07 03:22:33 (2 years ago)
Author:
bermiferrer
Message:

Avoiding the usage of PHP short tags in generator templates.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/AkActionController.php

    r153 r155  
    441441    *  
    442442    * * 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'?>" )); 
    444444    *  
    445445    * * 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'))); 
    447447    *  
    448448    *  
     
    10321032    * to isolate changes in repeated setups. The inclusion pattern has pages that look like this: 
    10331033    * 
    1034     *   <?= $controller->render('shared/header') ?> 
     1034    *   <?php echo $controller->render('shared/header') ?> 
    10351035    *   Hello World 
    1036     *   <?= $controller->render('shared/footer') ?> 
     1036    *   <?php echo $controller->render('shared/footer') ?> 
    10371037    * 
    10381038    * This approach is a decent way of keeping common structures isolated from the  
     
    10451045    * 
    10461046    *   <!-- The header part of this layout --> 
    1047     *   <?= $content_for_layout ?> 
     1047    *   <?php echo $content_for_layout ?> 
    10481048    *   <!-- The footer part of this layout --> 
    10491049    * 
     
    10661066    * rendering time: 
    10671067    * 
    1068     *   <h1><?= $page_title ?></h1> 
    1069     *   <?= $content_for_layout ?> 
     1068    *   <h1><?php echo $page_title ?></h1> 
     1069    *   <?php echo $content_for_layout ?> 
    10701070    * 
    10711071    * ...and content pages that fulfill these references _at_ rendering time: 
    10721072    * 
    1073     *    <? $page_title = 'Welcome'; ?> 
     1073    *    <?php $page_title = 'Welcome'; ?> 
    10741074    *    Off-world colonies offers you a chance to start a new life 
    10751075    * 
     
    12011201    * If a layout is specified, all actions rendered through render and render_action will have their result assigned  
    12021202    * 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 action 
     1203    * <tt><?php echo $$this->content_for_layout ?></tt>. This layout can itself depend on instance variables assigned during action 
    12041204    * performance and have access to them as any normal template would. 
    12051205    */ 
     
    18821882    * 
    18831883    *   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; ?> 
    18851885    * 
    18861886    * 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  
    2626* 
    2727*   <b>Names of all the people</b> 
    28 *   <? foreach($people as $person) : ?> 
     28*   <?php foreach($people as $person) : ?> 
    2929*   Name: <?=$person->name ?><br/> 
    30 *   <? endforeach ?> 
     30*   <?php endforeach ?> 
    3131* 
    3232* == Using sub templates 
     
    4545* variables defined using the regular embedding tags. Like this: 
    4646* 
    47 *   <? $shared->page_title = "A Wonderful Hello" ?> 
     47*   <?php $shared->page_title = "A Wonderful Hello" ?> 
    4848*   <?= $controller->render("shared/header") ?> 
    4949* 
     
    314314    *    <?= $controller->render(array('partial' =>'account','locals'=>array('account'=>$buyer)));  ?> 
    315315    *  
    316     *    <? foreach($advertisements as $ad) : ?> 
     316    *    <?php foreach($advertisements as $ad) : ?> 
    317317    *      <?= $controller->render(array('partial'=>'ad','locals'=>array('ad'=>$ad))); ?> 
    318     *    <? endforeach; ?> 
     318    *    <?php endforeach; ?> 
    319319    *  
    320320    *  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  
    2424* == Capturing a block into an instance variable 
    2525* 
    26 *   <? $capture_helper->begin (); ?> 
     26*   <?php $capture_helper->begin (); ?> 
    2727*     [some html...] 
    28 *   <? $script = $capture_helper->end (); ?> 
     28*   <?php $script = $capture_helper->end (); ?> 
    2929 
    3030* 
     
    5252*   This page shows an alert box! 
    5353* 
    54 *   <? $capture_helper->begin ('script'); ?> 
     54*   <?php $capture_helper->begin ('script'); ?> 
    5555*     alert('hello world'); 
    56 *   <? $capture_helper->end (); ?> 
     56*   <?php $capture_helper->end (); ?> 
    5757* 
    5858*   Normal view text 
     
    6868     * Example: 
    6969     *  
    70      *   <? $capture_helper->begin(); ?> 
     70     *   <?php $capture_helper->begin(); ?> 
    7171     *     Welcome To my shiny new web page! 
    7272     *   <% $greeting = $capture_helper->end(); ?>       
     
    104104    * Example: 
    105105    *  
    106     *   <? $capture_helper->content_for('header'); ?> 
     106    *   <?php $capture_helper->content_for('header'); ?> 
    107107    *     alert('hello world'); 
    108     *   <? $capture_helper->end(); ?> 
     108    *   <?php $capture_helper->end(); ?> 
    109109    * 
    110110    * You can use $content_for_header anywhere in your templates. 
  • trunk/lib/AkActionView/helpers/form_helper.php

    r104 r155  
    9393      * values for the fields. Examples: 
    9494      * 
    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'))); ?> 
    9696      *     First name: <?= $f->text_field('first_name'); ?> 
    9797      *     Last name : <?= $f->text_field('last_name'); ?> 
     
    112112      * and methods from FormTagHelper. Example: 
    113113      * 
    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'))); ?> 
    115115      *     First name: <?= $f->text_field('first_name'); ?> 
    116116      *     Last name : <?= $f->text_field('last_name'); ?> 
     
    133133      * fields_for suitable for specifying additional model objects in the same form. Example: 
    134134      * 
    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'))); ?> 
    136136      *     First name: <?= $person_form->text_field('first_name'); ?> 
    137137      *     Last name : <?= person_form->text_field('last_name'); ?> 
    138138      *      
    139       *     <? $permission_fields = $form_helper->fields_for('permission', $Person->permission); ?> 
     139      *     <?php $permission_fields = $form_helper->fields_for('permission', $Person->permission); ?> 
    140140      *       Admin?  : <?= $permission_fields->check_box('admin'); ?> 
    141141      *   <?= $person_form->end_form_tag(); ?> 
  • trunk/script/generators/controller/templates/controller.tpl

    r2 r155  
    1 <?='<?php'?> 
     1<?php  echo '<?php'?> 
    22 
    33 
    4 class <?=$class_name?>Controller extends ApplicationController 
     4class <?php  echo $class_name?>Controller extends ApplicationController 
    55{ 
    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)?>'; 
    88<?endif;?> 
    9 <? foreach ($actions as $action) : ?> 
     9<?php  foreach ($actions as $action) : ?> 
    1010 
    11     function <?=$action?> () 
     11    function <?php  echo $action?> () 
    1212    { 
    1313    } 
  • trunk/script/generators/controller/templates/fixture.tpl

    r2 r155  
    1 <?='<?php'?> 
     1<?php  echo '<?php'?> 
    22 
    33require_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'?> 
    22 
    33require_once(dirname(__FILE__).'/../../fixtures/config/config.php'); 
    4 require_once(AK_CONTROLLERS_DIR.DS.'<?=AkInflector::underscore($class_name)?>_controller.php'); 
     4require_once(AK_CONTROLLERS_DIR.DS.'<?php  echo AkInflector::underscore($class_name)?>_controller.php'); 
    55 
    66 
    7 class <?=$class_name?>ControllerTest extends  UnitTestCase 
     7class <?php  echo $class_name?>ControllerTest extends  UnitTestCase 
    88{ 
    9     function test_<?=$class_name?>() 
     9    function test_<?php  echo $class_name?>() 
    1010    { 
    11         $this->assertTrue(false, '<?=$class_name?>Controller has not being tested'); 
     11        $this->assertTrue(false, '<?php  echo $class_name?>Controller has not being tested'); 
    1212    } 
    1313} 
    1414 
    1515 
    16 Ak::test('<?=$class_name?>ControllerTest',true); 
     16Ak::test('<?php  echo $class_name?>ControllerTest',true); 
    1717 
    1818?> 
  • trunk/script/generators/controller/templates/helper.tpl

    r2 r155  
    1 <?='<?php'?> 
     1<?php  echo '<?php'?> 
    22 
    33 
    4 class <?=$class_name?>Helper 
     4class <?php  echo $class_name?>Helper 
    55{ 
    66} 
  • trunk/script/generators/controller/templates/helper_fixture.tpl

    r2 r155  
    1 <?='<?php'?> 
     1<?php  echo '<?php'?> 
    22 
    33require_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'?> 
    22 
    3 class <?=$class_name?>Installer extends AkInstaller 
     3class <?php  echo $class_name?>Installer extends AkInstaller 
    44{ 
    55    function up_1() 
    66    { 
    7         $this->createTable('<?=$table_name?>', " 
     7        $this->createTable('<?php  echo $table_name?>', " 
    88          id integer not null auto increment pk 
    99        ");   
     
    1212    function down_1() 
    1313    { 
    14         $this->dropTable('<?=$table_name?>');   
     14        $this->dropTable('<?php  echo $table_name?>');   
    1515    } 
    1616     
  • trunk/script/generators/model/templates/installer_fixture.tpl

    r2 r155  
    1 <?='<?php'?> 
     1<?php  echo '<?php'?> 
    22 
    33require_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'?> 
    22 
    33 
    4 class <?=$class_name?> extends ActiveRecord 
     4class <?php  echo $class_name?> extends ActiveRecord 
    55{ 
    66 
  • trunk/script/generators/model/templates/model_fixture.tpl

    r2 r155  
    1 <?='<?php'?> 
     1<?php  echo '<?php'?> 
    22 
    33require_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'?> 
    22 
    33defined('AK_TEST_DATABASE_ON') ? null : define('AK_TEST_DATABASE_ON', true); 
     
    55require_once(AK_LIB_DIR.DS.'AkActiveRecord.php'); 
    66require_once(AK_APP_DIR.DS.'shared_model.php'); 
    7 require_once(AK_MODELS_DIR.DS.'<?=AkInflector::underscore($class_name)?>.php'); 
     7require_once(AK_MODELS_DIR.DS.'<?php  echo AkInflector::underscore($class_name)?>.php'); 
    88 
    9 class <?=$class_name?>Test extends  UnitTestCase 
     9class <?php  echo $class_name?>Test extends  UnitTestCase 
    1010{ 
    1111    function test_setup() 
    1212    { 
    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(); 
    1515        $installer->uninstall(); 
    1616        $installer->install();     
    1717    } 
    1818     
    19     function test_<?=$class_name?>() 
     19    function test_<?php  echo $class_name?>() 
    2020    { 
    21         $this->assertTrue(false,'Unit test for <?=$class_name?> not implemented'); 
     21        $this->assertTrue(false,'Unit test for <?php  echo $class_name?> not implemented'); 
    2222    } 
    2323} 
    2424 
    2525 
    26 Ak::test('<?=$class_name?>Test',true); 
     26Ak::test('<?php  echo $class_name?>Test',true); 
    2727 
    2828?> 
  • trunk/script/generators/scaffold/templates/controller.php

    r104 r155  
    1 <?='<?php'?> 
     1<?php echo '<?php'?> 
    22 
    33 
    4 class <?=$controller_class_name?> extends ApplicationController 
     4class <?php echo $controller_class_name?> extends ApplicationController 
    55{ 
    66<?php  
     
    1414    } 
    1515 
    16 <? foreach((array)@$actions as $action) :?> 
    17     function <?=$action?>() 
     16<?php foreach((array)@$actions as $action) :?> 
     17    function <?php echo $action?>() 
    1818    { 
    1919    } 
    2020 
    21 <? endforeach; ?> 
     21<?php endforeach; ?> 
    2222    function listing() 
    2323    { 
    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?>)); 
    2626    } 
    2727 
    2828    function show() 
    2929    { 
    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']); 
    3131    } 
    3232 
    3333    function add() 
    3434    { 
    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())); 
    4040            } 
    4141        } 
     
    4747         $this->redirectToAction('listing'); 
    4848        } 
    49         if(!empty($this->params['<?=$singular_name?>']) && !empty($this->params['id'])){ 
     49        if(!empty($this->params['<?php echo $singular_name?>']) && !empty($this->params['id'])){ 
    5050            <?php  
    5151            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']); 
    5454                }<?php 
    5555            } 
    5656            ?> 
    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())); 
    6161            } 
    6262        } 
     
    6666    { 
    6767        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']); 
    6969            if($this->Request->isPost()){ 
    70                 $this-><?=$singular_name?>->destroy(); 
     70                $this-><?php echo $singular_name?>->destroy(); 
    7171                $this->redirectTo(array('action' => 'listing')); 
    7272            } 
  • 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?>');?> 
    22 
    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 :  
    66        foreach ($content_columns as $column=>$details){ 
    77            echo " 
     
    1010            AkInflector::humanize($details['name']). 
    1111            "}</label><br /> 
    12         <?=\$active_record_helper->input('$singular_name', '$column')?> 
     12        <?php  echo \$active_record_helper->input('$singular_name', '$column')?> 
    1313    </p> 
    1414"; 
  • 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'?> 
    22 
    33 
    4 class <?=$controller_name?>Helper extends AkActionViewHelper 
     4class <?php  echo $controller_name?>Helper extends AkActionViewHelper 
    55{  
    66    function cancel($url = array('action' => 'listing')) 
  • trunk/script/generators/scaffold/templates/installer.tpl

    r142 r155  
    1 <?='<?php'?> 
     1<?php  echo '<?php'?> 
    22 
    33/** 
    4 * This is the <?=$model_name?> Installer. And installer allows you to perform 
     4* This is the <?php  echo $model_name?> Installer. And installer allows you to perform 
    55* database migrations in the same way your file versions are managed by subversion. 
    66* 
     
    99* Once you've added the database structure, you just need to call 
    1010* 
    11 * ./script/migrate <?=$model_name?> install 
     11* ./script/migrate <?php  echo $model_name?> install 
    1212* 
    1313* And your database will be upgraded to the latest revision 
    1414*/ 
    15 class <?=$model_name?>Installer extends AkInstaller 
     15class <?php  echo $model_name?>Installer extends AkInstaller 
    1616{ 
    1717    function up_1() 
    1818    { 
    19         $this->createTable('<?=$plural_name?>', " 
     19        $this->createTable('<?php  echo $plural_name?>', " 
    2020          id, 
    2121          name, 
     
    2828    function down_1() 
    2929    { 
    30         $this->dropTable('<?=$plural_name?>');   
     30        $this->dropTable('<?php  echo $plural_name?>');   
    3131    } 
    3232     
  • trunk/script/generators/scaffold/templates/installer_fixture.tpl

    r98 r155  
    1 <?='<?php'?> 
     1<?php  echo '<?php'?> 
    22 
    33require_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  
    33<html xmlns="http://www.w3.org/1999/xhtml"> 
    44 <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> 
    66  <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') ?> 
    88 </head> 
    99 <body> 
    1010 {?flash-notice}<div class="flash_notice">{flash-notice}</div>{end} 
    11   <?='<?='?> $content_for_layout ?> 
     11  <?php  echo '<?php  echo '?> $content_for_layout ?> 
    1212 </body> 
    1313</html> 
  • trunk/script/generators/scaffold/templates/model.tpl

    r2 r155  
    1 <?='<?php'?> 
     1<?php  echo '<?php'?> 
    22 
    33 
    4 class <?=$model_name?> extends ActiveRecord 
     4class <?php  echo $model_name?> extends ActiveRecord 
    55{ 
    66 
  • trunk/script/generators/scaffold/templates/model_fixture.tpl

    r98 r155  
    1 <?='<?php'?> 
     1<?php  echo '<?php'?> 
    22 
    33require_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'?> 
    22 
    33defined('AK_TEST_DATABASE_ON') ? null : define('AK_TEST_DATABASE_ON', true); 
     
    55require_once(AK_LIB_DIR.DS.'AkActiveRecord.php'); 
    66require_once(AK_APP_DIR.DS.'shared_model.php'); 
    7 require_once(AK_MODELS_DIR.DS.'<?=$singular_name?>.php'); 
     7require_once(AK_MODELS_DIR.DS.'<?php  echo $singular_name?>.php'); 
    88 
    9 class <?=$model_name?>Test extends  AkUnitTest 
     9class <?php  echo $model_name?>Test extends  AkUnitTest 
    1010{ 
    1111    function test_setup() 
    1212    { 
    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(); 
    1515        $installer->uninstall(); 
    1616        $installer->install();     
    1717    } 
    1818     
    19     function test_<?=$model_name?>() 
     19    function test_<?php  echo $model_name?>() 
    2020    { 
    21         $this->assertTrue(false,'Unit test for <?=$model_name?> not implemented'); 
     21        $this->assertTrue(false,'Unit test for <?php  echo $model_name?> not implemented'); 
    2222    } 
    2323} 
    2424 
    2525 
    26 Ak::test('<?=$model_name?>Test',true); 
     26Ak::test('<?php  echo $model_name?>Test',true); 
    2727 
    2828?> 
  • trunk/script/generators/scaffold/templates/view_add.tpl

    r2 r155  
    22  <h1>_{Tasks}:</h1> 
    33  <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> 
    55  </ul>  
    66</div> 
    77 
    88<div id="content"> 
    9   <h1>_{<?=AkInflector::humanize($plural_name)?>}</h1> 
     9  <h1>_{<?php  echo AkInflector::humanize($plural_name)?>}</h1> 
    1010   
    11   <?='<?='?> $form_tag_helper->start_form_tag(array('action'=>'add')) ?> 
     11  <?php  echo '<?php  echo '?> $form_tag_helper->start_form_tag(array('action'=>'add')) ?> 
    1212 
    1313  <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') ?> 
    1616  </div> 
    1717 
    1818  <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()?> 
    2020  </div> 
    2121 
    22   <?='<?='?> $form_tag_helper->end_form_tag() ?> 
     22  <?php  echo '<?php  echo '?> $form_tag_helper->end_form_tag() ?> 
    2323</div> 
  • trunk/script/generators/scaffold/templates/view_destroy.tpl

    r2 r155  
    22  <h1>_{Tasks}:</h1> 
    33  <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> 
    66  </ul>  
    77</div> 
     
    99 
    1010<div id="content"> 
    11   <h1>_{<?=AkInflector::humanize($plural_name)?>}</h1> 
     11  <h1>_{<?php  echo AkInflector::humanize($plural_name)?>}</h1> 
    1212 
    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() ?> 
    1717</div> 
  • trunk/script/generators/scaffold/templates/view_edit.tpl

    r2 r155  
    22  <h1>_{Tasks}:</h1> 
    33  <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> 
    66  </ul>  
    77</div> 
    88 
    99<div id="content"> 
    10   <h1>_{<?=AkInflector::humanize($plural_name)?>}</h1> 
     10  <h1>_{<?php  echo AkInflector::humanize($plural_name)?>}</h1> 
    1111 
    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())) ?> 
    1313 
    1414  <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') ?> 
    1717  </div> 
    1818 
    1919  <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()?> 
    2121  </div> 
    2222 
    23   <?='<?='?> $form_tag_helper->end_form_tag() ?> 
     23  <?php  echo '<?php  echo '?> $form_tag_helper->end_form_tag() ?> 
    2424</div> 
  • trunk/script/generators/scaffold/templates/view_listing.tpl

    r142 r155  
    22  <h1>_{Tasks}:</h1> 
    33  <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> 
    55  </ul>  
    66</div> 
    77 
    88<div id="content"> 
    9   <h1>_{<?=AkInflector::humanize($plural_name)?>}</h1> 
     9  <h1>_{<?php  echo AkInflector::humanize($plural_name)?>}</h1> 
    1010 
    11   {?<?=$plural_name?>} 
     11  {?<?php  echo $plural_name?>} 
    1212  <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)?>}"> 
    1414 
    1515  <tr> 
    16     <?='<? '?>$content_columns = array_keys($<?=$model_name?>->getContentColumns()); ?> 
     16    <?php  echo '<?php  '?>$content_columns = array_keys($<?php  echo $model_name?>->getContentColumns()); ?> 
    1717    {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> 
    1919    {end} 
    2020    <th colspan="3" scope="col"><span class="auraltext">_{Item actions}</span></th> 
    2121  </tr> 
    2222 
    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}> 
    2525    {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> 
    2727    {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>     
    3131    </tr> 
    3232  {end} 
     
    3535  {end} 
    3636   
    37     {?<?=$singular_name?>_pages.links} 
    38