ms2014
(Masoud Sawari)
1
Hi, this is part of my code:
public function actionSee($t)
{
$c = Post::model()->count('title like :t', array(':t'=>"%$t"));
// other stuff
}
and in configuration file I put this:
'<controller:\w+>/<action:\w+>/<t:\w+>'=>'<controller>/see',
but the count() reterned 0. Why?
What is the value of $t and what should it match? You only have a wildcard at the beginning.
ms2014
(Masoud Sawari)
3
The value of $t Initialized by URL request. for example:
http://www.example.com/post/see/ti/
ti value sent to the method parameter ($t). I wold like make SQL Query like this:
select count(*) from post where title like '%v'