Changeset 48e84c for OWR/View.php


Ignore:
Timestamp:
11/29/09 18:53:32 (10 years ago)
Author:
pierre-alain <pierre-alain@…>
Branches:
master
Children:
7f446a
Parents:
683524
git-author:
pierre-alain <pierre-alain@…> (11/29/09 18:53:32)
git-committer:
pierre-alain <pierre-alain@…> (11/29/09 18:53:32)
Message:

many improvements (View && DAO) and cleaning; DAO still needs a deep cleaning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OWR/View.php

    rf60df4 r48e84c  
    9090     * @param string $tpl the template name 
    9191     * @param array $datas the datas 
    92      * @param boolean $xml is it XML ? 
    9392     * @param int $cacheTime cache time in seconds 
     93     * @param array $noCacheDatas the datas that are not cached but replaced on-the-fly 
    9494     * @return string the template rendered 
    9595     */ 
    96     public function get($tpl, array $datas = array(), $xml = false, $cacheTime = 0) 
     96    public function get($tpl, array $datas = array(), $cacheTime = 0, array $noCacheDatas = array()) 
    9797    { 
    9898        $t = microtime(true); 
    9999        $cacheTime = (int) $cacheTime; 
     100 
    100101        if($cacheTime > 0) 
    101102        { 
     
    113114        if(!isset($contents)) 
    114115        { 
    115             $fulltpl = HOME_PATH.'tpl'.DIRECTORY_SEPARATOR.$tpl.'.html'; 
    116116            extract($datas, EXTR_SKIP); 
    117117            ob_start(); 
    118             include $fulltpl; 
     118            include HOME_PATH.'tpl'.DIRECTORY_SEPARATOR.$tpl.'.html'; 
    119119            $contents = ob_get_clean(); 
    120120             
     
    132132        } 
    133133         
     134        if(!empty($noCacheDatas)) 
     135        { 
     136            foreach($noCacheDatas as $name => $value) 
     137            { 
     138                $contents = str_replace('<OWR:NOCACHE NAME=\''.$name.'\'/>', $value, $contents); 
     139            } 
     140        } 
     141 
    134142        self::$_renderingTime += (float)microtime(true) - $t; 
    135143         
Note: See TracChangeset for help on using the changeset viewer.