Jump to:

2011 Posts in 1436 Topics by 620 members

Form Questions

SilverStripe Forums » Form Questions » Figuring out where to put this code?

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

Page: 1
Go to End
Author Topic: 649 Views
  • Denny
    Avatar
    Community Member
    55 Posts

    Figuring out where to put this code? Link to this post

    A few months ago I tried to figure out how to delete a member from my site. I am using the member profile module. There was someone whom gave me specific instructions on how to do this. I did manage to create the link to the page, but I don't know where to place this code. I was told to place it in my page controller, but how? Anyway, it's real simple, and I have posted the code given to me a few months ago on how to do this. I been busy constructing other visuals for my site, and I apologize for the delay of this problem.

    Attached Files
  • Willr
    Avatar
    Forum Moderator
    5497 Posts

    Re: Figuring out where to put this code? Link to this post

    but I don't know where to place this code. I was told to place it in my page controller, but how?

    * Open mysite/code/Page.php.
    * Go down to the Page_Controller section and paste that code within the { } surrounding the Controller.
    * Additionally you may need to tell SS that function is allowed to be called. Again in the Page_Controller class (normally at the top of the class)

    static $allowed_actions = array('deleteself')

  • Denny
    Avatar
    Community Member
    55 Posts

    Re: Figuring out where to put this code? Link to this post

    I tried to figure out where to place this code, but I'm not sure? Anyway, I will send you a copy of this file, and maybe you can spot where to put this code. I am afraid of ruining my site.

    Attached Files
  • Willr
    Avatar
    Forum Moderator
    5497 Posts
  • Denny
    Avatar
    Community Member
    55 Posts

    Re: Figuring out where to put this code? Link to this post

    I did try the pastie.org, and I figured it out. Thank you for your help.

    649 Views
Page: 1
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.