コード例 #1
0
ファイル: ControllerAbstract.php プロジェクト: atmoz/phiew
 /**
  * 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);
 }
コード例 #2
0
ファイル: helpers.php プロジェクト: atmoz/phiew
<?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');
コード例 #3
0
 public function showForm()
 {
     $state = $this->_getState();
     Phiew_View::render('controller-state', $state);
 }
コード例 #4
0
ファイル: View.php プロジェクト: atmoz/phiew
 /**
  * @param string $folder
  */
 public static function setTemplateFolder($folder)
 {
     self::$_templateFolder = $folder;
 }
コード例 #5
0
ファイル: hello-world.php プロジェクト: atmoz/phiew
<?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');
コード例 #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');
 * 
 */
コード例 #7
0
ファイル: helpers.php プロジェクト: eivindingebrigtsen/phiew
<?php

require_once 'autoload.php';
define('PHIEW_VIEW_DIR', dirname(__FILE__) . '/views');
Phiew_View::render('helpers');
コード例 #8
0
ファイル: index.php プロジェクト: atmoz/phiew
<?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();
}
コード例 #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');
コード例 #10
0
<?php

require_once 'autoload.php';
define('PHIEW_VIEW_DIR', dirname(__FILE__) . '/views');
Phiew_View::render('template-in-template');
コード例 #11
0
ファイル: template-in-template.php プロジェクト: atmoz/phiew
<?php

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