Posts Tagged with link

Displaying 1-10 of 11 results.
Wiki: Yii 1: Как задавать стили css (class, id) для CMenu, пунктов меню и ссылок в менюwiki
posted by admin on October 10, 2016
Часто хочется задать свои стили css, своё оформление для меню CMenu. Это сводится к добавлению классов и идентификаторов id в html (виджет Cmenu формирует ненумерованный список <ul>, <li>;). В Yii для этих целей предусмотрены htmlOptions, itemOptions, and linkOptions.
1. Добавление названий id и class к CMenu.
Используются id и htmlOptions для добавления своих идентификаторов и классов.

//in your view
$this->widget('zii.widgets.CMenu', array(
'id'=>'myMenu',
'items'=>$this->myMenu,
'htmlOptions'=>array('class'=>'span-24 last'),
'encodeLabel'=>false, // чтобы можно было в label использовать html-теги (жирность, наклон, цвет и т.д.)
));

Это сформирует следующий html:

<ul class="span-24 last" id="myMenu">
...
</ul>

2. Добавление названий классов (class names) к пунктам CMenu (CMenu items) и ссылкам в пунктах меню (CMenu item links).
Используем itemOptions и linkOptions. Например:

//in your controller
$this->myMenu = array(
'id'=>'myMenu',
'items'=>array(
array(
'label'=>'Home',
'url'=>array('site/index'),
'itemOptions'=>array('class'=>'visited'),
'linkOptions'=>array('class'=>'bar'),
),
array('label'=>'Sign Out', 'url'=>array('site/signout')),
),
);

Эти команды позволят Yii сгенерировать следующий кусочек меню:

...
<ul id="myMenu">
<li class="visited">
<a class="bar" href="/site/index">Home</a>
</li>
...

Установив таким образом идентификаторы и классы в шаблоне html, далее расписывайте в файле стилей .css соответствующее оформление для них.Read more
Resolved: Yii CGridView buttons url target _blank not working
posted by admin on April 25, 2016
I try to target _blank my CGridView buttons

<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'media-grid',
'dataProvider'=>$media->searchadmin(),
'filter'=>$media,
'columns'=>array(
'id',
. . .
array(
'class'=>'CButtonColumn',
'template'=>'{view}{update}',
'buttons'=>array
(
'update' => array(
'url'=>'CController::createUrl("/media/update/id/{$data->primaryKey}")',
'target'=>'_blank',
),
'view' => array(
'url'=>'CController::createUrl("/media/view/id/{$data->primaryKey}")',
'target'=>'_blank',
),
),
),

),
)); ?>
Read more
Resolved: Yii Cmenu add class to item
posted by admin on April 23, 2016
I need an output like this html code

<ul class="yw0">
<li><span class="highlighter"></span><a href="#">Sign in</a>
</li>
<li><a href="#">Register</a>
</li>
</ul>


The code would be similar something but what would be the exact code to create an extra <span class="highlighter"></span> after the li tag and before the a tag**

<?php $this->widget('zii.widgets.CMenu',array(
'id'=>'menu',
'items'=>array(
array('label'=>'Signin', 'url'=>array('/site/signin')),
array('label'=>'Register', 'url'=>array('/site/register'))
),
)); ?>
Read more
Resolved: What does “javascript:void(0)” mean?
posted by admin on April 12, 2016

<a href="javascript:void(0)" id="loginlink">login</a>


I've seen such hrefs many times, but I don't know what exactly that means.Read more
Resolved: JavaScript jQuery add attribute to links, which is not belong to website and locate to another resource
posted by admin on March 11, 2016

<a href="http://isystems.am">sadsa dasd as ds</a>
<a href="http://forum.isystems.am"> sd s f f d f</a>
<a href="http://autoservice.am"> sd s f f d f</a>
<a href="http://classyluxury.ru"> sd s f f d f</a>
<a href="http://polusportpoluklassika.ru"> sd s f f d f</a>
<a href="http://classystyle.ru"> sd s f f d f</a>


I want to add attribute to my all links, which is not locate to my website. I want to open another links in new window, not in self window. I want to do it after page will be loaded.Read more
Resolved: bootstrap.css vs bootstrap-responsive.css
posted by admin on March 10, 2016
Which
bootstrap.css
vs
bootstrap-responsive.css

Please explain difference :(


<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css" media="all" />
<link rel="stylesheet" href="bootstrap/css/bootstrap-responsive.min.css" media="all" />

OR

<link rel="stylesheet" href="bootstrap/css/bootstrap-responsive.min.css" media="all" />
Read more
Resolved: Yii 1.1 How to change home name breadcrumbs to another or multilanguage
posted by admin on March 5, 2016
In main layout i have this code

<?php if(isset($this->breadcrumbs)):?>
<?php $this->widget('zii.widgets.CBreadcrumbs', array(
'links'=>$this->breadcrumbs,
)); ?><!-- breadcrumbs -->
<?php endif ?>


I want to change the word Home and include multilanguage outputRead more
Resolved: PHP add rel nofollow to links string
posted by admin on December 22, 2015
I have content in string, and I want to find all a links and add a rel="nofollow"Read more
Resolved: How to get URL of current page in PHP
posted by admin on December 25, 2015
How to get URL of current page in PHP?Read more
Resolved: Русский текст в транслит на PHP(Rus to Lat)
posted by admin on December 25, 2015
The last segment is actually the friendly title of the blog article. The problem is when I try to pass that segment to the database, the cyrillic fonts turn into something like %D1%8A%D0%B4%D1%80%D0%BE%D1%81%D1%8 and couldn't match the database record. In the address bar in my browser it looks normal (мъдростта-на-вековете) but if I choose 'copy url location' the last segment again turns into these strange characters.

Please help to convert cyrillic to english letters(lat)Read more