Project

General

Profile

« Previous | Next » 

Revision 3ff70087

Added by Sjon Hortensius over 10 years ago

Group - only push placeholder if Input doesn't have it yet

Input - introduce hasAttribute method

refs #56

View differences:

usr/local/www/classes/Form/Group.class.php
95 95

  
96 96
		foreach ($this->_inputs as $input)
97 97
		{
98
			if (count($this->_inputs) > 1)
98
			if (count($this->_inputs) > 1 && !$input->hasAttribute('placeholder'))
99 99
				$input->setPlaceholder($input->getTitle());
100 100

  
101 101
			$width = $input->getWidth();
usr/local/www/classes/Form/Input.class.php
140 140
		return $this;
141 141
	}
142 142

  
143
	public function hasAttribute($name)
144
	{
145
		// not strict, null should return false as well
146
		return isset($this->_attributes[$name]);
147
	}
148

  
143 149
	public function setIsRepeated()
144 150
	{
145 151
		$this->_attributes['name'] .= '[]';

Also available in: Unified diff