Jump to:

23472 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » php code into silverstripe

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
Go to End
Author Topic: 628 Views
  • Samal
    Community Member
    2 Posts

    php code into silverstripe Link to this post


    how can I add extern php code into silverstripe admin?

    I have eight pages that are written using PHP. Now I want to put the pages in the admin section of SilverStripe. Pages will be a part of Silverstripe.

    Is that possible?


  • Sean
    Forum Moderator
    921 Posts

    Re: php code into silverstripe Link to this post

    There is no way to add PHP into the admin panel directly from a users perspective, you will have to convert the PHP scripts into page types yourself, as per SilverStripe documentation.

    What sort of scripts are they?


  • Bereusei
    Community Member
    94 Posts

    Re: php code into silverstripe Link to this post

    If you use an ModelAdmin for your DataObject, you can replace it with the RemodelAdmin.
    With this module, you can include in the ModelAdminPanel buttons witch call an php-file:

    In remodeladmin/templates/Includes/RemodelAdmin_right.ss:
    <div class="controlbuttons">
    <button id="btn1">Do something</button>

    In remodeladmin/javascript/remodeladmin.js:
    $('#btn1').click(function(){ $.post("remodeladmin/php/dosomething.php", { id: $(this).val(), status: "status1" }); });

    In remodeladmin/php/dosomething.php you can catch the id and the status:
    $id = $_POST['id'];
    $status = $_POST['status'];
    function dosomething(){ do it }

    Hope it helps.

  • Samal
    Community Member
    2 Posts

    Re: php code into silverstripe Link to this post

    Hello Sean,

    thank you for your answer. That's not a script, there are only php codes, they are wirtting by hands. You could see this in attach!

    How can I convert this in page types?

    Thanks again for your help!


    Attached Files
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.