Show
Ignore:
Timestamp:
07/08/09 03:51:07 (3 years ago)
Author:
john
Message:

fixed a render bug render_performed = false when render as string

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/trax/vendor/trax/action_controller.php

    r314 r317  
    530530                $this->controller_class = Inflector::camelize(Inflector::demodulize($this->controller)) . "Controller"; 
    531531                $this->helper_file = $this->helpers_path . "/" .  $this->controller . "_helper.php";   
    532                 #error_log("controller:{$this->controller} - controller_file:{$this->controller_file} - controller_class:{$this->controller_class} - views_path:{$this->views_path}"); 
     532                # error_log("controller:{$this->controller} - controller_file:{$this->controller_file} - controller_class:{$this->controller_class} - views_path:{$this->views_path}"); 
    533533            } 
    534534        } 
     
    745745                        $locals['content_for_layout'] = $content_for_layout; 
    746746                        # render the layout 
    747                         //error_log("rendering layout: ".$this->controller_object->layout_file); 
     747                        #error_log("rendering layout: ".$this->controller_object->layout_file); 
    748748                        if(!$this->controller_object->render_file($this->controller_object->layout_file, false, $locals)) { 
    749749                            # No layout template so just echo out whatever is in $content_for_layout 
     
    10711071        if($return_as_string) { 
    10721072            $result = ob_get_contents(); 
    1073             ob_end_clean(); 
     1073            ob_end_clean();   
     1074            $this->render_performed = false; 
    10741075            return $result; 
    10751076        }          
     
    14351436     *  @throws ActionControllerError 
    14361437     */ 
    1437     function raise($error_message, $error_heading, $error_code = "404") { 
     1438    function raise($error_message, $error_heading, $error_code = "404") {  
    14381439        throw new ActionControllerError("Error Message: ".$error_message, $error_heading, $error_code); 
    14391440    } 
     
    14661467            } 
    14671468        } else { 
    1468             echo "<font face=\"verdana, arial, helvetica, sans-serif\">\n"; 
    1469             echo "<h2>Application Error</h2>Trax application failed to start properly"; 
    1470             echo "</font>\n";             
    1471         } 
     1469            if($error_code == "404") { 
     1470                echo "<h2>404 Error - File not found.</h2>"; 
     1471            } else { 
     1472                echo "<font face=\"verdana, arial, helvetica, sans-serif\">\n"; 
     1473                echo "<h2>Application Error</h2>Trax application failed to start properly"; 
     1474                echo "</font>\n";                 
     1475            }            
     1476        }  
     1477       
    14721478    } 
    14731479