Skip to content

Instantly share code, notes, and snippets.

@rianorie
Last active August 29, 2015 14:24
Show Gist options
  • Save rianorie/e2e66529bb1b1288c5bb to your computer and use it in GitHub Desktop.
Save rianorie/e2e66529bb1b1288c5bb to your computer and use it in GitHub Desktop.
<!-- Location: /views/index/index.volt -->
Hello
<!-- Location: app/views/index.volt -->
{{ getDoctype() }}
<html>
{{ partial('header') }}
<body>
<aside class="yaybar yay-shrink yay-hide-to-small yay-gestures">
{{ partial('topmenu') }}
{{ partial('navigation')}}
</aside>
<!-- Main Content -->
<section class="content-wrap">
<!-- Breadcrumb -->
{{ partial('breadcumb')}}
<!-- End of Breadcrumb -->
<!-- Content -->
{{ flash.output() }}
{{ content() }}
<!-- End of Content -->
</section>
<!-- End of Main Content -->
<!-- Footer -->
{{ partial('footer') }}
<!-- End of Footer -->
</body>
</html>
<?php // app/controllers/IndexController.php
class IndexController extends \Phalcon\Mvc\Controller
{
//Index Controller
public function indexAction()
{}
}
<?php // public/services.php (assuming from the view path)
// Setup the view component
$di->set('view', function(){
$view = new View();
$view->setViewsDir('../app/views/');
$view->registerEngines(array(".volt" => 'Phalcon\Mvc\View\Engine\Volt',
'.php' => 'Phalcon\Mvc\View\Engine\Php'));
return $view;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment