mirror of
				https://github.com/yiisoft/yii2.git
				synced 2025-11-04 06:37:55 +08:00 
			
		
		
		
	Merge pull request #1798 from zhuravljov/patch-1
Fixed label attributes in BaseHtml
This commit is contained in:
		@ -961,9 +961,9 @@ class BaseHtml
 | 
				
			|||||||
	 */
 | 
						 */
 | 
				
			||||||
	public static function activeLabel($model, $attribute, $options = [])
 | 
						public static function activeLabel($model, $attribute, $options = [])
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
 | 
							$for = array_key_exists('for', $options) ? $options['for'] : static::getInputId($model, $attribute);
 | 
				
			||||||
		$attribute = static::getAttributeName($attribute);
 | 
							$attribute = static::getAttributeName($attribute);
 | 
				
			||||||
		$label = isset($options['label']) ? $options['label'] : static::encode($model->getAttributeLabel($attribute));
 | 
							$label = isset($options['label']) ? $options['label'] : static::encode($model->getAttributeLabel($attribute));
 | 
				
			||||||
		$for = array_key_exists('for', $options) ? $options['for'] : static::getInputId($model, $attribute);
 | 
					 | 
				
			||||||
		unset($options['label'], $options['for']);
 | 
							unset($options['label'], $options['for']);
 | 
				
			||||||
		return static::label($label, $for, $options);
 | 
							return static::label($label, $for, $options);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user