Hi All,
 
If I have view script like this
xxxx.phtml
-------------------
// other xxxx code
 
// --- code that will be used on several view scripts
   <? if(!empty($this->data)): ?>   
    <? foreach($this->data as $v):?>
     <div class="span-17 list-project">
      <span class="pr-title"><?= $v->title ?></span><br />
      <span class="pr-by">Proposed By <?= ucwords($v->cby) ?></span><br />
      <span class="pr-time">Time : <?= $v->cbo ?></span>
      <div class="span-9 pr-desc"><?= $v->description ?></div>
      <div class="span-9 pr-desc"><?= $v->target ?></div>
     </div>
    <? endforeach ?>   
   <? endif ?>
// ---- end 
 
//other xxxx code
 
and,
yyyy.phtml
-------------------
// other yyyy code
 
// --- code that will be used on several view scripts
   <? if(!empty($this->data)): ?>   
    <? foreach($this->data as $v):?>
     <div class="span-17 list-project">
      <span class="pr-title"><?= $v->title ?></span><br />
      <span class="pr-by">Proposed By <?= ucwords($v->cby) ?></span><br />
      <span class="pr-time">Time : <?= $v->cbo ?></span>
      <div class="span-9 pr-desc"><?= $v->description ?></div>
      <div class="span-9 pr-desc"><?= $v->target ?></div>
     </div>
    <? endforeach ?>   
   <? endif ?>
// ---- end 
 
//other yyyy code
 
====================
Is possible to set three step view to avoid doing the same thing?
Or we can utilize View Helpers to solve it?
 
Thanks in advance, bn

Reply via email to