Book Image

Learning Joomla! 1.5 Extension Development

Book Image

Learning Joomla! 1.5 Extension Development

Overview of this book

Table of Contents (17 chapters)
Learning Joomla! 1.5 Extension Development
Credits
About the Author
About the Reviewer
Preface

Sending emails


Joomla!'s core content management has a built-in feature where visitors are able to send articles to their friends through email. A similar feature can be added to the "Restaurant Reviews" component. The component can be modified to display a link to a form where the email address of a friend can be entered along with a short message.

We will create a new view to handle this form. Go to the /components/com_restaurants/views folder and create a new folder named email. In this folder, create a file called view.html.php, and load it with the following code:

<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'tables');
class RestaurantsViewEmail extends JView
{
function display($tpl = null)
{
$id = JRequest::getInt('id', 0);
$review =& JTable::getInstance('review', 'Table');
$review->load($id);
$this->assignRef('review', $review);
parent::display($tpl);...