Skip to content

Commit

Permalink
Исправил метод получающий доступ к компоненту Api,
Browse files Browse the repository at this point in the history
исправил порядок параметров при выводе js
  • Loading branch information
Руслан committed Nov 21, 2014
1 parent ca9d65c commit fee95f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mirocow/yandexmaps/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ protected function registerScriptFile()
$this->api_version
.'/?lang=' . $this->language
. '&load=' . $this->packages;
Yii::$app->view->registerJsFile($url, [], ['position' => View::POS_END]);

Yii::$app->view->registerJsFile($url, ['position' => View::POS_END], []);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions mirocow/yandexmaps/Canvas.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ class Canvas extends Widget
*/
public function getApi()
{
return Yii::$app->getComponent(self::$componentId);
return Yii::$app->{self::$componentId};
}

public function init(){
Event::on(View::className(), View::EVENT_AFTER_RENDER, function ($event) {
if(!$this->isRendered){
Yii::$app->getComponent('yandexMapsApi')->render();
$this->getApi()->render();
$this->isRendered = true;
}
});
Expand Down

0 comments on commit fee95f9

Please sign in to comment.