ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Need help on load view, quick question

July 30, 2011 3:42pm

Subscribe [2]
  • #1 / Jul 30, 2011 3:42pm

    neovee

    2 posts

    The third optional parameter lets you change the behavior of the function so that it returns data as a string rather than sending it to your browser. This can be useful if you want to process the data in some way. If you set the parameter to true (boolean) it will return data. The default behavior is false, which sends it to your browser. Remember to assign it to a variable if you want the data returned:

    $string = $this->load->view('myfile', '', true);

    I don’t really understand the third param, the TRUE or FALSE behaviour. What does returning as a data really means compare to sending to browser? Thanks if somebody can clear this up for me.

  • #2 / Jul 31, 2011 4:24pm

    Eric Barnes

    487 posts

    Returning the data instead of sending to the browser works great for things like loading partials or loading views that you need to access via php latter on. Such as an email template, extra processing, etc.

  • #3 / Aug 01, 2011 3:35am

    neovee

    2 posts

    Can I access a controller files too instead of view files?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases