0

私はこれを私の形で持っています

<?php

echo $this->Form->create('Vendor', array(
'url' => array_merge(array('action' => 'index'), $this->params['pass'])
));
echo $this->Form->input('vendor_name', array('div' => false,'empty'=>true));
echo $this->Form->input('is_finalized', array('div' => false,'empty'=>true));
echo $this->Form->submit(__('Search', true), array('div' => false));
echo $this->Form->end();

?>

コントローラーにこれがあります

var_dump($this->request);

$this->request の var_dump を見ると、data プロパティが含まれています。ダンプの下を参照してください。しかし、これを行うと var_dump($this->request->data); 空の配列を取得します。$this->request var_dump の下に public でデータがあることがわかります。

$this->request の var_dump はこちら

object(CakeRequest)[9]
  public 'params' => 
    array (size=5)
      'plugin' => null
      'controller' => string 'vendors' (length=7)
      'action' => string 'index' (length=5)
      'named' => 
        array (size=0)
          empty
      'pass' => 
        array (size=0)
          empty
  public 'data' => 
    array (size=1)
      'Vendor' => 
        array (size=2)
          'vendor_name' => string 'fudatools' (length=9)
          'is_finalized' => string '1' (length=1)
  public 'query' => 
    array (size=0)
      empty
  public 'url' => string 'vendors' (length=7)
  public 'base' => string '/hiVendors' (length=10)
  public 'webroot' => string '/hiVendors/' (length=11)
  public 'here' => string '/hiVendors/vendors' (length=18)
  protected '_detectors' => 
    array (size=11)
      'get' => 
        array (size=2)
          'env' => string 'REQUEST_METHOD' (length=14)
          'value' => string 'GET' (length=3)
      'post' => 
        array (size=2)
          'env' => string 'REQUEST_METHOD' (length=14)
          'value' => string 'POST' (length=4)
      'put' => 
        array (size=2)
          'env' => string 'REQUEST_METHOD' (length=14)
          'value' => string 'PUT' (length=3)
      'delete' => 
        array (size=2)
          'env' => string 'REQUEST_METHOD' (length=14)
          'value' => string 'DELETE' (length=6)
      'head' => 
        array (size=2)
          'env' => string 'REQUEST_METHOD' (length=14)
          'value' => string 'HEAD' (length=4)
      'options' => 
        array (size=2)
          'env' => string 'REQUEST_METHOD' (length=14)
          'value' => string 'OPTIONS' (length=7)
      'ssl' => 
        array (size=2)
          'env' => string 'HTTPS' (length=5)
          'value' => int 1
      'ajax' => 
        array (size=2)
          'env' => string 'HTTP_X_REQUESTED_WITH' (length=21)
          'value' => string 'XMLHttpRequest' (length=14)
      'flash' => 
        array (size=2)
          'env' => string 'HTTP_USER_AGENT' (length=15)
          'pattern' => string '/^(Shockwave|Adobe) Flash/' (length=26)
      'mobile' => 
        array (size=2)
          'env' => string 'HTTP_USER_AGENT' (length=15)
          'options' => 
            array (size=26)
              ...
      'requested' => 
        array (size=2)
          'param' => string 'requested' (length=9)
          'value' => int 1
  protected '_input' => string '' (length=0)
4

1 に答える 1

0

と間違えた

var_dump($this->request); と置換する

print_r($this->request->data);

于 2014-08-14T14:10:11.573 に答える