Nie wiem skąd się bierze ten błąd, wg. mnie robię wszytko poprawnie.. No ale cóż widocznie nie do końca.

wywala mi taki błąd: /application/controllers/sitemap.php [20]: Attempt to assign property of non-object.
adres strony:amehobpoezja.pl
adres gdzie jest błąd:amehobpoezja.pl/sitemap
views/sitemap.php
<?foreach($menu as $item):?> <ul> <li> <a href="<?=url::base()?>arty/pokaz/<?=$item->id_kat?>/<?=$item->nazwa?>"><?=$item->nazwa?></a> <?$podmenu = Menu::pobierzPodMenu($item->id_kat)?> <?if( $podmenu->count() > 0 ):?> <ul> <?foreach( $podmenu as $subitem):?> <li><a href="<?=url::base()?>arty/pokaz/<?=$subitem->id_kat?>/<?=$subitem->nazwa?>"><?=$subitem->nazwa?></a></li> <?endforeach?> </ul> <?endif?> </li> </ul> <?endforeach?>
controllers/sitemap.php
class Sitemap_Controller extends Template_Controller { function __construct() { parent::__construct(); } public function pokaz() { $this->body->menu_boczne = new View('box/menu_boczne_bez_kat'); $this->body->glowny_box = new View('sitemap'); $this->body->glowny_box->sitemap = $this->menu; $this->body->glowny_box->sitemap->menu = Menu::pobierzMenu(); } } ?>
a tutaj controllers/template.php
abstract class Template_Controller extends Controller { public $template = 'main'; public $auto_render = TRUE; public $session; public $title = ''; public $keywords = ''; public $description = ''; public $kod; public $body; public $footer; public function __construct() { parent::__construct(); $this->session = Session::instance(); url::base().'css/menu_boczne.css', url::base().'css/menu_srodkowe.css', url::base().'css/sitemap.css', url::base().'css/style.css', url::base().'css/social_icons.css'); url::base().'js/dddropdownpanel.js', url::base().'js/jquery-1.3.2.min.js', url::base().'js/jquery.validate.js', url::base().'js/menu_srodkowe.js'); $this->title = 'amehobpoezja'; $this->keywords = 'amehob, poezja, wiersze, ksiązki, liryka, białe'; $this->description = 'amehobpoezja.pl - Portal poświęcony poezji'; $this->kod = new Captcha(); $this->template = new View($this->template); $this->body = new View('body'); $this->header = new View('header'); $this->menu_glowne = new View('menu/glowne'); $this->footer = new View('stopka'); if ($this->auto_render == TRUE) public function _render() {if ($this->auto_render == TRUE) $this->template->keywords = $this->keywords; $this->template->description = $this->description; $this->template->css = $this->css; $this->template->java = $this->js; $this->template->body = $this->body; $this->template->body->header = $this->header; $this->template->body->header->menu_glowne = $this->menu_glowne; $this->template->body->header->menu_glowne->menu = $this->menu; $this->template->body->header->menu_glowne->menu = Menu::pobierzMenu(); $this->template->body->footer = $this->footer; $this->template->render(TRUE);}}}
już znaleziona została odpowiedź.
$this->body ->set('menu_boczne', View::factory('box/menu_boczne_bez_kat')) ->bind('glowny_box', $sitemap); $sitemap = View::factory('sitemap') ->set('menu', Menu::pobierzMenu()); //to to samo co: //$this->body->menu_boczne = new View('box/menu_boczne_bez_kat'); //$this->body->glowny_box = new View('sitemap'); //$this->body->glowny_box->menu = Menu::pobierzMenu();
obie odpowiedzi są poprawne

temat do zamknięcia
