Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Kohana]Kohana->menu->zmiana widoków
elita4all
post
Post #1





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 28.10.2009

Ostrzeżenie: (0%)
-----


Panie, Panowie raczkuję baaaardzo. Jak elegancko zrobić, żeby po kliknięciu w <oferta> też było widoczne menu, (ewentualny head, title). Chyba, że z takim kontrolerem już nie da rady nic elegancko zrobić?

classes/controller/index.php
Kod
<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Index extends Controller {
public function action_index()
    {    
     $main_menu = new View('main_menu');
                $main_menu->options = array(
              array(
                 'option_name'        => 'Strona główna',
                 'option_url'        => 'index'                
                   ),
              array(
                 'option_name'        => 'Oferta',
                 'option_url'        => 'oferta'                           
                   )
    
                );
                $view = new View('index');                
                $view->main_menu = $main_menu->render();
                $view->title = 'Witaj!';
                $this->request->response = $view->render();          

    }
}


classe/controller/oferta.php
Kod
<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Oferta extends Controller_Index {

public function action_index()
    {
    }    
}


views/index.php
Kod
<TABLE WIDTH=800 BORDER=1>
  <TR HEIGHT=30>
    <TD><?=$main_menu;?></TD>
  </TR>
  <TR HEIGHT=500>
    <TD><?=$title;?></TD>
  </TR>
</TABLE>

Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 17:33