2015-01-12 3 views

답변

0

.swf 파일을 포함하는 데는 여러 가지 방법이 있습니다.

모듈에 hook_theme() 구현을 만들어보다 적은 코드로 플래시 마크 업을 동적으로 생성 할 수 있습니다. 당신의 .module 파일에

:과 같이 다음

<object type="application/x-shockwave-flash" data="$path_to_flash" 
    width="$width" height="$height"> 

    <param name="movie" value="$path_to_flash" /> 
    <param name="quality" value="high" /> 
</object> 

우리가 그 모든 모듈 (또는 다른 모듈)에서 :

function [YOUR_MODULE]_theme($existing, $type, $theme, $path) { 
    return array(
     'mymodule_flash'=>array(
      'template' => 'flash', // create a template file to match this name 
      'path' => $path, 
      'type' => 'theme', 
      'variables' => array(
       'path_to_swf' => NULL, 
       'width' => '600', 
       'height' => '400', 
      ), 
     ), 
    ); 
} 

그런 다음 flash.tpl.php 파일을 생성

$vars = array(); 
$vars['path_to_flash'] = "path/to/flash.swf"; 
$vars['width'] = "800"; // override default value for width 
print theme('mymodule_flash', $vars); 
관련 문제