lamiax Posted May 23, 2013 Share Posted May 23, 2013 Hello, I need for a module, on the back office, to create a select box to to display a list. My code is that : array( 'type' => 'select', 'label' => $this->l('Select the group'), 'name' => 'id_default_group', 'options' => array( 'query' => 'test', 'id' => 'id_category_parent', 'name' => 'name' ), 'desc' => ("Default, groupe is Home") ), But i don't understant how i can insert my options... So i need help. THank's you ! =) Link to comment Share on other sites More sharing options...
razaro Posted May 23, 2013 Share Posted May 23, 2013 (edited) In part 'options' => array( 'query' => 'test', 'id' => 'id_category_parent', 'name' => 'name' ), instead of 'test' there should be some array which you probably get from database. But for example here is hard-coded $optionsforselect = array( array('id_category_parent' => '1','name' => 'Home' ), array('id_category_parent' => '2','name' => 'Ipods' ), array('id_category_parent' => '3','name' => 'Laptop' ) ); And the you can use 'options' => array( 'query' => $optionsforselect, 'id' => 'id_category_parent', 'name' => 'name' ), Edited May 23, 2013 by razaro (see edit history) Link to comment Share on other sites More sharing options...
lamiax Posted May 23, 2013 Author Share Posted May 23, 2013 Thank's a lot, they work lovely ! Link to comment Share on other sites More sharing options...
vekia Posted May 23, 2013 Share Posted May 23, 2013 so the problem is solved - i can mark this thread as [solved] thanks for the solution razaro regards Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now