Skip to content

loktionov/superbanner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

superbanner

Генерация кода рекламных баннеров

Config

'components' => [
'superbanner' => [
            'class'=>'loktionov\superbanner\Superbanner',
            'bannercount' => 100,
        ]
]

Controller

$sb = Yii::$app->superbanner;
//или так, если не объявлять как компонент в конфиге
$sb = new Superbanner();

$s1 = $sb->GetBanners(12);
$s2 = $sb->GetBanners(24);
$s3 = $sb->GetBanners('18%', 'superbanner2');
$s4 = $sb->GetBanners('56');

$s5 = Yii::$app->superbanner->GetBanners(12);

return $this->render('index', ['banners'=>$s3]);

View

foreach($banners as $b) {
    echo $b;
}
$this->registerJs(
    '$("document").ready(function(){
     var hsh = window.location.hash.substring(1);
     if(hsh != "")
      $("#" + hsh).css("border", "1px solid red");
    });'
); 

About

Генерация кода рекламных баннеров

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages