x4rl
Well-known member
So after read all the awesome post that shadab has done this is what ive come up with so far
This is just in it's own php file for now testing to see if it works and ive done it right
So am guessing the template name will need to go in here
Am still confused on how I can get the whole header tho, Will I need to add tons of templates to make this work?
Thanks
PHP:
<?php
$startTime = microtime(true);
$fileDir = '/home/animelon/public_html';
require($fileDir . '/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');
XenForo_Application::initialize($fileDir . '/library', $fileDir);
XenForo_Application::set('page_start_time', $startTime);
// Not required if you are not using any of the preloaded data
$dependencies = new XenForo_Dependencies_Public();
$dependencies->preLoadData();
XenForo_Session::startPublicSession();
# Rendering a template
$request = new Zend_Controller_Request_Http();
$response = new Zend_Controller_Response_Http();
$dependencies->preRenderView();
$viewRenderer = $dependencies->getViewRenderer($response, 'Html', $request);
// Now that you have an html view renderer, you can use it to render any view/template
$viewParams = array(
'var1' => 'Value 1',
'var2' => 'Value 2',
);
$content = $viewRenderer->renderView('', $viewParams, '');
echo $content;
So am guessing the template name will need to go in here
PHP:
$content = $viewRenderer->renderView('', $viewParams, 'HERE');
Am still confused on how I can get the whole header tho, Will I need to add tons of templates to make this work?
Thanks