Show
Ignore:
Timestamp:
01/16/08 17:27:18 (8 months ago)
Author:
gerd
Message:

Allow placeholders in LOOP attribute

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/patTemplate.php

    r464 r467  
    15881588             */ 
    15891589            $this->_fetchVariables($template); 
     1590 
     1591            /** 
     1592             * Allow placeholder ins loop attribute 
     1593             */ 
     1594            if ($start == $i) { 
     1595                if (strstr($this->_templates[$template]['attributes']['loop'], $this->_startTag) && preg_match('/'.$this->_startTag.'([A-Z\_]+)'.$this->_endTag.'/', $this->_templates[$template]['attributes']['loop'], $match)) { 
     1596                    if (isset($this->_vars[$template]['scalar'][$match[1]])) { 
     1597                        $this->_templates[$template]['loop']    =   intval(str_replace( '{' . $match[1] . '}', $this->_vars[$template]['scalar'][$match[1]] , $this->_templates[$template]['attributes']['loop'])); 
     1598                    } 
     1599                    else if (isset($this->_globals[$match[1]])) { 
     1600                        $this->_templates[$template]['loop']    =   intval(str_replace( '{' . $match[1] . '}', $this->_globals[$match[1]] , $this->_templates[$template]['attributes']['loop'])); 
     1601                    } 
     1602                } 
     1603            } 
    15901604 
    15911605            /**