ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Implementing MVC in PHP: The Model
Subject:   How to load several modules in a time?
Date:   2007-05-22 08:51:36
From:   Einstijn
Hello,


first of all, thanks to Joe Stump for this great series of articles. It really has been a great help for me!


Now my question :)
Has any body been able to load several modules at a time? I would like to show the latest newspost and a random picture (from my module photoalbum) in the sidebar of my website. But I doen't really now how to do that. I tried to place the following code in the controller (index.php).



require_once('../modules/news/news.php');
$instance = new news();
$module = "news";
$event = '__default';


if (!PM_Module::isValid($instance)) {
die("Requested module is not a valid framework module!");
}


$instance->moduleName = $module;


if ($instance->authenticate()) {
try {
$result = $instance->$event();
if (!PEAR::isError($result)) {
// $presenter = PM_Presenter::factory($instance->presenter,$instance);


/*
if (!PEAR::isError($presenter)) {


$presenter->display();
} else {
die($presenter->getMessage());
}
}
} catch (Exception $error) {
die($error->getMessage());
}
} else {
die("You do not have access to the requested page!");
}


But this off course doesn't work. Is there anyone with a solution for this problem?


thx in advance!


1 to 1 of 1
  1. How to load several modules in a time?
    2008-07-06 10:27:04  joshsherman [View]

1 to 1 of 1