[Yii Framework] How to get the current static page name?

时间:2022-07-03 23:44:26

By default, we can put the static pages in protected/views/site/pages.

For example, I put the static "about.php" in protected/views/site/pages.

 

The way of Yii to get the current name when to use in menu.

[Yii Framework] How to get the current static page name?[Yii Framework] How to get the current static page name?代码
   
   
   
if (
! empty (Yii :: app() -> controller -> action -> requestedView)
&& " howtowork " == strtolower (Yii :: app() -> controller -> action -> requestedView))
echo ' class="active" ' ;