public function Post($data, $row = '')
 {
     $author = $data->authors != null ? " <label class='label'>author</label> " . ucfirst($data->authors->username) : '';
     $editor = $data->editors != null ? " <label class='label'>editor</label> " . ucfirst($data->editors->username) : '';
     $photometa = count($data->photometa) > 0 ? " <small class='muted'>(" . count($data->photometa) . " Photos)</small>" : '';
     $val = "<b>" . $data->post_name . "</b>{$photometa}<br>";
     $val .= "<small class='muted'>Last Update :" . Helper::convert('D, j-m-Y H:i', $data->post_modified) . "<br>";
     $val .= $author . $editor . " - views : " . $data->post_hits . "<br>";
     $val .= Topic::makeValue($data, $row) != '' ? '<b>Topic : </b> ' . Topic::makeValue($data, $row) : '';
     $val .= Tag::makeValue($data, $row) != '' ? '<b>Tag : </b> ' . Tag::makeValue($data, $row) : '';
     $val .= Label::makeValue($data, $row) != '' ? '<b>Label : </b> ' . Label::makeValue($data, $row) : '' . "</small>";
     return $val;
 }
Пример #2
0
<?php

$this->breadcumbs();
?>
	
<h3>Lihat : <?php 
echo $model->post_name;
?>
</h3>
<?php 
$this->alert();
$webUrl = Yii::app()->FrontUrl->createUrl('/single/index/', array('id' => $model->ID, 'slug' => $model->post_link));
$mobileUrl = Yii::app()->FrontMobileUrl->createUrl('/single/index/', array('id' => $model->ID, 'slug' => $model->post_link));
$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, 'attributes' => array('ID', 'post_name', 'post_title', array('name' => 'post_link', 'type' => 'raw', 'value' => $link), array('name' => 'post_image', 'type' => 'raw', 'value' => CHtml::image(Helper::getThumb('content', $model->post_image, 'medium'))), 'post_image_by', 'post_image_credit', 'post_excerpt', array('name' => 'post_content', 'type' => 'raw'), 'post_source', 'post_source_link', array('name' => 'post_status', 'type' => 'raw', 'value' => array($this, 'Status')), array('label' => 'Author', 'name' => 'authors.username'), array('label' => 'Editor', 'name' => 'editors.username'), array('name' => 'tags.name', 'type' => 'raw', 'value' => Tag::makeValue($model)), array('label' => 'Category', 'type' => 'raw', 'value' => Category::makeValue($model)), array('name' => 'labels.name', 'type' => 'raw', 'value' => Label::makeValue($model)), array('label' => 'Topic', 'type' => 'raw', 'value' => Topic::makeValue($model)), 'post_created', 'post_modified', 'post_meta_key', 'post_meta_desc')));