javascript和php元素确实无法正常工作

时间:2018-02-23 22:53:43

标签: javascript php

我想在我的脚本中包含一个php元素。你知道吗,有可能吗?

fileFieldImageCkeditor致电CkEditor

Tk的

//   html += '<input type="file" name="option_value[' + option_value_row + '][image]" value="" accept="image/*" class="form-control" />';
    html += <?php echo $this->fileFieldImageCkeditor('option_value[\' + option_value_row + \'][image]', null, '125', '75'); ?>

我的职能:

public static function fileFieldImageCkEditor($name, $value = null, $width = null, $height = null) {
  if (is_null($height)) {
   $height = '250';
  }

  if (is_null($width)) {
    $width = '250';
  }

  $field = '<textarea name="' . HTML::output($name) . '" /></textarea>';
  $field .= '<script>
    CKEDITOR.replace(\'' . HTML::output($name) . '\',
  {
    width : '. $width .',
    height : ' . $height . ',
    filebrowserBrowseUrl :"' . OSCOM::link('Shop/ext/elFinder-master/elfinder-cke.html') . '",
 });
        </script>';
  return $field;
}

1 个答案:

答案 0 :(得分:-1)

它应该有用。如果您不匹配单引号和双引号,请准备好进行调试 您需要仔细检查您的代码,这样才能正常工作。你的第二行没有附上引号,为什么? 此外,如果分号成为问题(非常不可能),请改用PHP_EOPL。