Documentation

Quick Start


Quick Start

View class and DB class works nice together:


Example:

$db = DB::get_instance();
// retrieve the news list
$news_list = $db->get_list( "SELECT * FROM news" );

$tpl = new View;
$tpl->assign( "list", $news_list);
$tpl->draw( "news_list" );

 

Template (in RainTPL):

{loop="news_list"}
     <h2>{$value.title}</h2>
      {$value.time|time_format}
      {$value.content}
{/loop}
Profiler output