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

Passing Variables as Array

Development and Programming

juro's avatar
juro
118 posts
17 years ago
juro's avatar juro

Hi, can I pass the variables as an array as opposed to value=key pairs?

I am thinking along these lines:

{exp:my_plugin options="array('maxWords'=>45,'linkName'=>'goto','alwaysLink'=>'yes','break'=>'')"}
        something
  {/exp:word_limit_plus}

This refers to a plugin.

       
Derek Jones's avatar
Derek Jones
7,561 posts
17 years ago
Derek Jones's avatar Derek Jones

Sure, though you would need to parse the structure on your own with the plugin, and it would be a departure from conventional ExpressionEngine syntax, which would not be friendly if your plugin is intended for use by others.

       
juro's avatar
juro
118 posts
17 years ago
juro's avatar juro

Ah, ok. So EE would rather see the variable names expressively used … I concede the point that it makes it easier for people that don’t program a lot. I just love the shorthand notation …

So I’ll probable implement both 😊 Thanx for the answer!

       

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.