Error

Call to a member function format() on boolean

/home/www/resatest.fr/htdocs/protected/views/user/createnew.php(118)

106 <script type="text/javascript"
107         src="//www.googleadservices.com/pagead/conversion_async.js">
108 </script>
109 
110 <?php
111 
112 $town_name           = $appointmentInfo['town_name'];
113 $start_date          = date("d-m-Y", strtotime($appointmentInfo['param_date']));
114 
115 $timeStart = DateTime::createFromFormat('Y-m-d H:i', sprintf("%s %s", $appointmentInfo['param_date'], date('H:i', $appointmentInfo['time_start'])));
116 $timeEnd = DateTime::createFromFormat('Y-m-d H:i', sprintf("%s %s", $appointmentInfo['param_date'], date('H:i', $appointmentInfo['time_end'])));
117 
118 $start = $timeStart->format(DateTime::ISO8601);
119 $end = $timeEnd->format(DateTime::ISO8601);
120 
121 $region_code         = $appointmentInfo['region_code'];
122 $region_name         = $appointmentInfo['region_name'];
123 $app_region_name_url = Service::createUrlFromString($region_name);
124 $app_town_url        = Service::createUrlFromString($town_name);
125 $code_postal         = $appointmentInfo['code_postal'];
126 $app_address         = $appointmentInfo['center_address'];
127 
128 $microdata .= <<<microdata
129      {
130             "@context": "http://schema.org",

Stack Trace

#4
+
 /home/www/resatest.fr/htdocs/protected/controllers/UserController.php(469): CController->render("createnew", array("appointmentInfo" => array("name" => "PHP Notice", "message" => "Trying to get property 'townPrice' of non-object", "code" => 8, "type" => "yii\base\ErrorException", ...), "coordinates" => array(), "annulationReason" => array(4 => "Vitesse", 5 => "Alcool", 6 => "Stupéfiants", 7 => "Accident", ...), "annulationSuspension" => array(5 => "Annulation 6 mois ou plus", 4 => "Annulation moins de 6 mois", 8 => "Autre", 7 => "Suspension 6 mois ou plus", ...)))
464 
465             $this->render('createnew', [
466                 'appointmentInfo' => $appointmentInfo,
467                 'coordinates' => $coordinates,
468                 'annulationReason' => $annulationReason,
469                 'annulationSuspension'=> $annulationSuspension
470                 ]
471             );
472         }
473     }
474 
#17
+
 /home/www/resatest.fr/htdocs/index.php(14): CApplication->run()
09 defined('YII_DEBUG') or define('YII_DEBUG',true);
10 // specify how many levels of call stack should be shown in each log message
11 //defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
12 
13 require_once($yii);
14 Yii::createWebApplication($config)->run();
2024-03-19 12:52:45 Apache/2.4.25 (Debian) Yii Framework/1.1.14