Easy country drop-down using a form helper extension - ISO 3166 |
[eluser]brucebat[/eluser]
Im getting an error on CI 2.02 saying: Quote:Severity: Warning I have given the helper the countries array which is initialized inside the helper before the function. I used your example function call and it is not working. Code: if($show_all) {
[eluser]Michael Layne[/eluser]
Same here - Cannot get this to work in 2.0.2. What am I missing? Thanks. Great helper BTW. Michael
[eluser]mi6crazyheart[/eluser]
I've little tweaked this one. Have a look at here: http://goo.gl/KIx9x
[eluser]Michael Layne[/eluser]
brucebat, I had another look and turned out I didn't have my array in my config/config.php file for this new app. I looked to see what was different with a completed recent app and that was it.. So... to be clear, I added this ast the end of my config.php file: Code: $config['country_list'] = array( HTH
[eluser]oniadvanced[/eluser]
Hi, Guys. Excellent work with this helper. I just did some changes to the helper in order to organize more the code. First, I created a config file (and put them in applications/config/form.php) to save two variables. Take a look: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); ok, now in the helper we need to load this file. As you see here: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); We can improve it a little more but is ok for now, maybe in a few days I'll add some extra functions. I hope this helps to others as It helps me. Code Igniter Rocks!
[eluser]jedd[/eluser]
[quote author="oniadvanced" date="1310448531"] I just did some changes to the helper in order to organize more the code. [/quote] Please update the wiki entry [url="http://codeigniter.com/wiki/helper_dropdown_country_code"]Helper - dropdown - country code[/url] It's easier to find it in the wiki than in a forum thread.
[eluser]Unknown[/eluser]
I appear to be having no luck getting this to work, all I am getting when I put the echo in the view is a undefined call to function country_dropdown. Anyone else experienced this? "Fatal error: Call to undefined function country_dropdown() in /Users/gavin/Sites/Jowst/themes/admin/views/teams/add.php on line 39" LIne 39 being the echo country_dropdown(); UPDATE: Managed to fix this, wasn't loading the helper in autoload. Next problem is selecting the current value in the DB. Did anyone manage to solve this as I noticed it was mentioned above?
[eluser]touson[/eluser]
Well done chaps, saved me tonnes of time and effort. I love this community....
|
Welcome Guest, Not a member yet? Register Sign In |