document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. //File in the models/mymodel.php
  2. class MyModel extends CActiveRecord{
  3.     public function myFunction(){
  4.         //do something...
  5.     }
  6. }
  7.  
  8. // -----------------------
  9.  
  10. //File in the views/view.php
  11. ...
  12. <?php MyModel::model()->myFunction(); ?>
  13. ...
');