RSS Feed/News Can I call template contents from a controller?

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
23,492
Points
823

Reputation:

I'm trying to auto-create a new thread when I add a new entity in my add-on. However, I can't use a phrase for the thread message because some variables may not exist so I need to be able to use <xf:if /> code. So, I was thinking how about using a template, such as something like this:

PHP:

Code:
protected function getThreadMessage()
    {
        $category = $this->category;
        $entity = $this->entity;

$message = \XF::someWayToGetTemplateContents($entity)...

Read more

Continue reading...
 
Status
Not open for further replies.
Top