I am on Magento 2.1 and I have looked all over and cannot find how to accomplish what I'm looking for. I've followed a few guides (http://inchoo.net/magento-2/how-to-create-a-basic-module-in-magento-2/ etc) on how to create basic controllers and I have accomplished that. But I am trying to make a controller which brings me to a list of all my brands in my store, and then when clicking one of the brands it brings me to a page with all of the materials for that brand.
Currently I have a module with the following structure:
Brands
Block
Brand.php
Brands.php
Controller
Brand
Index.php
Index
Index.php
etc
frontend
routes.xml
module.xml
view
frontend
layout
brands_brand_index.xml
brands_index_index.xml
templates
brand.phtml
brands.phtml
registration.php
Currently when I go to mydomain/brands or mydomain/brands/index/index, it works as expected (bringing up a list of all brands). The same is true for mydomain/brands/brand or mydomain/brands/brand/index.
My question is, how to I get my controller to work for something like mydomain/brands/brand/12345 or something like that? When I try this currently, it says 404 error message.
Thanks in advance!