2017年9月29日金曜日

cakephp2のliタグで囲まれたlinkメソッドをtagメソッドに書き替える

1
<li><?php echo $this->Html->link(__('users'), ['controller' => 'users', 'action' => 'index']); ?></li>
1
echo $this->Html->tag('li', $this->Html->link(__('users'), ['controller' => 'users', 'action' => 'index']), array('escape' => false));
①を②に変換 [Find]
1
(<li><\?php )(echo )(\$this->Html->link\([^;]+)(;)( \?></li>)
[Replace]
1
\2$this->Html->tag('li',\3, array('escape' => false))\4

0 件のコメント:

コメントを投稿