当前位置: 首页>>代码示例>>PHP>>正文


PHP CHtml::Link方法代码示例

本文整理汇总了PHP中CHtml::Link方法的典型用法代码示例。如果您正苦于以下问题:PHP CHtml::Link方法的具体用法?PHP CHtml::Link怎么用?PHP CHtml::Link使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CHtml的用法示例。


在下文中一共展示了CHtml::Link方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getLink

 function getLink($post, $attr = true, $excerpt = true)
 {
     $postLink = '';
     $htmlOptions = '';
     //  uncomment jika ingin di tambahkan popup intro
     //if($excerpt == true){
     //    $htmlOptions =  array('onMouseOver'=>"pop(this,'.".$post->ID."');",);
     //    $postLink .= "<p class='".$post->ID." hide'>";
     //    $postLink .= $post->post_excerpt;
     //    $postLink .= "</p>";
     //}
     $postLink .= CHtml::Link($post->post_name, Yii::app()->createUrl('/photo/index', array('id' => $post->ID, 'slug' => $post->post_link)), $htmlOptions);
     $postLink .= $post->post_excerpt == '' ? "<br>" . Helper::getExcerpt($post->post_content, 0, 40) : "<br>" . Helper::getExcerpt($post->post_excerpt, 0, 40);
     if ($attr == true) {
         $postLink .= "<br><small class='text-muted'>";
         if ($post->categories != null) {
             $postLink .= CHtml::openTag('span', array('class' => 'label label-default'));
             $criteria = new CDbCriteria();
             $criteria->condition = "parent=0";
             //foreach($post->categories($criteria) as $category):
             //   $postLink .= $category->name.' ';
             //endforeach;
             $postLink .= CHtml::closeTag('span');
         }
         $postLink .= "  " . FTime::since($post->post_modified) . "</small>";
     } else {
         $postLink .= '<div class="entry-meta small muted">';
         $postLink .= FTime::since($post->post_modified);
         $postLink .= "</div>";
     }
     echo $postLink;
 }
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:32,代码来源:widget_foto.php

