Can I call template contents from a controller?

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:

Код:
protected function getThreadMessage()
    {
        $category = $this->category;
        $entity = $this->entity;
        
        $message = \XF::someWayToGetTemplateContents($entity)...

Read more

Читать далее...
 
Активность
Пока что здесь никого нет
Назад
Верх Низ