jasonhinkle / phreeze

Phreeze Framework for PHP
http://phreeze.com/
GNU Lesser General Public License v2.1
377 stars 166 forks source link

Ajax #34

Open MarinoRaul opened 11 years ago

MarinoRaul commented 11 years ago

What would be the right way to do a ajax in Phreeze?! For example, I want to make a jquery ajax for where I place my php controller for the answer?! In that folder, you should create one? or is there something already done to make any XMLHTTP request.

Thks!

Raúl.-

jasonhinkle commented 11 years ago

You can just use jQuery's ajax function to make request. If it's something that's bound to a model, though, then you can use Backbone's fetch & save functions to read and update models as well.

The Phreeze libraries are mainly on the server (PHP) side, thought the generator does generate nice backbone client code for you - you're free to change it around as needed. Hope that helps..?

MarinoRaul commented 11 years ago

Thanks for the reply!

I have nothing to update a model, I have a PHP ajax to make a response, I do not understand is where I place my PHP file, and as routing, or what I have to do is put my method in the page's I'm in the driver?! ie libs-> Controller-> miControlador.php

I do not understand what is the right way to do it with backbone, if someone can give me an example and others will appreciate :)

jasonhinkle commented 11 years ago

Thanks for giving Phreeze a try! If you haven't checked out the training videos that would be a great place to start. In particular #2 about routes and controllers will get you going as far as where to put your PHP code and how to get input in/out of it.

http://phreeze.com/training/

But in your case specifically for a filter you would be working only in the Controller class "Query" method

MarinoRaul commented 11 years ago

Thanks! :)

Solved!