示例2: displayScriptItem

 public function displayScriptItem($dataitem)
 {
     echo "<li class=\"scriptitem grid_15\" >";
     echo "<div class=\"scripttitle\">";
     $linkurl = 'http://' . Yii::app()->request->getServerName() . $this->baseurl . '/script/' . $dataitem['scriptid'] . '/' . $dataitem['urltitle'];
     echo CHtml::Link($dataitem['title'], $linkurl);
     echo "</div>";
     echo "<div class=\"updownvote\" id=\"updownvote_{$dataitem['scriptid']}\">";
     echo "<div class=\"vote upvoteicon\">" . CHtml::imageButton($this->baseurl . '/images/upvote1616.png', array('id' => 'upvote_' . $dataitem['scriptid'] . "_0", 'href' => 'javascript:void(0)', 'title' => 'Up Vote', 'value' => 'Up Vote')) . "</div>";
     echo "<div class=\"votes unvoted\" id=\"votes-unvoted_{$dataitem['scriptid']}\">" . $dataitem['votes'] . "</div>";
     echo "<div class=\"votes upvoted\" id=\"votes-upvoted_{$dataitem['scriptid']}\">" . ($dataitem['votes'] + 1) . "</div>";
     echo "<div class=\"votes downvoted\" id=\"votes-downvoted_{$dataitem['scriptid']}\" >" . ($dataitem['votes'] - 1) . "</div>";
     echo "<div class=\"vote downvoteicon\">" . CHtml::imageButton($this->baseurl . '/images/downvote1616.png', array('id' => 'downvote_' . $dataitem['scriptid'] . "_0", 'href' => 'javascript:void(0)', 'title' => 'Down Vote', 'value' => 'Down Vote')) . "</div>";
     $imageId = "starimg_" . $dataitem['scriptid'] . "_" . $dataitem['isfav'];
     $favImageSrc = "{$this->baseurl}/images/stariconset/star-black/star-black16.png";
     $notfavImageSrc = "{$this->baseurl}/images/stariconset/star-white/star-white16.png";
     if ($dataitem['isfav'] == 1) {
         $imageSrc = $favImageSrc;
     } else {
         $imageSrc = $notfavImageSrc;
     }
     $img = "<img id=\"{$imageId}\"  src=\"{$imageSrc}\"/>";
     echo "<div class=\"favstardiv\">" . CHtml::Link($img, 'javascript:void(0)', array('title' => 'Add to favorites', "class" => 'favstar')) . "</div>";
     echo "</div>";
     // end updownvote
     echo "<div class=\"scriptitemmiddleline\">";
     echo "<div class=\"scriptperson\">";
     echo "By: " . CHtml::Link($dataitem['membername'], 'http://' . Yii::app()->request->getServerName() . $this->baseurl . '/scripts/' . $dataitem['membername']) . " On " . date('M j, Y', $dataitem['lastmodifieddate']->sec);
     $tagurl = 'http://' . Yii::app()->request->getServerName() . $this->baseurl . '/scripts/tagged/';
     echo "<div class='scripttags'>";
     echo "<ul class='taglist'> ";
     //echo  "<li>".CHtml::Link($dataitem['category'],$tagurl.$dataitem['category'])."</li>";
     if (!empty($dataitem['tags'])) {
         foreach ($dataitem['tags'] as $tag) {
             if (!empty($tag)) {
                 echo "<li>" . CHtml::Link($tag, $tagurl . "{$tag}") . "</li>";
             }
         }
     }
     echo "</ul>";
     echo "</div>";
     echo "</div>";
     echo "<div class=\"scriptdesc\">";
     echo nl2br($dataitem['scriptdesc']);
     echo "&nbsp;<span class=\"smalltext viewscript\"  id=\"viewscript_{$dataitem['scriptid']}\"} >" . CHtml::Link("View Script &#9660;", 'javascript:void(0)') . " </span>";
     echo "</div>";
     echo "<div class=\"script\" id=\"showscript_{$dataitem['scriptid']}\">";
     echo nl2br($dataitem['script']);
     echo "</div>";
     echo "<div class=\"scriptlastline\">";
     echo "</div>";
     echo "</div>";
     // end scriptitemmiddleline
     echo "<hr>";
     echo "</li>";
 }
开发者ID:rgummadi,项目名称:ScriptOverflow,代码行数:56,代码来源:Controller.php

示例3: headText

 public function headText()
 {
     echo CHtml::openTag('p', array('style' => 'margin:10px;', 'class' => 'pull-left'));
     echo CHtml::Link('<i class="fa fa-file"></i> Kelola Data ', array('admin'), array('class' => 'text-info'));
     echo $this->allCount();
     echo " | ";
     echo CHtml::Link(' <i class="fa fa-trash-o"></i> Sampah ', array('trash'), array('class' => 'text-error'));
     echo $this->trashCount();
     echo CHtml::closeTag('p');
 }
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:10,代码来源:CmsGridView.php

示例4: makeChild

 public function makeChild($category)
 {
     echo "<ul style='list-style:none;'>";
     foreach ($category->selfChild as $child) {
         echo "<li>";
         echo CHtml::Link("<i class='fa fa-rss'></i> " . $child->name . "", array('/rss/category', 'id' => $child->term_id, 'slug' => $child->slug));
         $this->makeChild($child);
         echo "</li>";
     }
     echo "</ul>";
 }
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:11,代码来源:RssController.php

