MVC-Pro/application/controllers/categoriescontroller.php
/**
	 * Description:
	 * This updates a category, sets a validation message, and then sets the categories array.
	 */
This updates a category, sets a validation message, and then sets the categories array.
This updates a category sets a validation message and then sets the categories array .
public function update()
	{
		$catID = $_POST['categoryID'];
		$name = $_POST['categoryname'];
		$this->categoryObject = new Categories;
		$outcome = $this->categoryObject->update($catID,$name);
		if($outcome){
			$this->set('message',"Category Updated");
		} else {
			$this->set('message',"Category update failed");
		}
		$outcome = $this->categoryObject->getCategories();
		$this->set('categories',$outcome);
	}
public function update ( ) { $ catID = $ _POST [ 'categoryID' ] ; $ name = $ _POST [ 'categoryname' ] ; $ this -> categoryObject = new Categories ; $ outcome = $ this -> categoryObject -> update ( $ catID , $ name ) ; if ( $ outcome ) { $ this -> set ( 'message' , " Category Updated " ) ; } else { $ this -> set ( 'message' , " Category update failed " ) ; } $ outcome = $ this -> categoryObject -> getCategories ( ) ; $ this -> set ( 'categories' , $ outcome ) ; }
Description:
 This updates a category, sets a validation message, and then sets the categories array.
Description : This updates a category sets a validation message and then sets the categories array .