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

Render template within plugin

Development and Programming

mweichert's avatar
mweichert
68 posts
16 years ago
mweichert's avatar mweichert

Hi,

In my plugin, I want to render some EE code and then return that as tagdata.

For example:

class My_plugin
{
  public My_plugin()
  {
    $this->return_data = "{exp:weblog:entries}{title}{/exp:weblog:entries}";
  }
}

Obvously I need to use the Template class. I’ve tried numerous ways of getting this to work but need to know how to inject code into the current template being parsed and then restart the parsing process. I’ve been trying to reuse simliar code that is used in the Template class to handle nested plugins but can’t seem to get it to work. I can parse var_singles, var_pairs, var_conditionals, and global variables but cannot get class_handler() stuff to work.

Any help would be much appreciated.

Cheers, Mike

Moved to Plugins: Technical Assistance by Moderator

       
mweichert's avatar
mweichert
68 posts
16 years ago
mweichert's avatar mweichert

I just thought I’d add, I’m happy that the Template Parser class supports nested plugins - but even if we can’t find a way to render nested modules I would be interesting in knowing ‘why’.

Thanks, Mike

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
16 years ago
Sue Crocker's avatar Sue Crocker

Hi, mweichert.

These kinds of posts belong in Plugins: Technical Assistance.

Moving it there…

       

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.