示例5: getLink

 function getLink($post)
 {
     $postLink = '';
     $htmlOptions = '';
     $postLink .= "<h2>" . CHtml::Link(Helper::getExcerpt($post->post_name, 0, $this->data('batasJudul')), Yii::app()->createUrl('single/index', array('id' => $post->ID, 'slug' => $post->post_link))) . "</h2>";
     $postLink .= "  <p>";
     $postLink .= $post->post_excerpt == '' ? Helper::getExcerpt($post->post_content, 0, $this->data('batasDeskripsi')) : "<br>" . Helper::getExcerpt($post->post_excerpt, 0, $this->data('batasDeskripsi'));
     $postLink .= "</p>";
     $postLink .= '<div class="text-muted"><i class="fa fa-clock-o"></i> ' . FTime::since($post->post_modified) . '</div>';
     // $postLink .=  '<a class="btn btn-primary readmore" href="'.Yii::app()->createUrl('single/index',array('id'=>$post->ID,'slug'=>$post->post_link)).'">Selengkapnya <i class="fa fa-angle-right"></i></a>';
     echo $postLink;
 }
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:12,代码来源:widget_latest_article.php

示例6: left

 public function left()
 {
     echo '<div class="left-nav">';
     echo CHtml::Link('<i class="fa fa-angle-right"></i> Terbaru', array('indeks/view', 'param' => 'post'), array('class' => 'list-group-item'));
     echo CHtml::Link('<i class="fa fa-angle-right"></i> Terpopuler', array('indeks/view', 'param' => 'populer'), array('class' => 'list-group-item'));
     foreach ($this->_labels as $label) {
         echo CHtml::Link('<i class="fa fa-angle-right"></i> ' . $label->name, array('indeks/view', 'param' => $label->slug), array('class' => 'list-group-item'));
     }
     foreach ($this->_category as $label) {
         echo CHtml::Link('<i class="fa fa-angle-right"></i> ' . $label->name, array('indeks/view', 'param' => $label->slug), array('class' => 'list-group-item'));
     }
     echo "</div>";
 }
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:13,代码来源:IndeksController.php

示例7: getLink

 function getLink($post, $attr = true, $excerpt = false, $excerptString = 20)
 {
     $postLink = '';
     $htmlOptions = '';
     $postLink .= CHtml::Link(Helper::getExcerpt($post->post_name, 0, $excerptString), Yii::app()->createUrl('single/index', array('id' => $post->ID, 'slug' => $post->post_link)), $htmlOptions);
     if ($excerpt == true) {
         $postLink .= $post->post_excerpt == '' ? "<br>" . Helper::getExcerpt($post->post_content, 0, $this->data('batasDeskripsi')) : "<br>" . Helper::getExcerpt($post->post_excerpt, 0, $this->data('batasDeskripsi'));
     }
     if ($this->data('showDate') == true) {
         $postLink .= '<div class="entry-meta small muted">';
         $postLink .= FTime::since($post->post_modified);
         $postLink .= "</div>";
     }
     echo $postLink;
 }
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:15,代码来源:widget_terpopuler.php

示例8: layout

 public function layout($data, $model)
 {
     echo CHtml::openTag('div', array('class' => 'widget archieve content-inner'));
     echo CHtml::openTag('h3', array('class' => 'main-color widget_header'));
     echo $data['title'];
     echo CHtml::closeTag('h3');
     echo CHtml::openTag('div', array('class' => 'row'));
     echo CHtml::openTag('div', array('class' => 'col-xs-12'));
     echo CHtml::openTag('ul', array('class' => 'blog_archieve'));
     $i = 1;
     foreach ($model as $tag) {
         echo CHtml::openTag('li');
         echo CHtml::openTag('h4');
         echo CHtml::Link("<span>" . $i++ . "</span> " . $tag->name . " <span class='pull-right'><i class='fa fa-angle-double-right'></i></span>", Yii::app()->createUrl('/topic/index', array('id' => $tag->term_id, 'slug' => $tag->slug)));
         echo CHtml::closeTag('h4');
         echo CHtml::closeTag('li');
     }
     echo CHtml::closeTag('ul');
     echo CHtml::closeTag('div');
     echo CHtml::closeTag('div');
     echo CHtml::closeTag('div');
 }
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:22,代码来源:widget_topics.php

