2015-07-06 45 views
0

我使用它包含了下面的一段代碼Magento的模板A HREF:PHP回聲手動

 <link rel="stylesheet" id="emcssvariation" type="text/css" media="all" href="<?php echo $this->getSkinUrl('css/theme.css.php').'?'.http_build_query($setting->getAllCssConfig(), '', '&amp;'); ?>"/> 

目前導致:

http://myshop.com/home/skin/frontend/default/galarainbow/css/theme.css.php?p_bg_color=%23ffffff&page_bg_image=url%28..%2Fimages%2Fstripes%2Fblank.gif%29&page_bg_position=&page_bg_repeat=&general_font=&h1_font=300+38px%2F1.15+%27Lato%27%2C+sans-serif&h2_font=600+22px%2F1.25+%27Lato%27%2C+sans-serif&h3_font=600+18px%2F1.25+%27Lato%27%2C+sans-serif&h4_font=600+16px%2F1.35++%27Lato%27%2C+sans-serif&h5_font=500+14px%2F1.35+%27Lato%27%2C+sans-serif&h6_font=normal+12px%2F1.35+%27Lato%27%2C+sans-serif&additional_css_file=custom.css&custom_css=&h_text_color=%23595958&h_text2_color=%230f6338&h_text3_color=&h_line_color=&h_line2_color=%238CC63F&h_line3_color=&h_bg_color=&h_bg2_color=&h_bg3_color=&h_bg_image=url%28..%2Fimages%2Fstripes%2Fblank.gif%29&h_bg_position=&h_bg_repeat=&tm_bg_color=%238cc63f&tm_hover_bg_color=%230f6338&tm_text_color=&tm_hover_text_color=&tm_line_color=%23fff&tm_line2_color=%23fff&tm_font=normal+13px%2F1.35+%27Lato%27%2C+sans-serif&dm_bg_color=%23ffffff&dm_text_color=%23424242&dm_text2_color=%23424242&dm_text3_color=%230f6338&dm_font=normal+15px%2F1.35+%27Lato%27%2C+sans-serif&bd_bg_color=&bd_bg_image=url%28..%2Fimages%2Fstripes%2Fblank.gif%29&bd_bg_position=&bd_bg_repeat=&bd_bg2_color=%238cc63f&bd_bg3_color=&bd_bg4_color=%230f6338&bd_text_color=&bd_text2_color=&bd_text3_color=&bd_text4_color=%230F6338&bd_text5_color=&bd_text6_color=%230F6338&bd_text7_color=%23ffffff&bd_line_color=&bd_line2_color=&bd_box_shadow=&bd_rounded_corner=5&f_bg_color=%231b1b1b&f_bg_image=url%28..%2Fimages%2Fstripes%2Fblank.gif%29&f_bg_position=&f_bg_repeat=&f_bg2_color=%23282828&f_text_color=%23aaaaaa&f_text2_color=%23ffffff&f_text3_color=+%23ffffff&f_text4_color=&f_line_color=%23282828&f_line2_color=&btn1_bg_color=%23000000&btn1_text_color=&btn1_line_color=&btn1_font=300+16px%2F1.35+%27Lato%27%2C+sans-serif&btn2_bg_color=%238CC63F&btn2_text_color=&btn2_line_color=%230F6338&btn2_font=300+16px%2F1.35+%27Lato%27%2C+sans-serif&btn3_bg_color=%230F6338&btn3_text_color=&btn3_line_color=%230F6338&btn3_font=300+16px%2F1.35+%27Lato%27%2C+sans-serif 

然而理想的,因爲這是導致有問題的我們的CDN我想使用硬編碼的URL而不是getskinURL。解決這個問題的最佳方法是什麼?

+0

除非我誤解了你的問題,你應該可以設置'href =「/ path/to/your/file.css」'。 –

+0

嗨,謝謝你的回答。不,還有一個動態的部分。我修改了上面的帖子,所以基本上我想手動替換http://myshop.com/home/skin/frontend/default/galarainbow/css/ part – dvoip

+0

那麼,你想達到什麼目的? –

回答

1

請注意,硬編碼的URL永遠不是一個好方法。 Magento使用getSkinUrl的方式是最好的方法。但是,您想要達到的目標可以通過以下方式實現:

$ cssURL = $ _SERVER ['SERVER_NAME']。 '家/護膚/前端/默認/ galarainbow/CSS/theme.css.php';

希望這有助於!