Commits

Christoffer Niska committed efe5468

added support for inputs with both prepend and append (fixes #41)

  • Participants
  • Parent commits 41d37c2
  • Branches 1.0.0-wip

Comments (0)

Files changed (1)

widgets/input/BootInput.php

 			return '';
 	}
 
+	/**
+	 * Returns the prepend element for the input.
+	 * @param array $htmlOptions additional HTML attributes
+	 * @return string the element
+	 */
 	protected function getPrepend($htmlOptions = array())
 	{
 		if ($this->hasAddOn())
 			return '';
 	}
 
+	/**
+	 * Returns the append element for the input.
+	 * @param array $htmlOptions additional HTML attributes
+	 * @return string the element
+	 */
 	protected function getAppend($htmlOptions = array())
 	{
 		if ($this->hasAddOn())
 			return '';
 	}
 
+	/**
+	 * Returns the input container CSS classes.
+	 * @return string the classes
+	 */
 	protected function getInputContainerCssClass()
 	{
+		$class = array();
 		if (isset($this->htmlOptions['prepend']))
-			return 'input-prepend';
-		else if (isset($this->htmlOptions['append']))
-			return 'input-append';
-		else
-			return '';
+			$class[] = 'input-prepend';
+		if (isset($this->htmlOptions['append']))
+			$class[] = 'input-append';
+
+		return implode(' ', $class);
 	}
 
+	/**
+	 * Returns whether the input has an add-on (prepend and/or append).
+	 * @return boolean the result
+	 */
 	protected function hasAddOn()
 	{
 		return isset($this->htmlOptions['prepend']) || isset($this->htmlOptions['append']);