Including file Inside class
Posted: Mon Sep 08, 2008 10:01 am
I'm trying to write a class that has the option of including a file or including plain HTML. I'm not sure how to execute this properly. I was reading up on how to do this, and it seems the suggestion is to "return a value" at the end of all include files. Is there a way to avoid this? I tried using their fuction get_include_contents, however it seems like my variables are not working. If I have
mypage.php
- include file1.php - set $var = "asdf";
- include file2.php (within my class) - echo $var;
it does not show anything.
I want my include files to work just like standard include files. How can I get this to work?
mypage.php
- include file1.php - set $var = "asdf";
- include file2.php (within my class) - echo $var;
it does not show anything.
I want my include files to work just like standard include files. How can I get this to work?