Home > Archive > PHP Smarty Templates > November 2005 > Re: [SMARTY] Extending the Config_File
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: [SMARTY] Extending the Config_File
|
|
| Erik Schmitt 2005-11-03, 7:02 pm |
| No one?
Am Samstag, 29. Oktober 2005 15:17 schrieb Erik Schmitt:
> Hello,
>=20
> I write an Add-on that needs multidimensional arrays
> extracted from a config-file with no simple key-value=20
> structure, like provided by a typical Smarty config-file.
>=20
> I would like Smarty to be able to parse this different-structured
> config-file, compile it and store it in templates_c; it should=20
> benefit from the capabilities of Smarty.
>=20
> Would it make sense to extend Config_File, overwrite
> the parse-method and tell Smarty to use Config_File_MyNewOne=20
> while parsing my different-structured config-file?
> Would I have to overwrite other methods?
>=20
> Is there any other apprach that makes more sense?
>=20
>=20
> Thanks!
>=20
> Erik
>=20
=2D-=20
Mit freundlichen Gr=FC=DFen
Erik Schmitt
e-novum Software GmbH
D-49078 Osnabr=FCck, Heger-Tor-Wall 19,
=46on.: +49 (0)541 440 630 - 25, Fax: - 26
E-Mail: mailto:e.schmitt@e-novum.com
=2D--------------------------------------------------------
e-novum =AE Software ist eine gute Wahl f=FCr Ihr E-Business.
=46inden Sie heraus warum. www.redpart.de / www.e-novum.com
| |
| Monte Ohrt 2005-11-03, 7:02 pm |
| There should be no problem extending the Config_File class for your own
needs. In the Smarty object, you can set $smarty->config_class =
'My_Config_File' or whatever you name your class.
Erik Schmitt wrote:
>No one?
>
>
>
>Am Samstag, 29. Oktober 2005 15:17 schrieb Erik Schmitt:
>
>
>
>
>
| |
|
| There is a slight problem if you need to get a reference to the calling
Smarty object since it is not passed to the created config file
handler. Further, only one config file handler can be used. To me, not
having to use the config variable syntax is actually an advantadge.
For these reasons, I think it is often easier to simply assign into the
template variable scope which is easily doable using a standard plugin.
boots
--- Monte Ohrt <monte@ohrt.com> wrote:
[color=darkred]
> There should be no problem extending the Config_File class for your
> own
> needs. In the Smarty object, you can set $smarty->config_class =
> 'My_Config_File' or whatever you name your class.
>
> Erik Schmitt wrote:
>
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
|
|
|
|
|