Modules
| From: | Andreas Heintze | Date: | Wed, 12 Dec 2001 23:42:23 +0000 |
| Subject: | Modules | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-2273@lists.php.net to get a copy of this message | ||
Guess my first post on this didn't make it through, so now I have given
it
a little more thought and also finished half of this modularity
extension to Smarty.
What I have left is just the addition of making it possible to add
single modifiers
And functions by just dropping the files in the right directory, I'll
fix that soon...
I like the idea of modularity so anyone can write modules to extend
Smarty easily.
This is my initial thoughts:
An example for a multiple language support module.
The code to use a specific complete module
------------------------------------------
$smarty->load_module("language"); // This addition is finished
Directory structure for Smarty modules
--------------------------------------
smarty
modules
functions
Smarty.func.php // All standard functions taken from
Smarty.addons.php
... // All files dropped here should work
automatically)
modifiers
Smarty.mod.php // All standard modifiers taken from
Smarty.addons.php
alt.mod.php // (example) A single new modifier (all
files dropped here should work automatically)
...
language // A complete module (this one enables
support for multilingual sites)
etc
language.ini // (only if the module needs init
settings)
sql
language.sql // (only if the module needs database
access)
lib
language.php // (contains modifiers, functions and
classes for this module)
In the case where a module needs database access I was planning of using
ADOdb.
(http://php.weblogs.com/adodb)
Is there anyone else working on making Smarty modular yet? Any ideas?
Comments?
/Andreas
PS. My language module is also soon finished.