post_edit.rules.php 719 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. //rules for edit Post form
  3. return array(
  4. 'id' => array(
  5. array('integer', 'Invalid Post ID'),
  6. array('custom', 'AdminController::checkPostExist'),
  7. ),
  8. 'title' => array(
  9. array('maxlength', 145, 'Title cannot be longer than the 145 characters.'),
  10. array('notnull'),
  11. array('notEmpty', 'Title cannot be empty.'),
  12. ),
  13. 'content' => array(
  14. array('notnull'),
  15. array('notEmpty', 'Post content cannot be empty!'),
  16. ),
  17. 'status' => array(
  18. array('integer', 'Invalid status for blog post'),
  19. array('max', 1, 'Invalid status for blog post'),
  20. array('min', 0, 'Invalid status for blog post'),
  21. ),
  22. 'tags' => array(
  23. array('custom', 'AdminController::checkTags'),
  24. array('optional')
  25. )
  26. );
  27. ?>