/**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Chinhsach the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Chinhsach::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemple #2
0
	<!-- DropDown San Pham-->
	<ul id="ddsubmenu1274" class="ddsubmenustyle" style="z-index: 2000; width: auto; height: auto; overflow: visible; opacity: 1; left: 0px; top: 0px; visibility: hidden;">
		<?php 
$categorys = Categorys::model()->findAll();
// die(var_dump($categorys));
foreach ($categorys as $key => $value) {
    echo '<li>';
    echo CHtml::link($value->name, array('categorys/view', 'id' => $value->id));
    echo '</li>';
}
?>
	</ul>
	<!-- Dropdown tu van,chinhsach-->
	<ul id="ddsubmenu955" class="ddsubmenustyle" style="z-index: 2000; width: auto; height: auto; overflow: visible; opacity: 1; left: 0px; top: 0px; visibility: hidden;">
		<?php 
$rules = Chinhsach::model()->findAll(array("limit" => 5));
foreach ($rules as $key => $value) {
    echo '<li>';
    echo CHtml::link($value->name, array('Chinhsach/view', 'id' => $value->id));
    echo '</li>';
}
?>
	</ul>

	<!-- <div class="clear"></div> -->
	<div id="product-content">
		<div class="product-left-content">
			<div id="product-hot-news">
				<div id="navd-box">
					<div id="tab-navd">Tin nổi bật</div>
					<div id="navd-bg3">