cakephp - why i am getting empty array when I see data -


i have in form

<?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();  ?> 

and have in controller

var_dump($this->request); 

$this->request has data property in it, when @ var_dump of it. please see below dump. when var_dump($this->request->data); empty array. can see below data there public under $this->request var_dump

here var_dump of $this->request

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) 

you had mistak with

var_dump($this->request); replace with

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


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

html - Unable to style the color of bullets in a list -

c# - must be a non-abstract type with a public parameterless constructor in redis -