2012-10-12 30 views
1

我想提出一个主题为我的CakePHP项目,有一个模板文件,它包括用于主页面CU3ER滑块,所以我想我需要改变这个文件到PHP代码的家伙请帮我如何在cakephp主题中添加swf文件?

swfobject.embedSWF("cu3er.swf", "cu3er-container", "960", "400", "9",   "expressInstall.swf", flashvars, attributes); 

我我试过,但没有工作

swfobject.embedSWF("<? print $this->webroot . 'swf/cu3er.swf'?>, "cu3er-container", "960", "400", "9", "<? print $this->webroot . 'swf/expressInstall.swf'?>", flashvars, attributes); 

回答

0

您可以使用App :: themePath($主题),让你的主题的路径,然后做任何你从那里想。

因此,在一个文件中:

app/views/themed/my_theme/webroot/swf/my_flash_file.swf 

能否通过一把抓:

App::themePath('my_theme').'webroot'.DS.'swf'.DS.'my_flash_file.swf'; 
+0

海Nirav Ranpara我试过,但这个不是我找 如果我说这我的代码它会得到像这样的HTML输出 swfobject.embedSWF(“<?print App :: themePath('my_theme')。'webroot'.DS.'swf'.DS.'cu3er.swf';?>,”cu3er ,“900”,“9”,“<?print $ this-> webroot。'swf/expressInstall.swf'?>”,flashvars,attributes); swfobject.embedSWF(“/ var/www/stage4/app/View/Themed/MyTheme/webroot/swf/cu3er.swf”,cu3er-container“,”960“,”400“,”9“,”/ stage4 /swf/expressInstall.swf“,flashvars,属性); 我想要/ var/www/stage4/app/webroot/swf – sudeeprds