RSS Feed/News Ajax loaded template and formrows rendering

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
24,662
Points
823

Reputation:

Hello all! (y)

I have a question about ajax loaded content (template).

I use this code to get some ajax loaded content:
JavaScript:

Code:
    var ajaxParams = {'act': 'test'};
    XF.ajax('post', "{{ link_type('admin', 'canonical:myroute', null) }}", ajaxParams, function(data, textStatus, jqXHR){
        $('#mydiv').append(data.output);
    });
The php side has this:
PHP:

Code:
$this->setResponseType('json');
$html = \XF::app()->templater->renderTemplate('admin:sc_mytemplate', []);    
$output = ['output' =>...

Read more

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