Anything in php like Rails @content_for_layout

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I am wondering if there is a means in php to mimic what, in rails, is called  
@content_for_layout. Essentially, that tag in rails can be placed in an html  
page, and, anytime a page (any page in a project) is to be rendered, the  
html page is displayed and the @content_for_layout part is replaced with the  
rendered script of the page being called.

Its a nice feature wherein you can retain header, footer, frame, css stuff,  
in one spot. Do we have anything like this in php or is anyone aware of  
something out there that would essentiually do a similar thing? Thanks,  

Re: Anything in php like Rails @content_for_layout

On Jul 9, 8:29 pm, "RVince" <r vince 9 9 at hotmail dot com> wrote:
Quoted text here. Click to load it

include() and require():


Re: Anything in php like Rails @content_for_layout

On 10.07.2007 02:29 RVince wrote:
Quoted text here. Click to load it

There's no built-in function for this, but it's easy to write one.

function use_layout($path) {
    ob_start(create_function('$c', "

To "wrap" some script's output in a layout, just write this at the  
beginning of the script:


gosha bine

extended php parser ~
blok ~

Site Timeline