forms - How to get an array the correct way in Joomla (2.5/3.x) -
<form> <input type="checkbox" name="item[]" value="1" /> <input type="checkbox" name="item[]" value="2" /> <input type="checkbox" name="item[]" value="3" /> </form> <?php $app = jfactory::getapplication(); $items = $_post['type']; // works not joomla wise... $items = $app->input->getarray(array('type_ids')); // tried multiple ways can't work. ?> what should correct way load form items array $items?
for components using legacy following code works (version 3.3):
$jinput = jfactory::getapplication()->input; $data2 = $jinput->post->getarray(array()); var_dump($data2);
Comments
Post a Comment