[請益] cakephp Model的設定會被顯示出來
小弟架了cakephp-2.5.2
要用來作簡單網頁用途
但遇到個問題
我有支API是撈DB資料然後吐JSON出來
但是JSON前老是會多一段code
而那段code正好是我所use的model檔
如:
App::uses('AppModel', 'Model'); class Creature extends AppModel { (下略)
我試過
Configure::write('debug', 0);
以及
$this->layout = false;
$this->layout = 'ajax';
$this->autoRender = false;
都不能把那段消掉
不知道有沒有前輩能幫我解惑一下
願付1000P聊表心意(不限一位)
感謝
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.249.183.76
※ 文章網址: http://www.ptt.cc/bbs/PHP/M.1404186490.A.B55.html
→
07/01 23:00, , 1F
07/01 23:00, 1F
不知道跟Model檔有沒有關係
官方Model檔範例是
App::uses('AppModel', 'Model');
class Ingredient extends AppModel {
public $name = 'Ingredient';
}
我照複製存成.php是可以跑
不過這model檔的內容都會被顯示出來
而且沒用php標籤包起來感覺怪怪的
但我在最前面加個<?php
就又變成Missing Database Connection
很古怪
※ 編輯: BF109Pilot (111.249.183.76), 07/02/2014 00:52:53
推
07/02 08:41, , 2F
07/02 08:41, 2F
→
07/02 08:42, , 3F
07/02 08:42, 3F
→
07/02 08:42, , 4F
07/02 08:42, 4F
→
07/02 08:43, , 5F
07/02 08:43, 5F
→
07/02 13:35, , 6F
07/02 13:35, 6F
→
07/03 21:54, , 7F
07/03 21:54, 7F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章