This is a public Forum  publicRSS

Topic

    Monica Valois
    Where can I modify a php file that is in the file...Answered
    Topic posted July 13, 2017 by Monica ValoisWhiz 
    79 Views, 4 Comments
    Title:
    Where can I modify a php file that is in the file "Core"?
    Content:

    I want to change a php file called "AjaxRequest.php" on Cyberduck, however, that php file is in the file "Core" and I can't modify. Where can I modify it?

    Best Answer

    Luuk

    Hi Monica,

    You can't change functionality in the core folders.

    The development folder is for editing and changing. If you really need to change the ajaxrequest file, just copy it to the dev folder and change the call so that it calls the dev ajaxrequest file.

    Answer

     

    • Danette Beal

      Hi Monica,

      I moved this one over to the customer portal forum for better visibility.

      Regards,

      Danette, Community Manager

    • Luuk

      Hi Monica,

      You can't change functionality in the core folders.

      The development folder is for editing and changing. If you really need to change the ajaxrequest file, just copy it to the dev folder and change the call so that it calls the dev ajaxrequest file.

    • Monica Valois

      I've copied the Ajaxrequest file and I renamed to "dev_AjaxRequest", and then I moved to the folder "Development". However, it shows an error (Attached)

      "Unable to rename the dev_AjaxRequest.php file"

    • Robert Surujbhan

      Monica, classes like AjaxRequest are best implemented as "controllers" within the CP Framework.  Custom controllers should be placed into the /cp/customer/development/controllers directory, and they also require a special PHP namespace. On your site, you should have a sample controller that you can look at for reference and modify (/cp/customer/development/controllers/AjaxCustom.php).

      When ready, custom controller endpoints can be invoked using the syntax https://site/cc/class/function, so for example: https://yoursite/cc/AjaxCustom/ajaxFunctionHandler (the "cc" means custom controller).  You can pass GET and POST parameters directly to these endpoints.

      The ajaxFunctionHandler() PHP function in the AjaxCustom sample class shows you how to receive a POST data parameter too, so hopefully that helps to explain how they work...