public function flag($fieldName, $options = []) {
		if (!empty($fieldName)) {
			$this->setEntity($fieldName);
		}

		$this->unlockField($this->field());
		if (!is_array($options)) {
			$options = [];
		}
		$defaultOptions = $this->_getOptionsForElem('flag.defaultOpt');
		$options = $defaultOptions + $options;
		$divClass = 'form-group';
		$label = '';
		$list = [];
		$options = $this->_optionsOptions($options);
		if (isset($options['label'])) {
			$label = $this->label($fieldName, $options['label'], ['class' => 'control-label']);
		}
		if (isset($options['options'])) {
			$list = $options['options'];
		}
		$listExtraOptions = $this->_getOptionsForElem('flag.extraOpt');
		$this->_prepareExtraOptions($options, $listExtraOptions);
		$errors = FormHelper::error($fieldName, null, ['class' => 'help-block']);
		if (!empty($errors)) {
			$divClass .= ' has-error error';
		}
		$divOptions = [
			'id' => $this->domId($fieldName),
			'data-input-name' => $this->_name(null, $fieldName),
			'data-selected-country' => $this->value($fieldName),
		];
		$divOptionsDefault = $this->_getOptionsForElem('flag.divOpt');
		if (!empty($list)) {
			$divOptions['data-countries'] = json_encode($list);
		}
		foreach ($listExtraOptions as $extraOptionName) {
			if (isset($options['data-' . $extraOptionName])) {
				$divClass['data-' . $extraOptionName] = $options['data-' . $extraOptionName];
			}
		}
		$result = $this->Html->div($divClass, $label .
			$this->Html->div(null, '', $divOptions + $divOptionsDefault) . $errors);

		return $result;
	}