Yii Framework Forum: Yii Superfish - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii Superfish Nice dropdown menu for Yii Rate Topic: -----

#1 User is offline   Dzung Le 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 29-September 11

Posted 02 March 2012 - 03:04 AM

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

Attached File(s)


0

#2 User is offline   babyduck 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 15-May 12

Posted 26 July 2012 - 05:59 AM

Hello, I try your extension but raise an error with the sample code published

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');


0

#3 User is offline   Paulo Rezende 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 08-May 12

Posted 04 August 2012 - 04:05 PM

It worked for me.

All I had to do was replacing line 93 for the following:

    if(isset($this->htmlOptions['class'])) {

0

#4 User is offline   thomsite 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 27-September 12
  • Location:Jakarta

Posted 10 October 2012 - 01:44 AM

tx bro... it is help me
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users