1

我正在为我的 cakephp 项目制作一个主题,因为我有一个模板文件,它包括一个用于主页的 cu3er 滑块,所以我想我需要将此文件更改为 php 代码伙计们请帮助我

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);
4

1 回答 1

0

您可以使用 App::themePath($theme) 获取主题的路径,然后从那里做任何您想做的事情。

所以一个文件在:

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

可以通过以下方式获取:

App::themePath('my_theme').'webroot'.DS.'swf'.DS.'my_flash_file.swf';
于 2012-10-12T05:29:44.077 回答