fastroute

What are these routing styles called in a web application?

本秂侑毒 提交于 2019-12-11 10:35:22
问题 What do you call routing that maps one URL directly to a file? Example: http://localhost/directory/file.php => /var/www/apache/htdocs/directory/file.php What do you call routing like one on https://github.com/nikic/FastRoute? Example: http://localhost/directory/file => request actually goes to a single index.php file, which then loads routing files or tables and loads appropriate class as defined in the routing table. 回答1: What do you call routing that maps one URL directly to a file? I would

How to get matched route name in View - Zend Expressive

大憨熊 提交于 2019-12-08 02:16:59
问题 I know that I can generate URL passing the route name <?php echo $this->url('route-name') #in view file ?> But can I get information in opposite direction? From current URL/URI, I need to get route name. Real case is: I have layout.phtml where is the top menu (html). Current link in the menu need to be marked with css class. So, example what I need is: <?php // in layout.phtml file $index_css = $this->getRouteName() == 'home-page' ? 'active' : 'none'; $about_css = $this->getRouteName() ==