PHP notice

Trying to get property of non-object

/home/hltimeco/public_html/hltime/protected/controllers/DownloadController.php(68)

56      * Displays a particular model.
57      * @param integer $id the ID of the model to be displayed
58      */
59     public function actionView($id)
60     {
61         $this->render('view',array(
62             'model'=>$this->loadModel($id),
63         ));
64     }
65   
66   public function actionDownload($id){
67     $model = File::model()->findByPk($id);
68     $download = Download::model()->findByPk($model->typeid);
69     $ext = substr($model->filesyspath,strrpos($model->filesyspath, '.'));
70     if($download->type=='pricelist'){
71       if(Yii::app()->user->isGuest)
72         $this->redirect($this->createUrl('/filemanager/agentonly'));
73       else{
74         if(Yii::app()->user->checkAccess('pricelistdownload')){
75           header("Pragma: public"); // required
76           header("Expires: 0");
77           header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
78           header("Cache-Control: private",false); // required for certain browsers 
79           //header("Content-Type: " . $file->mime_type);
80           $filename = substr($model->filesyspath, strrpos($model->filesyspath, '/')+1);

Stack Trace

#14
+
 /home/hltimeco/public_html/hltime/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-29 15:37:07 LiteSpeed Yii Framework/1.1.10