Book Image

Mastering Joomla! 1.5 Extension and Framework Development Second Edition

Book Image

Mastering Joomla! 1.5 Extension and Framework Development Second Edition

Overview of this book

Joomla! is one of the world’s top open source content management systems, which enables you to build websites and powerful online applications. Out of the box, Joomla! does a great job of managing the content needed to enhance the functionality of your website. But for many people, the true power of Joomla! lies in its application framework that makes it possible for thousands of developers around the world to create powerful add-ons and extensions. This book will guide you through the complexities of implementing add-ons, components, modules, and plugins in Joomla! 1.5. If you feel that you’ve mastered the basics of creating Joomla! extensions, then this book will take you to the next level. Packed with expert advice on all aspects of programming with Joomla!, this book is an invaluable reference guide you will turn to again and again for your Joomla! development tasks. The book starts by explaining the structure and design of the Joomla! Framework. Then we move on to extending and storing data in standard fields and dealing with multilingual requirements. Further, you will discover best practices, design, and coding methods for Joomla! components, modules, plugins, and other extensions. Along the way, you will actually design and create a component, module, and plugin that work together to add functionality to the Joomla! framework. You will also learn about customizing the page output using JavaScript effects, making use of Web Services from within Joomla! and ensuring that your code is secure and error-free. You will discover how to easily create sophisticated extensions that are robust, user-friendly, and professional by taking advantage of the many libraries and utilities provided by the Joomla! framework. A comprehensive, up-to-date reference to the Joomla! Framework API is also included in the book. Finally, we will discuss advanced methods for rendering your extensions more robust, secure, and professional.
Table of Contents (18 chapters)
Mastering Joomla! 1.5 Extension and Framework Development
Credits
About the Author
About the Reviewer
Preface

Routing


To make Joomla! respond appropriately to a request, the application contains a JRouter object. This object determines the direction to take through the application. This is based on URI query values. To make Joomla! URIs friendlier, it can be set up to use SEF (Search-Engine Friendly) URIs.

In order to take advantage of SEF URIs, when we render any, we need to use the JRoute::_() method. This method converts normal URIs into SEF URIs; this will only happen if the component has a router and if the SEO options are enabled. In this example, we parse the URI index.php?option=com_boxoffice&layout=list into an SEF URI:

echo JRoute::_('index.php?option=com_boxoffice&layout=list');

This is an example of the output we might receive:

http://example.org/joomla/index.php/component/boxoffice/list

The end of the URI, after index.php, is called the SEF segments. Each segment is separated by a forward slash.

To create a router for a component, we must create a file called router.php in the...