phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


Joomla - MVC: Editing Data for Back-End

Tag: joomla, MVC, pattern, component, back-end   Category: PHP Framework
post: 07 Feb 2008 read: 848


Joomla Back End MVC Step by Step Tutorial - Part 8: Now, we activate our editing function. Our form is ready. So, we just update edit function at controller.

Open "controller.php". Add following code at edit() function:

joomla mvc backend edit data


  function edit()
  {
  	global $option;
	
	$cid 	= JRequest::getVar('cid', array(0), '', 'array');
	JArrayHelper::toInteger($cid, array(0));
	
	$id 	= $cid[0];

	$row =& JTable::getInstance('hello', 'Table');
	// load the row from the db table

	$row->load( $id);	
	
	$lists	= array();
	$lists['published'] = JHTML::_('select.booleanlist', 
			'published' , 'class="inputbox"', $row->published);
		
	HTML_hellos::editHello($row, $lists, $option);
  }


Series this article:
Joomla - MVC: Reorganizing Back End Code
Joomla - MVC: Creating Controller and Model for Back End
Joomla - MVC: Creating View for Back End
Joomla - MVC: Adding Pagination for Back End
Joomla - MVC: Adding Element Paginating for Back End
Joomla - MVC: Creating Form Input Data for Back-End
Joomla - MVC: Saving Data for Back End
Joomla - MVC: Editing Data for Back-End
Joomla - MVC: Adding Delete Function at Back-End
Joomla - MVC: Controlling Publish State for Back-End

| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
mod_rewrite - Part 1: create your "fantasy" URL

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


615
posting