3217 Posts in 853 Topics by 812 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 376 Views |
-
problem with RenderWith() function.

7 April 2012 at 2:37am
Hi,
what is wrong with my code? I`m getting error: "Fatal error: Call to a member function renderWith() on a non-object in"
This is my code:
DropDownMenu.php:
<?php
class DropDownMenu extends DataObjectDecorator {
function extraStatics() {
return array(
'db' => array (
'DropDownMenu' => 'Boolean',
),
'has_one' => array(
)
);
}
public function updateCMSFields(FieldSet &$fields) {$fields->addFieldToTab("Root.Content.Main", new CheckBoxField("DropDownMenu","Drop down menu"), "Content");
}
public function dropdownmennu(){
return $this->parent->renderWith('dropdownmenu');
}
}
class DropDownMenu_Controller extends ContentController {
function init(){
parent::init();
Requirements::css("dropdownmenu/css/dropdownmenu.css");
}
} -
Re: problem with RenderWith() function.

8 April 2012 at 2:51am
Hi Benas
I'm pretty sure
$this->parent->renderWith('dropdownmenu');
should read
$this->owner->renderWith('dropdownmenu');
-
Re: problem with RenderWith() function.

8 April 2012 at 6:20am Last edited: 8 April 2012 6:21am
It works! Thank you!
| 376 Views | ||
|
Page:
1
|
Go to Top |


