perezf Posted May 11, 2008 Share Posted May 11, 2008 Im trying to run this and this is the error im getting Fatal error: Cannot break/continue 1 level in /mnt/target02/348149/domainname.net/web/content/MaillistV2/controller/controller.php on line 12 here is the code below $content = $run_include->process_includes('views','login.php'); into this $run_include->start_skin('skin.php',$title,$content); Here is the complete code <?php /** * Include all Files Required */ require_once('controller/controller.php'); /** * Register Classes */ $run_include = new run_include; /** * Call Pages */ $pageref = $_GET['pageref']; switch ($pageref) { case 'login': $title = 'Login Page'; $content = $run_include->process_includes('views','login.php'); break; } /** * Call Skin */ $run_include->start_skin('skin.php',$title,$content); ?> Quote Link to comment https://forums.phpfreaks.com/topic/105140-solved-how-do-i-pass-class-through-a-variable/ Share on other sites More sharing options...
MadTechie Posted May 11, 2008 Share Posted May 11, 2008 can you post the process_includes function Quote Link to comment https://forums.phpfreaks.com/topic/105140-solved-how-do-i-pass-class-through-a-variable/#findComment-538292 Share on other sites More sharing options...
perezf Posted May 11, 2008 Author Share Posted May 11, 2008 function process_includes($type,$file) { switch ($type) { case 'views': $location = 'views/'; break; } $fileopen = fopen($location . $file,'r'); $filestuff = fread($fileopen,filesize($location . $file)); } Quote Link to comment https://forums.phpfreaks.com/topic/105140-solved-how-do-i-pass-class-through-a-variable/#findComment-538293 Share on other sites More sharing options...
perezf Posted May 11, 2008 Author Share Posted May 11, 2008 Ok im not recieving the error anymore, but the screen still stays blank nothing is showing is it possible to include this function into a variable? Quote Link to comment https://forums.phpfreaks.com/topic/105140-solved-how-do-i-pass-class-through-a-variable/#findComment-538307 Share on other sites More sharing options...
perezf Posted May 11, 2008 Author Share Posted May 11, 2008 Ok this is what i have, It is printing the actual login page but it is printing it above my design. Im trying to include it in the variable called $content How do i do that, currently all it does is print the form above everything. <?php /** * Include all Files Required */ require_once('controller/controller.php'); /** * Register Classes */ $run_include = new run_include; /** * Call Pages */ $pageref = $_GET['pageref']; switch ($pageref) { case 'login': $title = 'Login Page'; $content = $run_include->process_includes('views','login.php'); break; } /** * Call Skin */ $run_include->start_skin('skin.php',$title,$content); ?> Quote Link to comment https://forums.phpfreaks.com/topic/105140-solved-how-do-i-pass-class-through-a-variable/#findComment-538312 Share on other sites More sharing options...
MadTechie Posted May 11, 2008 Share Posted May 11, 2008 function process_includes should return $filestuff, otherwise its pointless.. your need to look at the start_skin and change the echo/prints to sets ie echo "<title>test</title>"; to $contents = "<title>test</title>"; then return echo $contents; or use ob_start to capture the output Quote Link to comment https://forums.phpfreaks.com/topic/105140-solved-how-do-i-pass-class-through-a-variable/#findComment-538317 Share on other sites More sharing options...
perezf Posted May 11, 2008 Author Share Posted May 11, 2008 wow what a simple fix worked great.... Thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/105140-solved-how-do-i-pass-class-through-a-variable/#findComment-538321 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.