Closed EdwinHuijsing closed 2 months ago
I think it should use pathFor
as you show.
This will need an update to the text of the tutorial as well as the source code.
As a starting point, please check the newer Slim-Skeleton repo: https://github.com/slimphp/Slim-Skeleton Closing this as resolved.
After installing the project in a sub directory the tickets page it did not work. It was not possible to add new items, the URL to add new items is wrong. When I changed it manually it worked. To solve it “easy way” I used a virtual site, but that is workable on the long run.
After some testing I removed the virtual site, but this time I was able to view the details without any problems. Then I note that view detail uses
pathFor
, but that is not done for Add new ticket. The URL for new tickets is hard coded.From tickets.phtml
Line 9
<p><a href="/ticket/new">Add new ticket</a></p>
line 31
<a href="<?=$router->pathFor('ticket-detail', ['id' => $ticket->getId()])?>">view</a>
Is this done on purpose?
I solved it this way:
file index.php line 72 change
to
file tickets.phtml line 9 change
to
Is this the way to go, or should it be done in an other way?