NotionCommotion Posted September 9, 2016 Share Posted September 9, 2016 I am building an add-on for Concrete5 who's purpose is to configure and display HighCharts. I will later be porting it to Wordpress and Joomla for their equivalent plugin and component. Much of the functionality of the add-on is provided by a remote REST API which the add-on communicates to using cURL, and the only thing the script on the Concrete5 machine does is: When displaying a page, make a request to the REST API, create a view and includes the results received in it, and provide that view to the overall Concrete5 view which is presented to the client. When an Ajax request is received, proxy it to the REST API, receive the results, and forward them back to the client. Host appropriate JavaScript files, and a small amount additional scope which can easily be moved to the REST API. This is making me question why I am creating any Concrete5 (and then Wordpress and Joomla) specific script. Maybe I should move everything to the remote REST API server. But how would it look? Would I then have same-origin issues? Is this not how PHP is suppose to work, and should I be using something like Node.js? PS. Sorry for the lame topic title, but I couldn't think of anything better. Quote Link to comment Share on other sites More sharing options...
requinix Posted September 10, 2016 Share Posted September 10, 2016 You would have origin issues - unless you configured the server to allow cross-origin requests. You can totally do that. Is it how PHP is supposed to work? There is no "supposed". It is capable of doing many things and you are using it to do one thing. That's fine. Node.js? If you want, but that's an entirely different discussion. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.