Jump to:

23459 Posts in 18906 Topics by 2877 members

General Questions

SilverStripe Forums » General Questions » how to include own php class ?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2
Go to End
Author Topic: 4661 Views
  • snaip
    Community Member
    180 Posts

    Re: how to include own php class ? Link to this post

    still have this problem


    class Kontakt extends Strona {

    class Kontakt_Controller extends Strona_Controller {

    function contact() {
    include 'Form.php';
    $form = new Form();

    return $form->a();




    class Form {

    public function a() {
    echo 'something';





    no errors, site is blank
    what is wrong ?

  • Willr
    Forum Moderator
    5497 Posts

    Re: how to include own php class ? Link to this post

    snaip this is probably due to the fact SilverStripe has a built in Form class, you cannot redeclare a class with the same name.

    You're getting a white screen probably due to display_errors being turned off in your php.ini file. If you turn that to on, restart apache you should hopefully start to get useful error messages.

Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.