2014-02-22 2 views
1

나는 웹 사이트에서 작업하려고하는데 페이지 이름, 페이지 옆에있는 favicon에 카테고리 이름을 표시하는 방법을 알고 싶습니다.동적 제목 페이지 카테고리 - Codeigninter

예 : 내 사이트 - 구분 1, 내 사이트 - 구분 2

안녕하세요, 나는 웹 사이트에서 작동하기 위해 노력하고있어 및 방법 페이지 제목에 범주 이름을 표시하는 을 알고 옆에 파비콘을 싶습니다 페이지에?

function cat() { 

     $offset = (int) $this->uri->segment(4); 

     $appcat_nome = xss_clean($this->uri->segment(3)); 

     $categoria = $this->appcat->get(array('appcat_url' => $appcat_nome, 'appcat_status' => 1,)); 

     $this->data['titulo'] = 'Digital Feed'; 

     $cond = array('app_on' => 1); 

     $this->data['apps2'] = $this->apps->getAll($cond, '', 1000, '', 'app_view DESC'); 

     // Configurações do site. 
     $this->data['config_site'] = $this->config_site->getAll(array('conCod' => 1))->row(); 

     if (count($categoria) == 1) 
      { 
       $where = array('A.appcat_id' => $categoria[0]['appcat_id']); 

       $total_rows = $this->apps->getAll($where)->num_rows(); 

       $this->data['apps'] = $this->apps->getAll($where, $offset, $this->limit, ''); 

       $this->load->library('pagination'); 

       $config['base_url'] = base_url() . 'apps/cat/'. $appcat_nome . '/'; 
       $config['total_rows'] = $total_rows; 
       $config['per_page'] = $this->limit; 
       $config['uri_segment'] = 4; 
       $config['full_tag_open'] = "<ul class='pagination'>"; 
       $config['full_tag_close'] ="</ul>"; 
       $config['num_tag_open'] = '<li>'; 
       $config['num_tag_close'] = '</li>'; 
       $config['cur_tag_open'] = "<li class='disabled'><li class='active'><a href='#'>"; 
       $config['cur_tag_close'] = "<span class='sr-only'></span></a></li>"; 
       $config['next_tag_open'] = "<li>"; 
       $config['next_tagl_close'] = "</li>"; 
       $config['prev_tag_open'] = "<li>"; 
       $config['prev_tagl_close'] = "</li>"; 
       $config['first_tag_open'] = "<li>"; 
       $config['first_tagl_close'] = "</li>"; 
       $config['last_tag_open'] = "<li>"; 
       $config['last_tagl_close'] = "</li>"; 

       $this->data['total_rows'] = $total_rows; 

       $this->pagination->initialize($config); 

       $this->data['pagination'] = $this->pagination->create_links(); 

       $this->load->view('site/apps/index', $this->data); 

      }else{ 
       redirect(base_url().'apps'); 
      } 
     } 
+0

모든 페이지는 다른 카테고리를 표시합니다? – lighter

+0

예, 동적 카테고리 표시 – uellingtonpalma

답변

0

페이지에 제목을 설정하려면 컨트롤러에서 제목을 전달하십시오. 보기 파일에서

$data["page_title"] = "Category 1"; 

:

<?php 
    $title = "Mysite"; 
    if(!empty($page_title)) 
     $title .= " - ".$page_title; 
?> 
<title><?php echo $title;?></title> 
+0

카테고리가 2 인 경우 동일한 컨트롤러입니까? – uellingtonpalma

+0

동일한 컨트롤러. 동일한 컨트롤러를 사용하여 동적 카테고리를 사용하기를 바랍니다. –

+0

문자열을 어떻게 사용합니까? 예 : $ data [ "page_title"] = $ ???; – uellingtonpalma