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

reusing database query results in subsequent plugin call on same page

Development and Programming

ender's avatar
ender
1,644 posts
16 years ago
ender's avatar ender

so I’m making a plugin that will do a bit of processing on a chunk of data retrieved from one of the weblogs in our EE database. I need to loop through the data to generate some information, which is no problem, but then I need to use that information in two places on the page, separated by a bunch of other content in the source.

What I’m wondering is if there are some tricks that will allow me to reuse the database query and generated information in both places without repeating the query/loop. Basically is there a way to access data that was stored in a class variable with an earlier call to the plugin?

example:

{exp:my_plugin} // query the database, manipulate the data somehow, store it in a class variable, maybe print some stuff

{exp:weblog:entries}
// do whatever
{/exp:weblog:entries}

{exp:my_plugin:do_something} // use the data stored in the class variable from earlier to print more stuff out
       
ender's avatar
ender
1,644 posts
16 years ago
ender's avatar ender

nevermind. forgot about the $SESS->cache.

       

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.