Exemple #1
0
<?php 
$parent_page = Pages::findRootParentModel($page_id);
$listchild = Pages::findChildOfPages($page_id);
if (!empty($parent_page) && $parent_page->slug != $_GET['slug'] || !empty($listchild)) {
    $child_page = Pages::findChildOfPages($parent_page->id);
    ?>
    <!-- box -->
    <div class="box-1">
        <div class="title"><h3><?php 
    echo $parent_page->title;
    ?>
</h3></div>
        <div class="content">
            <ul class="nav-list">
                <?php 
    if (!empty($child_page)) {
        foreach ($child_page as $item) {
            if ($item->external_link != "") {
                $href = $item->external_link;
            } else {
                $href = Yii::app()->createAbsoluteUrl("page/index", array('slug' => $item->slug));
                //                            $href = Yii::app()->createAbsoluteUrl("page".$item->slug);??? ai code
            }
            $class_li = "";
            if ($_GET['slug'] == $item->slug) {
                $class_li .= "active";
            }
            ?>
                <li class="<?php 
            echo $class_li;
Exemple #2
0
include_once 'head.php';
?>

    <body>
    	<!-- header -->
    	<?php 
include_once 'header.php';
?>

        
        <?php 
//HTram
if (Yii::app()->controller->id == 'site' && Yii::app()->controller->action->id == 'index') {
    ?>

         <div class="wrapper breadcrumb"></div>
        <?php 
} else {
    $this->breadcrumbs = array(array('controller' => Yii::app()->controller->id, 'action' => Yii::app()->controller->action->id));
    if (isset($this->breadcrumbs)) {
        foreach ($this->breadcrumbs as $item) {
            if ($item['controller'] == 'page') {
                if (isset($_GET['slug']) && $_GET['slug'] != "") {
                    $page = Pages::findBySlug($_GET['slug']);
                    $page_root = array();
                    if ($page->parent_id != 0) {
                        $page_root = Pages::findRootParentModel($page->parent_id);
                    }
                    if ($page_root) {
                        $name_breadcrum = '<a href="' . Yii::app()->createAbsoluteUrl('page/index', array('slug' => $page_root->slug)) . '">' . $page_root->title . "</a> &raquo; <strong>" . $page->title . "</strong>";
                    } else {