可以使用ack
搜索Smarty模板文件(.tpl)中的内容吗?ack搜索Smarty TPL模板文件内的内容
目前我只能在这些模板的缓存版本中搜索,这些模板本身就是PHP文件。
如果我做一个不区分大小写的ack
搜索这样的下面,这是返回什么:
[[email protected] dev_crmpicco]$ ack -i select\ the\ course
cache/templates/gb/%%9B^9B3^9B37B147%%course.tpl.php
48: <p><label>Select the course:</label></p>
64: <p><label>Select the course:</label></p>
83: <p><label>Select the course:</label></p>
我试过'ack --type-add = smarty = .tpl',但没有运气:'ack:--type-add:类型“smarty”不存在,用“.tpl”创建...' – crmpicco
我的错误,它是'--type-set'。 '--type-add'为现有类型添加扩展。但是,你仍然应该选择.tpl文件。做一个'ack -f'来查看ack选择要搜索的文件。 –
出于某种原因,我似乎无法使用该命令将Smarty模板添加到我的'.ackrc'文件中。这就是我正在做的:'ack --type-set = smarty = .tpl',我得到一个错误:'ack:找不到正则表达式。“这是预期的吗? – crmpicco