Heim  >  Artikel  >  Backend-Entwicklung  >  zend studio工程中html文件中不识别php定义的恒量

zend studio工程中html文件中不识别php定义的恒量

WBOY
WBOYOriginal
2016-06-13 12:18:181233Durchsuche

zend studio工程中html文件中不识别php定义的常量
html中的css链接是这样的,

TEST_CSS是在php中定义的常量路径,但是在zend studio中 html还是会有error,error如下

Multiple annotations found at this line:
- Undefined CSS file ({TEST_CSS}/
 comm.css).
- Invalid location of tag (link).

apache起来以后,系统运行起来没问题,CSS文件也能找到,【而且我在html的body的里可以在页面中打印出常量 {TEST_CSS} 的路径值 】, 就是在zend studio中会出现error.   我想xdebug,有这种错误debug不了吧 

请问这样的问题改怎么处理,谢谢~


------解决思路----------------------
1、href="{TEST_CSS}/comm.css"
并非 php 常量,即便是常量,也不能这样写
这只不过是个字符串标识而已
2、这个 html 被 php 使用,在使用时对标识做了替换,因此真实运行时并不会有问题
3、编辑器并不可能知道这个文件是被谁使用了(高级的编辑器也只能知道他使用了哪些文件)
4、调试这个 html 时,你可以建一个名为 {TEST_CSS} 的目录,把相关文件放进去

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn