post - Jinput not working for joomla -
i've been stuck on problem no clue why doesn't work.
i'm using joomla 2.5 , building own component.
i have 'books' , 'book' view. 'books' lists books database , 'book' add/edit book item. i'm trying pass value 'books' 'book' doesn't work.
i've set input text value pass on.
<input type="text" id="test" name="test" value="testvalue" />
views/books/tmpl/default.php
<form action="<?php echo jroute::_('index.php?option=com_test'); ?>" method="post" name="adminform"> <table class="adminlist"> <thead><?php echo $this->loadtemplate('head');?></thead> <tfoot><?php echo $this->loadtemplate('foot');?></tfoot> <tbody><?php echo $this->loadtemplate('body');?></tbody> </table> <div> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <?php echo jhtml::_('form.token'); ?> <!-- sorting --> <input type="hidden" name="filter_order" value="<?php echo $this->sortcolumn; ?>" /> <input type="hidden" name="filter_order_dir" value="<?php echo $this->sortdirection; ?>" /> <input type="text" id="test" name="test" value="testvalue" /> </div> </form>
and in book view.html.php file views/book/view.html.php
$jinput = jfactory::getapplication()->input; echo 'value:'.$jinput->get('test');
there no value. i've tried $_post('test') still doesn't work. can please point me @ right direction?
the post data should received in controller
not in view
.
once submit form should have controller , model handle post
data.
check link , understand work flow, on controller can try same code works.
joomla mvc component structure
hope helps..
Comments
Post a Comment