$this->view->assign("tag","<font color=red>".$tag."</font>");
   $this->view->display('editor');
请问一下这句话在这个程序中可以这么用吗"<font color=red>".$tag."</font>",这个问题困扰我好久了啊

解决方案 »

  1.   

    这要看 $tag 是什么数据类型了,如果是字符串或数值,那应该是可以的另外你应该说明一下你用的框架或模板引擎
      

  2.   

    这一句应该是写在Action中的吧,这是正常的php语句当然可以使用
      

  3.   

    $this->view->assign("tag","<font color=red>".$tag."</font>");跟$tag = "<font color=red>".$tag."</font>";
    $this->view->assign("tag", $tag);这两个是一样的。