Yeah i tried all things, in fact it is not a printing output problem
rather the control is not going into the index function at all, when i
submit the form. Fyi, in some cases browser gives a (404 page not
found) error and sometime it simply outputs the debug dump (all
queries run until the end of beforeFilter). It is simply not reaching
the index action in the case of form submit. It does not matter to
have a beforeFilter either.

On Jul 12, 2:10 pm, nini <[email protected]> wrote:
> Hey,
>
> did you tried to track $this->data variable value changes using
> xdebug?
> Btw. check your debug output level (Configure::read()) in that
> controller function, maybe it'll be set to null and pr() doesn't
> output right values.
> Old good var_dump() would help :)
>
> On Jul 11, 6:35 pm, Arvind <[email protected]> wrote:
>
> > Hi Guys,
>
> > I am a 3+ years old in cakephp and facing a somewhat strange issue
> > with submitting a form to plugin controller's action (i am using
> > plugin first time). After trying different known things i am posting
> > this one.
>
> > Going straight into the matter here is the form in my "forum" plugin's
> > -> search_controller.php's -> index view:
>
> > <?php echo $form->create("Search", array('url'=>array('controller' =>
> > 'search', 'action' => 'index','plugin'=>'forum'),
> > 'id'=>'searchFormMain')); ?>
> >                 <img src="/img/rfdf_logo_blue_search.jpg" width="383" 
> > height="45" /><br><input type="text" name="data[Search][keyword]" 
> > style="width:
>
> > 357px; margin-left:9px;"><p><span id="searchButton"><input
> > type="image" src="/img/button_search.jpg" style="height:40px;width:
> > 136px;border:0;" class="handcursor"></span></p>
> > </form>
>
> > As i am submitting this form to "index" action of search controller of
> > forum plugin, the following code does print nothing:
>
> >         public function index($type='') {
>
> >                 if(!empty($this->data))      {
> >                         pr($this->data);
> >                         die;
> >                 }
> >        }
>
> > While if i try the same code within beforeFilter of the same
> > controller i.e. search_controller.php it works well and prints as
> > follows:
>
> > Array
> > (
> >     [Search] => Array
> >         (
> >             [keyword] => Hello Forum
> >         )
>
> > )
>
> > And finally here is the beforeFilter code (of search_controller.php):
>
> >         public function beforeFilter() {
>
> >                 parent::beforeFilter();
> >                 if(!empty($this->data))      {
> >                         pr($this->data);
> >                 }
> >         }
>
> > Fyi, it does not matter if i comment out "parent::beforeFilter();" or
> > event disable $uses of my controller (if they look doubtful to you)
> > the result is same i.e. the control is not going in to "index" action
> > in the case of form submit while is working fine in the case of page
> > call. The url/action to page ishttp://localhost.rfdf.org/forum/search/index.
> > If i call the url directly is loads the form fine but when i submit it
> > never get into the "index" action of the controller thus no view
> > rendered.
>
> > I have been trying to find a way out of this for last 3+ hours now but
> > no success. I would appreciate any help in solving this puzzle.
>
> > Thanks,
>
> > Arvind.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to