Cake 2.3.0 を使用しています。を使用してフォームを送信するPOSTと、選択したフォーム フィールドが引き継がれますが、 を使用してフォームを送信するとGET、すべてのフォーム フィールドがデフォルト値に戻ります。
GET提出物をそのように機能させる方法はありPOSTますか?
ここに私のコントローラーがあります:
class ListingsController extends AppController {
    public function results() {
        $conditions = array(
            'Listing.Beds >=' => $this->request->query['beds'], 
            'Listing.ListingStatus >=' => $this->request->query['status'], 
        );
        $this->paginate = array(
            'conditions' => $conditions,
        );    
        $this->set('listings', $this->paginate());
    }
}
これが私の見解です。
echo $this->Form->create(null, array(
    'controller' => 'listings', 
    'action' => 'results',
    'type' => 'get'
));
echo $this->Form->input('name');
$beds = array('1' => '1+', '2' => '2+', '3' => '3+', '4' => '4+', '5' => '5+');
echo $this->Form->input('beds', array('options' => $beds));
$status = array('Active' => 'Active', 'Pending' => 'Pending', 'ActivePending' => 'Active and Pending');
echo $this->Form->input('status', array('options' => $status));
echo $this->Form->end('Update'); 
したがって、基本的に変更'type' => 'get'する'type' => 'post'と問題なく動作します。しかし、私はこれを介して行うことができる必要がありますGET。
ありがとう