You are here: "Modular site" mod writers name vars or use ident supplied by app « PHP Programming Language « IT news, forums, messages
"Modular site" mod writers name vars or use ident supplied by app

Posted by Tyno Gendo on 04/07/07 12:50

I'm writing a test "modular site". So far I have created an App class,
a Module Manager class and a couple of test modules.

The Manager looks in a directory called 'modules' and then for every
..php file is try to create a class of type <filename> minus the .php, so
eg. for testmodule.php it tries to create a class "testmodule" and puts
it into an array within the module manager called $_modules

Module Manager has a dispatch_message function which accepts an ID for
the type of message to send, which recurses through the modules in
$_modules and uses their ReceiveMessage function to send them the message.

example:

public function dispatch_message( $message_id ) {
foreach ( $this->_modules as $module ) {
$module->ReceiveMessage( $message_id );
}
}

This is all working well and good, the thing I'm wondering about is when
modules want to postback information, should i rely on module users
naming their form inputs specifically to their module, or should my app
(when register the modules) supply a module with a unique 'ident' that
the module writer should then check for in their code and all for in
their forms etc.

eg., should i force module writers to make forms as such:

<input type="text" name="<?phpecho $mymodules->ident()?>_username"
value="" />

How do these modular sites normally differentiate from one modules POSt
to anothers?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация