コード例 #1
0
ファイル: home.php プロジェクト: laiello/crindigan
 /**
  * Displays the main frontend dashboard. Contains latest news entries
  * along with miscellaneous/important information in the sidebar.
  */
 public function doIndex()
 {
     $t = RPG::template('home/index.php');
     $t->newsEntries = RPG::model('news')->getEntries(array('where' => array('news_time <= :0', RPG_NOW)));
     // characters, squads, money, active battles
     // not finalized, some could be injected right in the template itself
     $t->characters = 5;
     $t->maxCharacters = 16;
     $t->squads = 3;
     $t->maxSquads = 8;
     $t->money = 17338;
     $t->moneyName = 'Aurum';
     $t->activeBattles = 'N/A';
     RPG::view()->setNavCurrent('home', 'home')->setTitle('RPG Home')->setContent($t);
 }
コード例 #2
0
ファイル: View.php プロジェクト: laiello/crindigan
 /**
  * Sets the layout template file to use.
  *
  * @param  string $layout Path to the layout template file, relative to
  *                        the template path.
  */
 public function setLayout($layout = '')
 {
     if ($layout === '') {
         $layout = 'layouts/empty.php';
     }
     if (file_exists(RPG_Template::getPath() . "/{$layout}")) {
         $this->_layout = RPG::template($layout);
     } else {
         throw new RPG_Exception('Specified layout "' . $layout . '" does not exist.');
     }
     $this->setContent('');
     return $this;
 }