本文整理汇总了PHP中CMenu::init方法的典型用法代码示例。如果您正苦于以下问题:PHP CMenu::init方法的具体用法?PHP CMenu::init怎么用?PHP CMenu::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMenu
的用法示例。
在下文中一共展示了CMenu::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
public function init()
{
if (!empty($this->class)) {
$this->htmlOptions['class'] = $this->class;
}
parent::init();
}
示例2: init
public function init()
{
$class = array('dropdown');
$cssFile;
if ($this->vertical) {
$class[] = 'dropdown-vertical';
if ($this->rtl) {
$class[] = 'dropdown-vertical-rtl';
$cssFile = 'dropdown.vertical.rtl.css';
} else {
$cssFile = 'dropdown.vertical.css';
}
} else {
if ($this->upward) {
$class[] = 'dropdown-upward';
$cssFile = 'dropdown.upward.css';
} else {
$class[] = 'dropdown-horizontal';
$cssFile = 'dropdown.css';
}
}
$this->htmlOptions['class'] = implode(' ', $class);
$basedir = dirname(__FILE__) . '/free-css-drop-down-menu';
$baseUrl = Yii::app()->getAssetManager()->publish($basedir);
// echo $baseUrl;
// yii::app()->end();
if ($this->themeCssFile == '') {
switch ($this->theme) {
case 'adobe':
$this->themeCssFile = 'adobe.com/default.css';
break;
case 'flikr':
$this->themeCssFile = 'flikr.com/default.css';
break;
case 'lwis':
$this->themeCssFile = 'lwis.celebrity/default.css';
break;
case 'mtv':
$this->themeCssFile = 'mtv.com/default.css';
break;
case 'nvidia':
$this->themeCssFile = 'nvidia.com/default.css';
break;
case 'vimeo':
$this->themeCssFile = 'vimeo.com/default.css';
break;
case 'default':
default:
$this->themeCssFile = 'default/default.css';
break;
}
}
Yii::app()->getClientScript()->registerCSSFile($baseUrl . '/css/dropdown/' . $cssFile)->registerCSSFile($baseUrl . '/css/dropdown/themes/' . $this->themeCssFile);
// Yii::app()->getClientScript()->registerScriptFile($baseUrl.'/js/jqueryslidemenu.js');
// Yii::app()->getClientScript()->registerCSSFile($baseUrl.'/css/jqueryslidemenu.css');
//ToDo: these should added just for IE7, i don't know how to do this
// Yii::app()->getClientScript()->registerCoreScript('jquery')
// ->registerScriptFile($baseUrl.'/js/jquery.dropdown.js');
parent::init();
}
示例3: init
public function init()
{
parent::init();
$this->activateParents = true;
$this->htmlOptions = array('class' => 'nav nav-list');
$this->submenuHtmlOptions = array('class' => 'nav nav-list');
}
示例4: init
public function init()
{
parent::init();
$cs = Yii::app()->clientScript;
$cs->registerScriptFile(Yii::app()->theme->baseUrl . '/js/bootstrap.js', CClientScript::POS_END);
Yii::app()->clientScript->registerCoreScript('jquery');
}
示例5: init
function init()
{
parent::init();
if (!empty($this->htmlOptions['class'])) {
$this->htmlOptions['class'] .= ' iconized';
} else {
$this->htmlOptions['class'] = 'iconized';
}
Yii::app()->clientScript->registerCssFile(Yii::app()->assetManager->publish(dirname(__FILE__) . '/assets/iconizedMenu.css'));
if ($this->useSprites) {
$domains = array();
foreach ($this->items as $item) {
$components = parse_url($item['url']);
$domains[] = $components['host'];
}
$spriteUrl = $this->yandexBaseUrl . implode('/', $domains);
$offset = 0;
foreach ($this->items as &$item) {
$item['linkOptions']['style'] = "background-image: url({$spriteUrl}); background-position: 0 {$offset}px";
$offset -= 16;
}
} else {
foreach ($this->items as &$item) {
$components = parse_url($item['url']);
$iconUrl = $this->iconizerBaseUrl . $components['host'];
$item['linkOptions']['style'] = "background-image: url({$iconUrl})";
}
}
}
示例6: init
public function init()
{
// Here we define query conditions.
$criteria = new CDbCriteria();
$criteria->limit = 2;
$criteria->condition = '`status` = 1';
//$criteria->order = '`position` ASC';
$items = CmsPages::model()->findAll($criteria);
//echo "items"."<pre>";print_r($items);die;
foreach ($items as $item) {
$this->items[] = array('label' => $item->title, 'url' => Yii::app()->createUrl("user/pages", array('id' => $item->id)));
}
// footer
/* $criteria1 = new CDbCriteria;
$criteria1->condition = '`status` = 1';
//$criteria->order = '`position` ASC';
$footeritems = CmsPages::model()->findAll($criteria1);
//echo "items"."<pre>";print_r($footeritems);die;
foreach ($footeritems as $footer)
$this->items[] = array('label'=>$footer->title, 'url'=>Yii::app()->createUrl("user/pages",array('id'=>$footer->id)));
*/
parent::init();
}
示例7: init
public function init()
{
$assets = Yii::app()->assetManager->publish(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets', false, -1, true);
$cs = Yii::app()->getClientScript();
$cs->registerCssFile($assets . '/emenu.css');
parent::init();
}
示例8: init
public function init()
{
$this->htmlOptions = array('class' => 'profile-sidebar-menu');
$this->id = 'profile-sidebar-menu';
$this->activeCssClass = 'active';
parent::init();
}
示例9: init
/**
* Initializes the menu widget.
*/
public function init()
{
if (isset($this->htmlOptions['class'])) {
$this->htmlOptions['class'] .= ' ' . $this->type;
} else {
$this->htmlOptions['class'] = $this->type;
}
parent::init();
}
示例10: init
/**
*
*/
public function init()
{
if ($this->cssFile === null) {
$file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'responsiveCMenu.css';
$this->cssFile = Yii::app()->getAssetManager()->publish($file);
}
Yii::app()->clientScript->registerCssFile($this->cssFile);
parent::init();
}
示例11: init
/**
* Initialize the widget
*/
public function init()
{
// if (!$this->getId(false))
// $this->setId('cssmenu');
$this->nljs = "\n";
$this->items = $this->cssParentItems($this->items);
//$this->items=$this->cssLastItems($this->items);
parent::init();
}
示例12: init
/**
* Initialize the widget
*/
public function init()
{
if (!$this->getId(false)) {
$this->setId('nav');
}
$this->nljs = "\n";
$this->items = $this->cssParentItems($this->items);
$this->items = $this->cssLastItems($this->items);
parent::init();
}
示例13: init
public function init()
{
$model = MenuModel::model()->enabled()->findAll();
$result = array();
foreach ($model as $item) {
$result[] = array('label' => $item->label, 'url' => $item->url, 'active' => $this->isActive($item->url));
}
$this->items = CMap::mergeArray($result, $this->items);
parent::init();
}
示例14: init
public function init()
{
for ($i = 2013; $i <= date("Y"); $i++) {
if ($i == $this->id_select) {
echo "<option value='" . $i . "' selected>" . $i . "</option>";
} else {
echo "<option value='" . $i . "'>" . $i . "</option>";
}
}
parent::init();
}
示例15: init
public function init()
{
// Here we define query conditions.
$criteria = new CDbCriteria();
//$criteria->condition = '`status` = 1';
$criteria->order = '`id` ASC';
$items = CmsvideoMenu::model()->findAll($criteria);
foreach ($items as $item) {
$this->items[] = array('label' => $item->menu_text, 'url' => $item->menu_link);
}
parent::init();
}