Но скрипты почему-то не грузятся.
Asset
Код: Выделить всё
<?php
namespace app\modules\confirm\assets;
use yii\web\AssetBundle;
class IvrAsset extends AssetBundle
{
public $sourcePath = '@webroot';
public $js = [
'ivr.js'
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
];
}
Код: Выделить всё
<?php
use app\modules\confirm\assets\IvrAsset;
IvrAsset::register($this);
?>
<div>Test</div>
Код: Выделить всё
namespace app\modules\confirm\widgets\confirm;
use Yii;
use yii\base\Widget;
class ConfirmWidget extends Widget
{
public $phone;
public $operation;
public function run()
{
return $this->render(
'ivr',
['phone' => $this->phone, 'operation' => $this->operation]
);
}