Greetings!
I'm not good with PHP or phalcon, so apologize for what may be a vary basic question.
I want to have a link like this:
https://example.com/items/show/my-unique-slug
instead of
https://example.com/items/show/5
In my ItemsController I have the following:
public function indexAction()
{
$this->view->title = 'Items';
$this->view->items = Items::find(
[
"order" => "id",
"limit" => 10,
]
);
}
public function showAction($id)
{
$this->view->title = 'Show Item';
$this->view->items = Items::find($id);
}
Changing the param on showAction from $id
to $slug
will do nothing (I have a unique $slug for each item in the model) and the view will still only be accessible by the id.
Can anyone help me solve this?
Thanks