cakephp-3.0

    0熱度

    1回答

    下午好。我有一個很大的問題,我使用一些參數來輸入ajax,但是當我發送ajax到這個代碼時,它只是簡單地重定向而不做任何事情。我相信你有一個更好的方法,但文檔沒有解釋任何東西!如果你能幫助我,謝謝! class ContaController extends AppController { public function initialize() { parent::init

    0熱度

    1回答

    我試圖訪問我的表類中的beforeSave方法內提交的數據,但我得到的是保存在數據庫中的數據。 public function beforeSave($event,$entity,$options) { // submitted data is ABC // the value DEF is currently in the database debug($enti

    0熱度

    1回答

    我不確定我在做什麼錯誤,但是我已經在這上面呆了好幾個小時,當它應該是相對簡單的時候。這是我的html; <div class="ui search focus"> <div class="ui left icon input"> <input class="prompt" type="text" placeholder="Search GitHub" auto

    0熱度

    1回答

    我創建一個modelless形式: protected function _buildSchema(Schema $schema) { return $schema->addField('name', ['type' => 'string']) ->addField('line1', ['type' => 'string']) ->addField('c

    0熱度

    3回答

    我試圖將數據保存到訂單表中。但是save方法返回NULL。我也提供了數據。 這是我正在嘗試的代碼。 $OrderData = [ 'order_name' => 56, 'order_status_id' => '2', 'order_date' => date('Y-m-d H:i:s'), 'order_address' => '', 'ord

    0熱度

    1回答

    我從cakephp2切換到cakephp3。在這裏我無法理解,關聯數據如何存儲。我有一個名爲Orders的表和一個名爲Ordersarticles的表。有一個視圖,訂單信息和多個結構被放入。現在我想要將數據存儲在控制器中。 我有以下代碼 public function add(){ $order = $this->Orders->newEntity(); if ($this

    0熱度

    3回答

    我試圖用CakePHP3創建一個文件下載函數,並且無法將它路徑到$ this-> response->文件();這是我的功能: public function download($id) { $attachment = $this->Attachments->get($id); $this->response->file(WWW_ROOT.$attachment->filep

    0熱度

    1回答

    我想在cakephp 3中爲多選擇下拉菜單創建一個自定義數據類型。我在我的形式multiple => true控制: - PHP - HTML - CSS 當我提交此表,我獲取該控件作爲一個數組(0 => PHP, 1 => HTML)的值,這是沒有問題,現在我想保存字符串格式的這些值像這樣PHP,HTML並再次作爲數組檢索。 該輸入的保存進行得很順利,但僅以string的形式檢索數據。爲

    0熱度

    1回答

    我正在爲我的項目使用CakePHP 3和MAMP Pro服務器。當我試圖烤蛋糕,這個錯誤顯示出來: Fatal error: You must enable the intl extension to use CakePHP. 我甚至包括intl.so和延長=在我的php.ini文件php_intl.dll但無法弄清楚解決這個錯誤。

    0熱度

    1回答

    有跡象表明,通過一個外鍵在一個一對多的關係 表orders 和表bids 需要連接2個桌選擇至少有一個出價的所有訂單。 在SQL查詢這是不難做到 SELECT * , count(bids.order_id) AS count_bid FROM orders LEFT JOIN bids ON bids.order_id = orders.id GROUP BY orders.id HA