File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1414 *  
1515 * A few conventions: 
1616 *  
17-  * Element: the name of the element - like you would use in CakePHP.  
18-  *  For example users/name corresponds to app/views/elements/users/name.mustache 
17+  * Replace / in an element path with __ - taht way Javascript can deal with it. 
18+  *  
19+  * Element: the name of the element - like you would use in CakePHP, but replace '/' with '__' 
20+  *  For example users__name corresponds to app/views/elements/users/name.mustache 
1921 *  
2022 * Template: the text string from an element, which is read from the element file. 
2123 *  This is what gets passed into Mustache for conversion to HTML 
2426 *  your element, simply use the element convention in the proper context!  
2527 *  Mustache takes care of the Data context 
2628 *  
29+  *  
30+  *  
2731 */ 
2832
2933require_once  ROOT  . '/app/vendors/mustache/Mustache.php ' ;
@@ -70,6 +74,7 @@ function element( $element, $values = array() ) {
7074     * @return string - system path to the element for PHP fread functions 
7175     */ 
7276    private  function  _getElementPath ( $ element  ) {
77+         $ element  = str_replace ('__ ' , '/ ' , $ element );
7378        return  ROOT  . DS  . 'app '  . DS  . 'views '  . DS  . 'elements '  . DS  . $ element  . '. '  . $ this  ->ext ;
7479    }
7580
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments