stockregister_report_itemcode:
pattern: /stockregister/{itemcode}/{category}/report/{subcategory}/{openingbalance}/{type}/{actunit}
defaults: { _controller: "EduAssetBundle:StockRegister:stockregisterItemcodeReport" }
requirements:
itemcode: .+
category: .+
subcategory: .+
openingbalance: .+
type: .+
actunit: .+
Here i pass the {actunit} as 'box/packet' its split values parameter not working
All you parameter have pattern .+
, it is greedy. So the first possible parameter catches max possible part of url.
Change pattern for all parameters to .+?
or specify in patterns what exactly characters parameter can contain (ex: [a-z0-9]+
)
There are 2 possibilities why it may not work (any or even both):
1). You forgot to specify the HTTP verb (GET, POST, PUT, DELETE etc.).
2). Since the /
character is used to separate route elements, you should encode the value when passing it. Therefore use box%2Fpacket
instead of box/packet
.