Exemplo n.º 1
0
 /**
  * Render template
  *
  * @param string $view
  * @param array $data
  * @return string|null
  */
 protected function _render($view, array $data = array())
 {
     if (empty($data)) {
         $data = $this->getState()->getData();
     }
     return Phiew_View::render($view, $data);
 }
Exemplo n.º 2
0
<?php

require_once 'autoload.php';
date_default_timezone_set('UTC');
// Just to make date() shut up on fresh installs
echo Phiew_View::render('views/helpers');
Exemplo n.º 3
0
 public function showForm()
 {
     $state = $this->_getState();
     Phiew_View::render('controller-state', $state);
 }
Exemplo n.º 4
0
Arquivo: View.php Projeto: atmoz/phiew
 /**
  * @param string $folder
  */
 public static function setTemplateFolder($folder)
 {
     self::$_templateFolder = $folder;
 }
Exemplo n.º 5
0
<?php

// The autoloader includes what we need
require_once 'autoload.php';
// The simplest way to render a template
echo Phiew_View::render('views/hello-world');
Exemplo n.º 6
0
<?php

require_once 'autoload.php';
define('PHIEW_VIEW_DIR', dirname(__FILE__) . '/views');
Phiew_View::render('insert-data', array('title' => 'Adding data to our view', 'list' => array('Some', 'example', 'data', 'for', 'you')));
/* Alternative method for setting data, using template object:
 * 
 * $template = new Phiew_View_Template();
 * $template->title = 'Adding data to our view';
 * $template->list  = array('Some', 'example', 'data', 'for', 'you');
 * $template->render('insert-data');
 * 
 */
Exemplo n.º 7
0
<?php

require_once 'autoload.php';
define('PHIEW_VIEW_DIR', dirname(__FILE__) . '/views');
Phiew_View::render('helpers');
Exemplo n.º 8
0
<?php

// Register autoloader
require_once '../../library/Phiew/Autoload.php';
Phiew_Autoload::register();
// Folder where Phiew_View will look for templates
Phiew_View::setTemplateFolder(dirname(__FILE__) . '/Views');
try {
    $application = new Phiew_Application(array('applicationFolder' => dirname(__FILE__)));
    $application->bootstrap();
} catch (Exception $e) {
    echo $e->getMessage();
}
Exemplo n.º 9
0
<?php

require_once 'autoload.php';
// Remember to set this so we know where our templates is located
define('PHIEW_VIEW_DIR', dirname(__FILE__) . '/views');
// Two ways to use templates ...
// #1: Use Phiew_View's static functions
Phiew_View::render('hello-world');
// #2: Create Phiew_View_Template object
// $template = new Phiew_View_Template();
// $template->render('hello-world');
<?php

require_once 'autoload.php';
define('PHIEW_VIEW_DIR', dirname(__FILE__) . '/views');
Phiew_View::render('template-in-template');
Exemplo n.º 11
0
<?php

require_once 'autoload.php';
echo Phiew_View::render('views/template-in-template');