Video Lesson: Reserved keywords within controller actions in Magento

Reserved keywords within controller actions in Magento

This is premium content

Only available to enrolled or University students.
Join today to unlock all lessons in this course.

Reserved keywords within controller actions in Magento

Magento controller reserved keywords: fix List action by renaming to ListAction and updating route for blog post list.

Lesson Content

Our controller is listening for responses at /blog, but you’ll probably want this at a more syntactically correct route. You can then forward responses from /blog to that better-named route.

Since we’re using /blog/post/detail for the detail route, a better corresponding route for the list view is /blog/post/list. Create a controller for that route in the Post directory named List.php.

Copy the contents of your existing Detail.php file into this new file. Update the die statement to say “Blog post list”, and change its class name to List.

Premium content

Enroll to unlock the full content and all course materials.

Maggie

Hey, I'm Maggie! 👋

Ask me anything.

Want to chat with Maggie?

Enroll in this course for AI tutor access.

Comments

Join the discussion!

Comments

Want to comment on this lesson?

Enroll in this course to leave comments.