Thanks, but I have still the problem to get the parameter from URL.
I changed the code to:
class BaseController extends \yii\base\Controller {
public function beforeAction($action) {
if (parent::beforeAction($action)) {
echo "before";
// your custom code here
return true; // or false if needed
} else {
return false;
}
}
}
The problem I did not get the "id" from URL:
in
class SiteController extends BaseController
{
public function actionIndex($id = null)
{
echo $id ;
}
}
If I don’t extend BaseController, but Yii Controller it works fine:
class SiteController extends \yii\base\Controller
{
public function actionIndex($id = null)
{
echo $id ;
}
}