30
2008
Leveraging on Joomla’s JConfig for Application Specific Configuration
 
30 October 2008 | 02:40pm by James

icon-48-config.png Hmmm… sometimes you just need to be able add certain configuration settings to support your application.  Most common are stuff like email addresses which have to be emailed as part of some workflow….  

So how do you go about doing it with Joomla.  Well, this article will illustrate how this can be done leveraging Joomla’s framework by discussing the 2 points:

  • Storing configuration information into configuration.php through Joomla’s backend
  • Utilising configuration informatio nthrough Joomla’s backend.

End Results

Well basically, you are trying to achieve something like this… an additional panel under global configuration for joomla.

joomlaConfiguration.png by you.

Storing Configuration Information

Well, to do this, we have to touch on 3 files:

  • application.php (amend existing file)
  • view.php (amend existing file)
  • config_<appName>.php  (new file)

joomlaFilesToChange.png by you.
application.php

Codes to persist new field to configuration.php

Joomla_application_php.png by you.

view.php

Linking to the new application configuration php.  Only needs to be done once!

joomla_view_php.png by you.

config_eep.portal

New view page for the application specific application.

joomla_config_eep.png by you.

Utilising Configuration Information

Utilising the configuration information is as simple as:

mainframe->getCfg(’<<configVariableName>>’)’

Of course, you will if you are utilising it in a function, you will need to do a

global mainframe

Anyway, below is some source codes… together with leveraging on Joomla internal mailing configuration to send email

utilisingJConfig.png by you.

 
Enter your e-mail address to receive notifications when there are new posts



 
Design & Copyrights 2008 All Rights Reserved By 199Web Design Studio