Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for title option #35

Closed
wants to merge 1 commit into from
Closed

Fix for title option #35

wants to merge 1 commit into from

Conversation

evilito
Copy link

@evilito evilito commented May 14, 2015

A variable is considered empty if it does not exist or if its value equals FALSE. Therefore, setting the title option to false was not having the desired effect of removing the title from the append/prepend components. Changed function to isset that determines if a variable is set and is not NULL. To summarize: empty(false) return true but !isset(false) returns false.

A variable is considered empty if it does not exist or if its value equals FALSE. Therefore, setting the title option to false was not having the desired effect of removing the title from the append/prepend components. Changed function to isset that determines if a variable is set and is not NULL. To summarize: empty(false) return true but !isset(false) returns false.
@@ -222,7 +222,7 @@ protected function renderAddon(&$options, $type = 'picker')
$icon = ($type === 'picker') ? 'calendar' : 'remove';
Html::addCssClass($options, 'input-group-addon kv-date-' . $icon);
$icon = '<i class="glyphicon glyphicon-' . ArrayHelper::remove($options, 'icon', $icon) . '"></i>';
if (empty($options['title'])) {
if (!isset($options['title'])) {
$title = ($type === 'picker') ? Yii::t('kvdate', 'Select date') : Yii::t('kvdate', 'Clear field');
if ($title != false) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition will never get executed. $title is always set to a valid string before.

@kartik-v kartik-v added the bug label Jun 26, 2015
@kartik-v
Copy link
Owner

I will provide a fix for this via this PR.

@kartik-v
Copy link
Owner

Resolved via 5771894.

@kartik-v kartik-v closed this Jun 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants