[size="3"]Here it is[/size]
[list=1]
[*]Setup your application. Below are the minimum configuration, just for the purpose of getting the extension running:
// Configure the db application component to suit your needs.
'db'=>array(
'connectionString' => 'mysql:host=127.0.0.1;dbname=myblog',
'emulatePrepare' => true,
'username' => 'username',
'password' => 'password',
'charset' => 'utf8',
'schemaCachingDuration' => 3600,
),
'urlManager'=>array(
'class'=>'ext.DbUrlManager.EDbUrlManager',
'urlFormat'=>'path',
'connectionID'=>'db',
'rules'=>array(
'<post:[\w-]+>'=>array(
'post/view',
'type'=>'db',
'fields'=>array(
'post'=>array(
'table'=>'tbl_post',
'field'=>'post_slug'
),
),
),
),
),
[*]Prepare the data (mysql example):
[sql]
create database myblog;
use myblog;
create table tbl_post (post_slug varchar(100));
insert into post values (‘first-post’),(‘another-post’);
[/sql]
[*]Have a controller (the route is post/view, then we will need a PostController) and an action (actionView):
// If you have trouble, try extending from Controller instead.
class PostController extends CController
{
public function actionView()
{
$this->render('view', array(
'post' => isset($_GET['post'])?$_GET['post']:'',
));
}
}
[*]And a view
<h1>Post View Test</h1>
<br />
<?php
if (isset ($post)) echo "post: $post";
?>
[/list]
If you still have trouble, reset your cache.