Yii Framework Forum: Jak Dodac Css Class Do Tagu Li Wygenerwanego Przez Cmenu - Yii Framework Forum

Jump to content

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

Jak Dodac Css Class Do Tagu Li Wygenerwanego Przez Cmenu Rate Topic: -----

#1 User is offline   kogut 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 16-May 14
  • Location:Dublin, Ireland

Posted 03 June 2014 - 06:02 AM

Czesc,


Probuje stworzyc liste skaldnikow kotra wyswietlac bedzie sie w side menu (portlet) dodatkowo bedzie mozna przeszukiwac liste uzywajac jquery serach.

Liste stworzylem ale mam problem z dodanie css class lub id do generowanego przez CMenu ul li

Widget w layaout
		$this->beginWidget('zii.widgets.CPortlet', array(
			'title'=>'Selected Ingredients',
                        'id'=>'leftPortlet',
                        ));
                    $this->widget('zii.widgets.CMenu', array(
			'items'=>$this->menu2,
			'htmlOptions'=>array('class'=>'operations'),
                    ));
		$this->endWidget();


$this->memu w view
foreach ($product_list as $list => $item) {
     $newarray[] = array('label' => $item, 'url' => array('/products/view/' . $item), 'linkOptions'=>array('id'=>'Hide'));
}
$this->menu2 = $newarray;



i to co wygenerowane:

<div class="portlet" id="leftPortlet">
<div class="portlet-decoration">
<div class="portlet-title">Selected Ingredients</div>
</div>
<div class="portlet-content">
<ul class="operations" id="yw0">
<li style="display: list-item;"><a id="Hide" href="/products/view/Butter">Butter</a></li>
<li style="display: list-item;"><a id="Hide" href="/products/view/Carrot">Carrot</a></li>
<li><a id="Hide" href="/products/view/Ham">Ham</a></li>
<li style="display: list-item;"><a id="Hide" href="/products/view/vine tomato">vine tomato</a></li>
</ul></div>
</div>


udalo mi sie dodac id="Hide" do tagu anchor, ale za chorobe nie wiem jak dodac css class do tagu li?

Wierze, ze znajde w Was wsparcie :)

Pozdrawiam!

Marcin.
0

#2 User is offline   afnwork 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 23
  • Joined: 09-May 12

Posted 03 June 2014 - 07:59 AM

$this->memu w view
foreach ($product_list as $list => $item) {
     $newarray[] = array(
          'label' => $item, 
          'url' => array('/products/view/' . $item), 
          'linkOptions'=>array('id'=>'Hide'), 
          'itemOptions' => array('class' => 'myclass')// <----
);
}
$this->menu2 = $newarray;

1

#3 User is offline   kogut 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 19
  • Joined: 16-May 14
  • Location:Dublin, Ireland

Posted 03 June 2014 - 08:02 AM

Dzieki wielkie, dziala jak powinno. Pozdrawiam!
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