Saad Farooq

I have issues... need pull requests

    © 2014. Saad Farooq All rights reserved.

    POST request from AngularJS with Yii

    29 Jun 2013

    I don't like Yii much. Maybe it's cause of the overbloatedness of PHP.

    AngularJS, which is what I'm using in the front-end, allows you to send Javascript objects using POST requests via JSON. When you do that, you expect there to be a $_POST object in Yii from which you can conveniently partake of your desired data.

    After spending some time trying to figure out why that is so, I came upon this post. It's annoying but basically you have to just do a low-level PHP read using.

    $post = file_get_contents("php://input");

    Oh Yii !! How I hate thee...

    blog comments powered by Disqus