Jump to content

[SOLVED] How do i pass class through a variable


perezf

Recommended Posts

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);
?>

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);
?>

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.