Browse Source

Git attributes

Mark Scherer 10 years ago
parent
commit
4d5e02f4b3
2 changed files with 19 additions and 4 deletions
  1. 10 0
      .gitattributes
  2. 9 4
      src/View/Helper/FormatHelper.php

+ 10 - 0
.gitattributes

@@ -2,3 +2,13 @@
 # Set default behaviour, in case users don't have core.autocrlf set.
 # Set default behaviour, in case users don't have core.autocrlf set.
 * text=auto
 * text=auto
 * text eol=lf
 * text eol=lf
+
+# Denote all files that are truly binary and should not be modified.
+*.png binary
+*.jpg binary
+*.gif binary
+*.ico binary
+*.mo binary
+*.pdf binary
+*.dll binary
+*.exe binary

+ 9 - 4
src/View/Helper/FormatHelper.php

@@ -247,9 +247,9 @@ class FormatHelper extends Helper {
 	 *
 	 *
 	 * @param string $icon (constant or filename)
 	 * @param string $icon (constant or filename)
 	 * @param array $options :
 	 * @param array $options :
-	 * - translate, ...
+	 * - translate, title, ...
 	 * @param array $attributes :
 	 * @param array $attributes :
-	 * - title, alt, ...
+	 * - class, ...
 	 * @return string
 	 * @return string
 	 */
 	 */
 	public function icon($icon, array $options = [], array $attributes = []) {
 	public function icon($icon, array $options = [], array $attributes = []) {
@@ -257,8 +257,13 @@ class FormatHelper extends Helper {
 			'translate' => true,
 			'translate' => true,
 		];
 		];
 		$options += $defaults;
 		$options += $defaults;
-		if (empty($attributes['title'])) {
-			$attributes['title'] = Inflector::humanize($icon);
+
+		if (!isset($attributes['title'])) {
+			if (isset($options['title'])) {
+				$attributes['title'] = $options['title'];
+			} else {
+				$attributes['title'] = Inflector::humanize($icon);
+			}
 		}
 		}
 
 
 		return $this->_fontIcon($icon, $options, $attributes);
 		return $this->_fontIcon($icon, $options, $attributes);