Jump to content
Killersites Forums

MVC help!


Recommended Posts

Hello, I am working on my own lightweight MVC framework. I ran into a little situation when determining what page i am on.


below is my Controller.....

The problem i have is when checking if the method exists....


how do i pass unlimited parameters inside this function?


basically what i am trying to do is explode everything by a / and the first array is the method, anything after that will be parameters...


class Controller{

public $load;
public $model;

function __construct()
	$this->load = new Load;
	$this->model = new Model;

//determine page were on...
		//blow up the url by /
		$boom = explode('/', $_GET['url']);



			$this->error_page(); //method doesn't exist so we can show error page or default page.

		//default page to show...

}//end constructor

function home()
	$data = $this->model->user_info();

function error_page()
	$data = $this->model->user_info();



Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...