17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 953 Views |
-
Overloading Page_Controller from a module

14 October 2008 at 7:35pm Last edited: 15 October 2008 5:14pm
I am trying to overload my main Page_Controller class from a custom class in a module:
I have made a class module/code/MyPage.php
class MyPage_Controller extends Page_Controller {
....
}In the module _config.php I put:
Object::useCustomClass('Page', 'MyPage');
Doesn't seem to do anything?
If I put the functions in the main Page_Controller website/code/Page.php then they are available, my problem is seeing that these functions belong to the module I would like to keep them separate but they still need to be available to every Page.
Anyone have any ideas on how to achieve this?
-
Re: Overloading Page_Controller from a module

16 October 2008 at 12:55pm
Any ideas anyone?
Even better is there a way to add the methods form MyPage_Controller (module) to Page_Controller (project) been playing with: http://api.silverstripe.com/default/Object.html#addMethodsFrom to no avail.
| 953 Views | ||
|
Page:
1
|
Go to Top |

