0
我想要顯示的日期作爲DMY:例如1975年7月7日CakePHP的:警告(2):用htmlspecialchars()預計參數4是布爾
但是與此代碼:
<?php echo h($player['Player']['player_birthDate'], array('dateFormat'=>'DMY')); ?>
我得到的錯誤信息:
Warning (2): htmlspecialchars() expects parameter 4 to be boolean, array given [CORE\Cake\basics.php, line 198]
htmlspecialchars - [internal], line ??
h - CORE\Cake\basics.php, line 198
include - APP\View\Players\index.ctp, line 34
View::_evaluate() - CORE\Cake\View\View.php, line 935
View::_render() - CORE\Cake\View\View.php, line 897
View::render() - CORE\Cake\View\View.php, line 466
Controller::render() - CORE\Cake\Controller\Controller.php, line 952
Dispatcher::_invoke() - CORE\Cake\Routing\Dispatcher.php, line 192
Dispatcher::dispatch() - CORE\Cake\Routing\Dispatcher.php, line 160
require - APP\webroot\index.php, line 108
[main] - ROOT\index.php, line 41
型號:
'player_birthDate' => array(
'date' => array(
'rule' => array('date'),
),
),
這是預期的行爲,沒有什麼值得驚訝的** [API參考> h()](http://api.cakephp.org/2.5/function-h。 html)**您是否檢查過文檔以尋求解決方案? ** [Cookbook> TimeHelper :: format()](http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#TimeHelper::format)** – ndm