Inserting, editing, and deleting records in our admin zone
All these actions are very basic for any admin zone, and we are going to create
them in our own. For users to be able to perform these actions we placed some
buttons that we did in our view,
administrator/components/com_tinynews/views/tinynews/view.html.php
, as
follows:
function display(){ JToolBarHelper::title('Tinynews', 'generic.png' ); JToolBarHelper::deleteList(); JToolBarHelper::editListX(); JToolBarHelper::addNewX(); $model =& $this->getModel(); $news = $model->getallnews(); $this->assignRef('news', $news); parent::display(); }
The new button doesn't need more information, but the delete and edit ones will need something more: the records they will take action to. For this we will pass the ID of the records, and to do this we are going...