Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2015
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <?php
  2.  
  3. class Event extends CActiveRecord
  4. {
  5. public static function model($className=__CLASS__)
  6. {
  7. return parent::model($className);
  8. }
  9.  
  10. public function tableName()
  11. {
  12. return 'events';
  13. }
  14.  
  15. public function rules(){
  16. return array(
  17. // Максимальный и минимальный размер указываем в байтах.
  18. array('src', 'file', 'types'=>'jpg, gif, png', 'maxSize' => 1048576),
  19. );
  20. }
  21. }
  22.  
  23.  
  24. --------------------------------------------------------------------------
  25.  
  26. <?php
  27.  
  28. class Video extends CActiveRecord
  29. {
  30. public static function model($className=__CLASS__)
  31. {
  32. return parent::model($className);
  33. }
  34.  
  35. public function tableName()
  36. {
  37. return 'videos';
  38. }
  39.  
  40. public function rules(){
  41. return array(
  42. // Максимальный и минимальный размер указываем в байтах.
  43. array('src', 'file', 'types'=>'jpg, gif, png', 'maxSize' => 1048576),
  44. );
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement