MVC-Pro/application/controllers/categoriescontroller.php
/**
	 * Description:
	 * This adds a new category, sets a validation message, and sets the categories.
	 */
This adds a new category, sets a validation message, and sets the categories.
This adds a new category sets a validation message and sets the categories .
public function add()
	{
		$new = $_POST['newCategory'];
		$this->categoryObject = new Categories;
		$outcome = $this->categoryObject->addCategory($new);
		if(isset($outcome) and !empty($outcome)) {
			$this->set('message',"Category Added");
		} else {
			$this->set('message',"Oops, there was an error in your submission. Please try again");
		}
		$outcome = $this->categoryObject->getCategories();
		$this->set('categories',$outcome);
	}
public function add ( ) { $ new = $ _POST [ 'newCategory' ] ; $ this -> categoryObject = new Categories ; $ outcome = $ this -> categoryObject -> addCategory ( $ new ) ; if ( isset ( $ outcome ) and ! empty ( $ outcome ) ) { $ this -> set ( 'message' , " Category Added " ) ; } else { $ this -> set ( 'message' , " Oops, there was an error in your submission. Please try again " ) ; } $ outcome = $ this -> categoryObject -> getCategories ( ) ; $ this -> set ( 'categories' , $ outcome ) ; }
Description:
 This adds a new category, sets a validation message, and sets the categories.
Description : This adds a new category sets a validation message and sets the categories .