2012-10-12 29 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