Jump to content

Access to PW API from custom script


helmut2509
 Share

Recommended Posts

In my PW app I have now a php script which caters to the upload of files.

It does not directly belong to the UI and therefore I did not store it in the templates folder, but in a custom folder.

My question is: how do I get access from this script to the Pw API? Can I leave it in the custom folder?

Link to comment
Share on other sites

It just so happens that you can bootstrap processwire into scripts. I have used this several times and it is just one of the many awesome features.

https://processwire.com/api/include/

Normally, I house specials scripts outside the template folder (like you have done) and just include processwire's index like:

<?php include("/path/to/processwire/index.php");  ?>

 

  • Like 4
Link to comment
Share on other sites

7 minutes ago, louisstephens said:

It just so happens that you can bootstrap processwire into scripts. I have used this several times and it is just one of the many awesome features.

https://processwire.com/api/include/

Normally, I house specials scripts outside the template folder (like you have done) and just include processwire's index like:


<?php include("/path/to/processwire/index.php");  ?>

 

thanks for the tip. In my google search result the above link did not appear ;-((

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...