Undocumented Loader::helper('lists/countries'); ????
Permalink
Hi,
Can someone tell me what this does or how this works?
The only docs I can find say "helper" is shorthand to load a class instance. I can find no Class Lists or Class countries and nothing with a member GetCountries() in any of the source.
This came from code in concrete/attributes/address if that helps. I am trying to create my own attribute set that allows the user to select from <select> controls like State/Provence in the address attribute.
Thanks,
Sean
Can someone tell me what this does or how this works?
The only docs I can find say "helper" is shorthand to load a class instance. I can find no Class Lists or Class countries and nothing with a member GetCountries() in any of the source.
This came from code in concrete/attributes/address if that helps. I am trying to create my own attribute set that allows the user to select from <select> controls like State/Provence in the address attribute.
Thanks,
Sean
What c5 version are you using?
ooops, sorry. 5.7.5.9
It appears to return a list of countries as country code => value, I attached a screenshot of it echoed to DOM.
Also Loader::helper is deprecated so it may be difficult to use, its been replaced by Core::make, so the following code would be replacement:
. Check of the EC developer tools plugin, it has API links for all the helper classes so you can read up on what they do from the c5 api docs.
Also Loader::helper is deprecated so it may be difficult to use, its been replaced by Core::make, so the following code would be replacement:
Core::make('helper/lists/countries')
Thanks ob7dev. But i could see what the final output was. I was more interested in how that part of the code works? Granted, I did say "What this does", sorry for the confusion.
Thanks for the EC Dev Tools tip! I found the Localization service with countries and state_province functions!!
Told me everything I was after!
Told me everything I was after!
Oh nice! I just finished making a video for you
http://archebian.org/videos/ec-c5-namespaces.mp4...
But you've already figured it out!
http://archebian.org/videos/ec-c5-namespaces.mp4...
But you've already figured it out!