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

save_settings() - saving an array in the settings

Development and Programming

kmertig's avatar
kmertig
24 posts
17 years ago
kmertig's avatar kmertig

I am trying to save an array (either associative or 2 arrays) to the settings of my extension. I am able to save one array (called member fields) correctly, but I cannot get the array or arrays for my lists to save. I am using a different type of data input because of what I want from the user, textboxes instead of drop downs. I can’t seem to echo out the $_POST to see what data I am actually send in and if it is right. The page goes blank on me if I try. I would appreciate any help or pointers about saving settings for an extension.

       
Jamie Poitra's avatar
Jamie Poitra
409 posts
17 years ago
Jamie Poitra's avatar Jamie Poitra

kmertig

I don’t have an immediately solution for you.

However, when I need to see what is going on in a specific spot in the code I do this:

print_r($variable); exit();

With $variable being an array or variable that contains data for me to look at.

So if you want to see the $_POST data you could do:

print_r($_POST); exit();

Though the fact that you are looking at $_POST is giving me a hint that maybe you don’t know about:

$IN->GBL('key_value');

It works similarly to $_POST. Just call $IN in your function the same way you do $DB or the others and then put the field name where key_value is and you shoudl get the contents of that field.

Jamie

       
kmertig's avatar
kmertig
24 posts
17 years ago
kmertig's avatar kmertig

Jamie,

Thanks for your response! I did figure this out though. I was actually saving the data, but having trouble outputing it on the settings page. But I have solved that problem.

Kelley

       

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.