<?php echo $this->createAbsoluteUrl('', array("id" => $id)) . "<br>"; echo $this->createUrl('', array("id" => $id)); ?>
На выходе:
- http://bio/index.php?r=ad/view&id=
- /index.php?r=ad/view&id=
<?php echo $this->createAbsoluteUrl('', array("id" => $id)) . "<br>"; echo $this->createUrl('', array("id" => $id)); ?>
public function actionView($id) { $model = $this->loadModel($id); if(!Yii::app()->request->cookies[$id]) { $cookie = new CHttpCookie($id, true); $cookie->expire = time() + 3600; Yii::app()->request->cookies[$id] = $cookie; //сохраняем в БД в поле "hits" (не забудьте создать) $model->saveCounters(array('hits' => 1)); } $this->render('view', array('model'=>$model,)); }
<a href="#" rel="tooltip" data-placement="left" data-trigger = "hover" title="" data-html="true" data-title="<strong>placement</strong><br>Tooltip on left">Tooltip</a>
<?php Yii::app()->clientScript->registerScript("", "$('.ipopover').popover();", CClientScript::POS_READY) ?>
<?php echo CHtml::Link('<i class="icon-info-sign"></i>', null, array(
'class' => 'ipopover',
'data-trigger' => 'hover',
'data-title' => 'Your title',
'data-content' => 'Your content',
))?>