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

Arrays...

Development and Programming

Jamie Rumbelow's avatar
Jamie Rumbelow
546 posts
17 years ago
Jamie Rumbelow's avatar Jamie Rumbelow

How could I possibly pass an array, of unknown data to my module via EE tags?

I was thinking something like this:

{key=value}
{key=value}

But I’m not sure how to achive that…

Thanks,

Jamie

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

Hey Jamie,

Personally I would use something like:

{exp:your_module array="val_1:key_1|val_2:key_2|val_3|val_4|val5"}

And then you could explode the value at the pipe character loop through them all and explode the colon for the key + value. If there was no colon you would just have the value.

Cheers

       
Jamie Rumbelow's avatar
Jamie Rumbelow
546 posts
17 years ago
Jamie Rumbelow's avatar Jamie Rumbelow

Thanks Leevi, that’s really helpful!

Jamie 😉

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

No worries Jamie.

       

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.