CakePHP: How do I reference a flash asset in my plugin's webroot?
I'm using CakePHP to build a plugin and am trying to add a flash asset to my view. The tag looks like this:
<object type="application/x-shockwave-flash" data="unknown_url" id="VideoPlayback">
<param name="movie" value="unknown_url" />
<other params....>
</object>
Unfortunately I don't know what url to point to! Given that my plugin is using standard structure (for CakePHP 1.3x) i would like to access my flash file which is stored here:
app/plugins/my_plugin/webroot/flash/my_flash_file.swf
I know that in the php side /my_plugin/flash/my_f开发者_StackOverflowlash_file.swf
gets rewritten to route correctly (this works just fine when I try something like $this->Html->img('URL')
), but I don't know of any Html Helper function to create object tags.
Any help would be appreciated!
You can use $this->Html->url()
to create correct URLs.
<object type="application/x-shockwave-flash" data="<?php echo $this->Html->url( ' /my_plugin/flash/my_flash_file.swf' ); ?>" id="VideoPlayback">
<param name="movie" value="<?php echo $this->Html->url( ' /my_plugin/flash/my_flash_file.swf' ); ?>" />
<other params....>
</object>
<?php echo $html->url('/webroot/uploadify/uploadify.swf');?>
it will give you link like /your_app_name/webroot/uploadify/uploadify.swf
精彩评论