示例9: array

	
	<?php 
echo $form->textFieldRow($model, 'meta_key', array('class' => 'span12', 'placeholder' => 'Name'));
?>
	
	<?php 
echo $form->textFieldRow($model, 'meta_value', array('class' => 'span12', 'placeholder' => 'http://'));
?>
	 
	<?php 
$list = CHtml::listData(Menuitem::model()->findAll(array('order' => 'meta_key ASC', 'condition' => "term_id = '" . $model->term_id . "'")), 'meta_id', 'meta_key');
?>
	<?php 
echo $form->dropDownListRow($model, 'meta_parent', $list, array('empty' => 'None', 'class' => 'span12'));
?>
	 
        <?php 
echo $form->textFieldRow($model, 'meta_sort', array('class' => 'span5', 'placeholder' => '0'));
?>
        
	<hr>
	<?php 
echo CHtml::Link('Cancel', array('admin', 'id' => $model->term_id), array('class' => 'btn'));
?>
	<?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => $model->isNewRecord ? 'info' : 'warning', 'label' => $model->isNewRecord ? 'Create New Menu' : 'Update'));
?>
 

<?php 
$this->endWidget();
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:30,代码来源:updateForm.php

示例10: array

?>
</div>

<?php 
echo $form->checkboxRow($model, 'slider_type_manual', array('onClick' => "toogle('.slider_manual_area')"));
?>
<div class='well slider_manual_area hide'>
<?php 
echo $form->textFieldRow($model, 'slider_manual_count');
?>
<br>
<?php 
if ($model->slider_type_manual == 1) {
    ?>
   <?php 
    echo CHtml::Link('Set Item', array('/appback/slidermanual/admin'), array('class' => 'btn btn-success'));
    ?>
 
<?php 
}
?>
</div>

<?php 
echo $form->checkboxRow($model, 'slider_type_label', array('onClick' => "toogle('.slider_label_area')"));
?>
<div class='well slider_label_area hide'>
<?php 
echo $form->checkboxListRow($model, 'slider_label_value', $this->listLabel());
echo $form->textFieldRow($model, 'slider_label_count');
?>
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:31,代码来源:index.php

示例11: foreach

}
echo "<ul style='margin-left:-20px;margin-top:10px;'>";
foreach ($post->topics as $topic) {
    echo "<li>" . CHtml::Link($topic->name, array('topic/index', 'id' => $topic->term_id, 'slug' => $topic->slug)) . "</li> ";
}
echo "</ul>";
?>

<?php 
if (count($post->tags) > 0) {
    ?>
<hr><ul class="tag-cloud">
<?php 
    foreach ($post->tags as $tag) {
        echo "<li>";
        echo CHtml::Link($tag->name, array('tags/index', 'id' => $tag->term_id, 'slug' => $tag->slug), array('class' => 'btn btn-xs btn-primary')) . '  ';
        echo "</li>";
    }
    ?>
</ul>
<?php 
}
?>
 
 
<?php 
$this->getWidget('singlePostBottom');
?>
 
    </div>
<div class='col-xs-4'>
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:31,代码来源:single.php

示例12: array

 </div>
<div class="formtextfield"><?php 
echo $form->fileField($model, 'profilephoto', array('size' => 20, 'maxlength' => 128));
?>
 

</div>
<div class="thumbnailfield">
<?php 
$imgsrc = Yii::getPathOfAlias('application.profilephotos') . DIRECTORY_SEPARATOR . "thumb_" . Yii::app()->user->id . "_" . $model->profilephoto;
if (file_exists($imgsrc)) {
    $thumbUrl = Yii::app()->getAssetManager()->publish($imgsrc);
    $imageUrl = Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('application.profilephotos') . DIRECTORY_SEPARATOR . Yii::app()->user->id . "_" . $model->profilephoto);
    $imghtml = CHtml::image($thumbUrl);
    echo CHtml::link($imghtml, $imageUrl, array('target' => '_new'));
    echo "&nbsp;" . CHtml::Link('Remove', '#', array('id' => 'removeprofilephoto', 'class' => 'smalltext'));
}
?>


