Preload MVC View

Discussion in 'PHP' started by Python, Jun 21, 2010.

  1. #1
    I've got a quick question... It sounds harder than it is.

    I'm working on a PHP app which is using a self built MVC framework. The framework pulls in individuals views by simply including the necessary files when needed in whatever order they need to be displayed. What I need to do now though is to be able to 'pre-load' a view file into a variable.

    So, let's say I have a view file called "home.php" and another called "other.php". I want to be able to put the contents of "other.php" into a variable (done inside the controller). The "other.php" does contain PHP code and therefore needs to 'execute'.

    Make sense?

    Thanks!
     
    Python, Jun 21, 2010 IP
  2. Python

    Python Well-Known Member

    Messages:
    680
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    120
    #2
    Never mind, I got it. I used output buffering :)
     
    Python, Jun 21, 2010 IP