Skip to content

Commit

Permalink
Update SelectMapLocationWidget.php
Browse files Browse the repository at this point in the history
  • Loading branch information
buihoangvu authored Mar 15, 2017
1 parent e8f4f2e commit e02064f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions SelectMapLocationWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ class SelectMapLocationWidget extends InputWidget
*/
public $renderWidgetMap;

/**
* @var boolean render only map without input field
*/
public $readonly;

/**
* @var string Google API Key for Google Maps
*/
Expand Down Expand Up @@ -131,6 +136,10 @@ public function run()
return call_user_func_array($this->renderWidgetMap, [$mapHtml]);
}

if ($this->readonly) {
return $mapHtml;
}

return Html::activeInput('text', $this->model, $this->attribute, $this->textOptions) . $mapHtml;
}
}

0 comments on commit e02064f

Please sign in to comment.