Joomla Exceptions! Another piece of the puzzle.
Starting Joomla can be frustrating.. Especially when you may be use to another framework or style of coding... Thoughts run through your mind, "What is Joomla's equivalent method!".
If you are trying to prevent people from accessing pages that you create. One of the ways to do that is by throwing an exception. Most of the time you want to prevent people from entering in bad urls.
Yoursite.com/index.php?my_content_id=apple
Most likely you do not want to accept apple as an id parameter. This can be solved by throwing an exception if valid content is not retrieved from "my_content_id=apple"
So how do you handle Exceptions?
Using or customizing the exception page under templates/system/error.phpThrowing an exception: JError::raiseError( 404, JText::_('ALERTNOTAUTH') );You can be fancy and create a function to throw dynamic errors from this if you wish. It would be best if you put this function in some sort of static method site-wide, but I still haven't found a way to create site-wide custom classes or libraries (e.g. JSite, JRequest, etc)
This article is right on... especially the last 2 paragraphs. Beat LA! http://t.co/jvC8efhm via @IncMagazine
February 4, 2012
What to know what a Magento Certified Developer looks like? Check 'im out! http://t.co/WI72qLzv #webdevelopment
January 11, 2012
At EnderTech we've learned that #thefirst rule of programming is to have a problem for your "solution".
December 28, 2011
#justsoyouknow websites don't get built in a day - think about this before building your site! http://t.co/KB4PKv7k
December 21, 2011
3 things you should consider about your website before calling EnderTech (or any #webdeveloper) http://t.co/ES6cmONE
December 21, 2011
Time Machine - a cool project. And oh ya, we built this site. http://t.co/rzJ64MbO via @USAforART
December 7, 2011
How many #webdevelopers does it take to install WordPress? Check out our latest blog to find out! http://t.co/NDzYJF8T
December 2, 2011
#thisweek we wanted to find out if #wordpress can really be installed in just 5 minutes http://t.co/7rY4CNnY find out if we succeeded!
December 1, 2011