Home > Articles > Web Development

Six Handy Joomla! Programming Tips

  • Print
  • + Share This
  • 💬 Discuss
From the author of
Mark Dexter, coauthor of Joomla! Programming, provides some handy tricks to save you time and help you write secure, powerful code in your next Joomla programming project.

Has this ever happened to you? Just as you're finishing a project, you learn something that could have saved you a lot of time—if only you had known about it earlier! You might feel happy that you figured it out but also frustrated that you didn't know sooner. To help prevent that situation from happening again, this article presents some practical tips that I was glad to learn (and wish I had known earlier). They just might help you to save a little time and frustration on your next Joomla project.

Where Did That Message Come From?

I often need to find out where in the program a specific error or warning message is created. If you're really familiar with how Joomla works internally, you might already know the answers. For those of us who either don't know the system that well or can't remember where we found something previously, here's a quick trick:

  1. Copy the exact error message to your computer's clipboard.
  2. Using your favorite search tool (Eclipse, NetBeans, grep, File Manager, etc.), search for the error text in a language .ini file. For example, in Eclipse, you could use the search shown in Figure 1.
  3. Figure 1 Search form for the .ini text.

  4. In this example, Eclipse will show the language file from Figure 2 in the search results.
  5. Figure 2 Search results showing the .ini file.

  6. This result tells us that the language key for this message is as follows:
  7. COM_INSTALLER_MSG_DATABASE_OK
  8. Next, we search for that particular language key in a .php file. In this example, we learn that the specified language key is used in the following file (see Figure 3):
  9. administrator/components/com_installer/views/database/tmpl/default.php

    Figure 3 Search results for the language key.

Now we know exactly where to look when we need to make changes or fixes, or use similar logic somewhere else.

  • + Share This
  • 🔖 Save To Your Account

Discussions

comments powered by Disqus