</div>


</div>

</div> <!-- end profilebox1 -->



</div>	<!-- end tabs -->
开发者ID:rgummadi,项目名称:ScriptOverflow,代码行数:30,代码来源:_profileform.php

示例13: array

	<footer>
	<?php 
if (yii::app()->user->isGuest) {
    echo CHtml::Link("我要回應", "#", array("id" => "reply", "onclick" => "\$('#pls_login').show();"));
} else {
    echo CHtml::ajaxLink("我要回應", yii::app()->createUrl("post/replyPost/", array("id" => $model->id)), array('type' => 'GET', 'success' => 'function(data){
						$("#detail").html("").append(data);
					}'), array("id" => "reply"));
}
?>
	<div id="pls_login" style="display:none;">
		<?php 
//echo "Please ".CHtml::Link("Login", yii::app()->createUrl("site/login",
//			array("path_info"=>yii::app()->request->pathInfo)))."with FB Account First";
echo "Please " . CHtml::Link("Login", "#", array("onclick" => "redirectToLogin();")) . "with FB Account First";
?>
	</div>
	</footer>
</article>

<!--<div id="fb-root"></div> -->
	<script>
		function catchLikeAction(value)
		{
			alert("Like!");
			<?php 
$ajaxUrl = yii::app()->createAbsoluteUrl("post/updateFBLike/", array("id" => $model->id));
?>
			$.ajax({
				url: '<?php 
开发者ID:ChinHui-Chen,项目名称:newssip,代码行数:30,代码来源:detail.php

示例14: renderAddButton

 protected function renderAddButton()
 {
     if (!isset($this->returnLink) or $this->returnLink == "") {
         $this->returnLink = $this->model->tableSchema->name . "/create";
     }
     if ($this->addButtonLink != '') {
         $link = $this->addButtonLink;
     } else {
         $link = array($this->_relatedModel->tableSchema->name . "/create", 'returnTo' => $this->returnLink);
     }
     if (!$this->useLinkButton) {
         echo CHtml::Link(is_string($this->showAddButton) ? $this->showAddButton : 'New', $link);
     } else {
         echo CHtml::LinkButton(is_string($this->showAddButton) ? $this->showAddButton : 'New', array('submit' => $link));
     }
 }
开发者ID:engrasadullahkhan,项目名称:stockcontrolweb,代码行数:16,代码来源:Relation.php

示例15: array

<?php

$this->breadcumbs();
?>
<h3>Lihat : <?php 
echo $model->name;
?>
  </h3><hr>
<?php 
$this->alert();
?>

<?php 
$webUrl = Yii::app()->FrontUrl->createUrl('/tags/index/', array('id' => $model->term_id, 'slug' => $model->slug));
$mobileUrl = Yii::app()->FrontMobileUrl->createUrl('/tags/index/', array('id' => $model->term_id, 'slug' => $model->slug));
$link = "Web Url : " . $webUrl . " - " . CHtml::Link('Go to Link', $webUrl) . "<br>";
$link .= frontendMobileUrl == '' ? "" : "Mobile url : " . $mobileUrl . " - " . CHtml::Link('Go to Link', $mobileUrl);
$this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'type' => 'bordered striped', 'attributes' => array('name', array('name' => 'slug', 'type' => 'raw', 'value' => $link), array('label' => 'Total Post', 'value' => count($model->postAll)), 'description', array('name' => 'images', 'type' => 'raw', 'value' => CHtml::image(Helper::rootImg('content', $model->images))))));
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:18,代码来源:view.php


注:本文中的CHtml::Link方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。