【发布时间】:2012-02-01 14:37:32
【问题描述】:
我希望能够从 CakePHP 中的视图(或控制器,如果可能的话)添加元标记
我有一个类似/mycontroller/myview 的页面,但是当它使用以下过滤器访问时:
/mycontroller/myview/page:2/max_price:500
然后我想添加meta no follow标签。
HtmlHelper 类上有一个meta 方法。
当我这样称呼它时:
$this->Html->meta('keywords', 'test test test', array('inline'=>false));
它会创建一个这样的元标记:
<meta name="keywords" content="test test test" />
但是,当我这样称呼它时:
$this->Html->meta('robots', 'noindex, nofollow', array('inline'=>false));
我自然会期望并想要它来创建这个:
<meta name="robots" content="noindex, nofollow" />
但我得到了这个:
<link href="http://www.example.com/mycontroller/noindex, nofollow" type="application/rss+xml" rel="alternate" title="robots" />
我做错了什么?
【问题讨论】:
标签: cakephp cakephp-1.3