Adding php with options with addCss in Magento

I am using a php file as a stylesheet. This works very well when there are no options.

<action method="addCss"> <stylesheet>style.php</stylesheet> </action> 

But as soon as I add the parameter to the request, Magento no longer knows that this file is in my own theme, but uses the default theme path. Of course, since there is no file named style.php? Param = val and therefore the general reserve is used. But how can I get Magento to use my theme, whether it finds a file or not?

 <action method="addCss"> <stylesheet>style.php?param=val</stylesheet> </action> 
+4
source share
1 answer

The addItem method is less restrictive. addJs and addCss checks if the file exists. Try instead:

 <action method="addItem"> <type>link_rel</type> <name>style.php?param=val</name> <params>rel="stylesheet" type="text/css"</params> </action> 

:)

+4
source

Source: https://habr.com/ru/post/1441551/


All Articles