dounglee
(Dunglqttm)
1
Hi All,
Jquery Superfish plugin is nice dropdown menu. So i tried to write an extension implement this to Yii.
Code example:
<?php
$this->widget('application.extensions.superfish.RSuperfish', array(
'items'=> array(
array('label' => 'menu item', 'url' => '#', 'items' => array(
array('label' => 'menu item', 'url' => '#'),
array('label' => 'menu item', 'url' => '#', 'items' => array(
array('label' => 'menu item', 'url' => '#')
)),
array('label' => 'menu item', 'url' => '#'),
array('label' => 'menu item', 'url' => '#')
)),
array('label' => 'menu item', 'url' => '#'),
array('label' => 'menu item', 'url' => '#'),
)));
?>
Anyone can tell me how to publish it to yii extensions page?
Thanks,
DzungLee
babyduck
(Alexandre Duran It)
2
Hello, I try your extension but raise an error with the sample code published
[size="1"][size="2"]
PHP notice
Undefined index: class
C:\xampp\htdocs\testapp\protected\extensions\superfish\RSuperfish.php(93)
081 $options['pathLevels'] = $this->pathLevels;
082 $options['delay'] = $this->delay;
083 $options['animation'] = $this->animation;
084 $options['speed'] = $this->speed;
085 $options['autoArrows'] = $this->autoArrows;
086 $options['dropShadows'] = $this->dropShadows;
087 $options['disableHI'] = $this->disableHI;
088
089 return CJavaScript::encode($options);
090 }
091
092 function run(){
093 if($this->htmlOptions['class']) {
094 $this->htmlOptions['class'] .= " sf-menu";
095 } else {
096 $this->htmlOptions['class'] = " sf-menu";
097 }
098
099
100
101 $cs = Yii::app()->getClientScript();
102 $id = $this->getId();
103 $assets = Yii::app()->getAssetManager()->publish(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets');
104
105 $cs->registerCssFile($assets.'/css/superfish.css');
[/size][/size]
paulo.vin
(Paulo Vin)
3
It worked for me.
All I had to do was replacing line 93 for the following:
if(isset($this->htmlOptions['class'])) {