blad Posted September 2, 2014 Posted September 2, 2014 (edited) It is an absurd thing but I don´t know how include php files in the modules (include x.php) or use $ _GET and $ _POST. I am creating a chat module and I am not familiar with the API yet. I have seen modules as an example and they don´t use include or post.Thank you. The module: The code has been deleted because it hurt my eyes Edited September 2, 2014 by blad
kongondo Posted September 2, 2014 Posted September 2, 2014 (edited) Include as normal...at the top of the class...e.g. require_once(__DIR__ . '/NameOfYourPHPFILE.php');//am assuming this is a class as well class BackendChat extends WireData implements Module { //your class methods } For $ _GET and $ _POST. See $input: http://processwire.com/api/variables/input/ In a module: $this->input->post; wire('input')->get should also work in a class I believe as well as a function. Otherwise, normal use is $input->post, $input->get, $input->cookie Edited September 2, 2014 by kongondo 2
blad Posted September 2, 2014 Author Posted September 2, 2014 I will erase this crap and start again . Thanks @kongondo
kongondo Posted September 2, 2014 Posted September 2, 2014 ...maybe let's just change the title to something more descriptive, mark this as solved and maybe you can buy me coffee when am next in Spain? 1
kongondo Posted September 2, 2014 Posted September 2, 2014 Btw, the including class can of course extend the included one... 1
blad Posted September 2, 2014 Author Posted September 2, 2014 I don´t have permissions to change the title. You can put "Learning to use the forum search and don´t create useless topics". Sure! Free beers and coffees for everyone. I like your avatar Walter White
kongondo Posted September 2, 2014 Posted September 2, 2014 I don´t have permissions to change the title..... Yes you do ...Just use the 'More reply options' when you are editing the first post you created and you'll get the full editor... But I can change it, no worries 1
blad Posted September 2, 2014 Author Posted September 2, 2014 I've finally done something good today . See you tomorrow 1
Martijn Geerts Posted September 2, 2014 Posted September 2, 2014 You've promised beer & coffee, thats a real good deed !
kongondo Posted September 2, 2014 Posted September 2, 2014 Just to add that you can also include right within one of your methods....as Wanze does it here in his GA module
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now