I'm trying to do an aplication with Yii2 and when I add a new action to the default controller:
public function actionMostrarArticle($id)
{
$article = (new Query)->select('*')->from('subasta_actual')->where('id = :id');
$article->addParams([':id' => $id]);
$imatges = obtenir_imatges_active_from_objecteId($id);
return $this->render('article',['article' => $article, 'imatges' => $imatges]);
}
and I ask for it:
<a href="<?=Url::toRoute(['site/mostrarArticle', 'id' => $model->id]);?>">Me interesa</a>
I have the exception:
exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request: site/mostrarArticle' inexception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request: site/mostrarArticle'
Can anyone helps me?
Thanks!
Toni