我試圖創建一個iCal的文件。CakePHP的路由器:: parseExtensions(「芯片」)不能正常工作
所以我在router.php
設置Router::parseExtensions('ics')
。
我創建了一個文件夾ics
在app/views/layouts
和default.ctp
與此內容
<?php
header('Content-Type: text/calendar');
echo $content_for_layout;
?>
在我reservationsController我創建了一個ical()
行動,並在/app/views/reservations/ics/
創建ical.ctp
。
所以,如果我試圖訪問http://localhost/reservations/ical/1.ics
我得到一個錯誤:
Error: The view for ReservationsController::ical() was not found.
Error: Confirm you have created the file: C:\xampp\htdocs\ers\app\views\reservations\ical.ctp
所以我對錯誤消息有些混亂。爲什麼它搜索ical.ctp
app\views\reservations\
而不是app\views\reservations\ics\
?
當我在使用其他擴展像.xml
錯誤消息是這樣的:
Error: Confirm you have created the file: C:\xampp\htdocs\ers\app\views\reservations\xml\ical.ctp
爲什麼XML工作和ICS不?什麼地方出了錯?