浏览代码

allow overwriting of meta robots

Mark Scherer 10 年之前
父节点
当前提交
5c7345a61c
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      View/Helper/CommonHelper.php

+ 3 - 3
View/Helper/CommonHelper.php

@@ -234,7 +234,7 @@ class CommonHelper extends AppHelper {
 	/**
 	 * Convenience method for clean ROBOTS allowance
 	 *
-	 * @param string $type - private/public
+	 * @param string|array $type - private/public or array of (noindex,nofollow,noarchive,...)
 	 * @return string HTML
 	 */
 	public function metaRobots($type = null) {
@@ -243,10 +243,10 @@ class CommonHelper extends AppHelper {
 		}
 		$content = [];
 		if ($type === 'public') {
-			$this->privatePage = false;
 			$content['robots'] = ['index', 'follow', 'noarchive'];
+		} elseif (is_array($type)) {
+			$content['robots'] = $type;
 		} else {
-			$this->privatePage = true;
 			$content['robots'] = ['noindex', 'nofollow', 'noarchive'];
 		}