Skip to content

Instantly share code, notes, and snippets.

@Codenator81
Last active August 29, 2015 14:02
Show Gist options
  • Save Codenator81/f78e5d7468dfa1402b59 to your computer and use it in GitHub Desktop.
Save Codenator81/f78e5d7468dfa1402b59 to your computer and use it in GitHub Desktop.
Controller for Home page on MODX
<?php
include_once ('/../model/webdev/webdev.class.php');
class homeController extends Webdev{
function homeAction(){
$twig =& $this->modx->twig;
$field = $this->modx->resource;
$jQuery = $twig->render('chunks/jQuery.twig');
$jQueryBeautyofCode = $twig->render('chunks/jQueryBeautyofCode.twig');
$siteFooter = $twig->render('chunks/siteFooter.twig');
$globalNav = $twig->render('chunks/globalNav.twig');
$testArray = $this->runAsFunction('testArray');
return $twig->render('index.twig',
[
'jQuery' => $jQuery,
'jQueryBeautyofCode' => $jQueryBeautyofCode,
'siteFooter' => $siteFooter,
'field' => $field,
'globalNav' => $globalNav,
'testArray' => $testArray,
]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment