We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Retrieving settings from custom settings form

Development and Programming

Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham

Hey guys,

What is the proper way to get the extension settings when you are using the settings_form() and save_settings() methods as the settings() method is no longer used.

So far I have been grabbing the settings manually in the constructor and adding them to $this->settings

Is there a way to have the settings pulled automatically?

Cheers Leevi

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham

Anyone 😊

       
ira42's avatar
ira42
167 posts
16 years ago
ira42's avatar ira42

I’m guessing that you figured this out by now.

I’ve been banging my head against the wall for days now… In my extension, I’m able to:

1- Display a multiselect using the settings_form 2- Save the settings from the extension settings page 3- The appropriate settings are displayed after saving the changes

… But I can’t for the life of me figure out the proper syntax for calling this setting array in my constructor…

Any tips?

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
16 years ago
Leevi Graham's avatar Leevi Graham

I currently have a $this->_get_settings() method that loads them from the DB.

I recommend you download LG Twitter or LG TinyMCE and see how its done.

       
ira42's avatar
ira42
167 posts
16 years ago
ira42's avatar ira42

Thanks Leevi, that works!

Just out of curiosity, is this actually documented somewhere? I’ve managed to get my extension working by ‘Frankensteining’ code bits from other extensions, plus a lot of trial and error, and many calls are just not mentioned in any of the EE Dev docs…

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

Trial and error is really how this works right now. I’m trying to figure out how to store settings for a bunch of weblog fields and am totally lost. I sort of have it working, but can’t figure out how to call back out a “yes/no” dropdown.

The only place I know where to look for answers is in Leevi’s work. The docs are not very helpful - they tell you what something is, but there isn’t a real-world example of most situations outside of Leevis’ work.

I just spent/wasted/killed an couple hours on something I should just hire Leevi to do for me. 😉

EDIT/ADD: Just attached a pic so it’s clearer what I’m talking about. I’ve completely updated Andrew Weaver’s Character Counter extension, and I’m trying to store the hard/soft count as a setting for each individual field. I have a feeling the extension is a bloated mess - it’s basically a Frankenstein of some of Leevi’s extensions.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.