I’m new on Yii. Thanks for your work great.
My question is basic. Is there a way to get parameter on function so see the code below:
class PostController extends CController
{
public function actionCreate($category, $language)
{
// ... fun code starts here ...
}
}
instead of
class PostController extends CController
{
public function actionCreate()
{
if(isset($_GET['category']))
$category=(int)$_GET['category'];
else
throw new CHttpException(404,'invalid request');
if(isset($_GET['language']))
$language=$_GET['language'];
else
$language='en';
// ... fun code starts here ...
}
}
thanks