A_MVC_Validation

Provides validation for datamapper entities within an MVC controller.

Defined (1)

The class is defined in the following location(s).

/products/photocrati_nextgen/modules/nextgen_admin/package.module.nextgen_admin.php  
  1. class A_MVC_Validation extends Mixin 
  2. function show_errors_for($entity, $return = FALSE) 
  3. $retval = ''; 
  4. if ($entity->is_invalid()) { 
  5. $retval = $this->object->render_partial('photocrati-nextgen_admin#entity_errors', array('entity' => $entity), $return); 
  6. return $retval; 
  7. function show_success_for($entity, $message, $return = FALSE) 
  8. $retval = ''; 
  9. if ($entity->is_valid()) { 
  10. $retval = $this->object->render_partial('photocrati-nextgen_admin#entity_saved', array('entity' => $entity, 'message' => $message)); 
  11. return $retval;