/product/4739to show some specific product id. For this, we use the
REQUEST_PATH_COMPONENT_TYPE_VARIABLE_NUMERICtype instead, like this:
stringlike we do with the
REQUEST_PATH_COMPONENT_TYPE_FIXEDtype for the
productpart of the path, we pass a
nameto identify the received value, and a
securityRulesarray to be sure the value we receive is secure.
viewProductaction is triggered when we receive a request like
/product/4739, and we specify that
4739will be stored as
productId, that it cannot be empty and that it has to be a positive integer.
productIdvalue that was passed when the client requested
/product/4739, we simply add a
requestparameter to the method triggered by the action (
Products::viewin the example above), and we'll get a Request object that contains, among other useful things, the value of the