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


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

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).

$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)) {

} else {
} catch (Exception $error) {
} 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 to 1 of 1