PHP Error

Undefined offset: 1

/home/www/uznaykak.ru/protected/extensions/my/faktBB.php(12)

01 <?php
02 
03 class faktBB extends CWidget {
04 
05     public $text = false;
06     public $result = false;
07     public $type = false;
08 
09     public function init() {
10         if ($this->text) {
11             $format = explode("?", $this->text);
12             if ($format[0] and $format[1]) {
13                 if ($this->type){
14                   $this->result =  $format[0];
15                 }else{
16                 $this->result = "<b>" . $format[0] . "?</b> " . $format[1];
17             }
18             }
19         }
20     }
21 
22     public function run() {
23         if ($this->result) {
24             echo $this->result;

Stack Trace

#2
+
 /home/www/uznaykak.ru/protected/views/site/fakts.php(54): CBaseController->widget("application.extensions.my.faktBB", array("text" => "А знаешь ли ты, что вместо изумруда ..."))
49 <?php foreach ($list as $li) { ?>
50     <div class="b-fakt">
51         <div class="fakt-cont">
52             <div class="date"><?php echo date('d.m.Y', $li['pub_p']); ?></div>
53             <div class="text">
54                 <?php $this->widget('application.extensions.my.faktBB', array('text' => $li['fakt'])); ?>                    
55             </div><!--end text-->
56         </div><!--end fakt-cont-->
57         <ul class="social-like">
58             <li style="width: 150px;">
59                 <?php 
#7
+
 /home/www/uznaykak.ru/protected/controllers/SiteController.php(156): CController->render("fakts", array("posts" => array(array("id_p" => "599", "id_cat" => "45", "id_f_c" => null, "id_s_c" => "0", ...), array("id_p" => "621", "id_cat" => "45", "id_f_c" => null, "id_s_c" => "0", ...), array("id_p" => "623", "id_cat" => "42", "id_f_c" => null, "id_s_c" => "0", ...), array("id_p" => "622", "id_cat" => "40", "id_f_c" => null, "id_s_c" => "0", ...), ...), "category" => array(array("id" => "2", "name" => "Дети", "title" => "Дети", "eng_title" => "deti", ...), array("id" => "3", "name" => "Спорт", "title" => null, "eng_title" => "sport", ...), array("id" => "4", "name" => "Отношения", "title" => null, "eng_title" => "otnosheniya", ...), array("id" => "6", "name" => "Красота и здоровье", "title" => "Как стильно выглядеть, одеваться. С...", "eng_title" => "krasota_i_zdorov_e", ...), ...), "list" => array(Posts, Posts, Posts, Posts, ...), "pages" => CPagination, ...))
151             'posts' => $model->getPosts(),
152             'category' => $category->getPublicCategory('category'),
153             'list' => $result['list'],
154             'pages' => $result['pages'],
155             'faktForDay' => $model->getFakt(),
156         ));
157     }
158 
159     public function actionAllFakt($id) {
160         if (is_numeric($id)) {
161             $id = (int) $id;
#22
+
 /home/www/uznaykak.ru/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();
2016-10-29 15:47:59 nginx/1.8.1 Yii Framework/1.1.8