PHP Error

Trying to get property of non-object

/var/www/vhosts/cityinfoyellowpages.co.in/httpdocs/protected/components/Link.php(23)

11  * @author root
12  */
13 class Link {
14     public function getBwpPDFLink($model,$base_url=true){
15        //echo Yii::app()->getBaseUrl()."/pdf/".$model->category->link_rewrite.DIRECTORY_SEPARATOR.$model->page_no.".pdf";exit;
16         if($base_url)
17         return Yii::app()->request->getBaseUrl(true)."/pdf/".$model->id_state."/".$model->page_no.".pdf";
18     else {
19          return "pdf/".$model->id_state."/".$model->page_no.".pdf";
20     }
21     }
22      public function getCPDFLink($model){
23          $path = "cpdf".DIRECTORY_SEPARATOR.$model->id_state.DIRECTORY_SEPARATOR.$model->id_colored_pages.".pdf";
24         if(file_exists($path))
25          return Yii::app()->request->getBaseUrl(true)."/cpdf".DIRECTORY_SEPARATOR.$model->id_state.DIRECTORY_SEPARATOR.$model->id_colored_pages.".pdf";
26         else{
27             return "";
28         }
29     }
30     
31     public function getInfoLink($view){
32         return Yii::app()->createUrl("info",array("v"=>$view));
33                 
34     }
35     

Stack Trace

#0
+
 /var/www/vhosts/cityinfoyellowpages.co.in/httpdocs/protected/views/page/c_view.php(4): Link->getCPDFLink(null)
1 <?php //echo $data->page_no;?>
2 <div class="">
3     <div class="FloatLeft" style="width: 780px">
4         <?php  $file = $this->link->getCPDFLink($model);  
5         if($file):
6         ?>
7         <!--<iframe src="https://docs.google.com/viewer?url=<?php //echo urlencode($this->link->getCPDFLink($model)); ?>&amp;embedded=true" width="780" height="1124" style="border: none;"></iframe>-->
8         <iframe  frameborder="0" style="height: 1042px; overflow:scroll; width: 100%" height="" src="<?php echo $this->link->getCPDFLink($model); ?>"   ></iframe>
9         
#5
+
 /var/www/vhosts/cityinfoyellowpages.co.in/httpdocs/protected/controllers/PageController.php(81): CController->render("c_view", array("model" => null))
76     }
77 
78     public function actionColored() {
79         $id_c = Tools::getValue("id_c");
80         $model = ColoredPages::model()->findByPk($id_c);
81         $this->render("c_view", array("model" => $model));
82     }
83 
84 }
85 
86 ?>
#13
+
 /var/www/vhosts/cityinfoyellowpages.co.in/httpdocs/index.php(15): CApplication->run()
10 defined('YII_DEBUG') or define('YII_DEBUG',true);
11 // specify how many levels of call stack should be shown in each log message
12 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
13 
14 require_once($yii);
15 Yii::createWebApplication($config)->run();
2024-03-28 14:21:14 Apache Yii Framework/1.1.8