Re:Show HN: Laravel 4 - This framework is revolutionizing PHP.
by BaconJuice on Tuesday May 28, 2013 @04:16PM
(#5782459)
Hi, I'm currently a heavy codeigniter user, looking for a switch. Can you please give me some of these examples you speak of that blow you away? Thank you.
[ Parent
| on HN ]
Re:Show HN: Laravel 4 - This framework is revolutionizing PHP.
by moneyrich1 on Tuesday May 28, 2013 @06:38PM
(#5783333)
one that got me was in a controller you can:
return Model::Find('asdf=1');
and it outputs a json serialized array as html. so your ajax action is like one line of code, yay. or you can $row = Model::Find('asdf=1'); and manipulate in php from there.http://www.youtube.com/watch?v=QSt9rBa_oUM this guys series on laravel is really good.
Re:Show HN: Laravel 4 - This framework is revolutionizing PHP.
by deefour on Tuesday May 28, 2013 @07:16PM
(#5783500)
> and it outputs a json serialized array as html
Actually, it renders a raw JSON response - a single object of 'unguarded' attributes (all by default) for the model with Content-Type: application/json set. It has nothing to do with HTML.
Your syntax is invalid too. To do what you want you'd actually call
return Model::where('asdf', 1)->first();
Re:Show HN: Laravel 4 - This framework is revolutionizing PHP.
by T3RMINATED on Tuesday May 28, 2013 @04:37PM
(#5782597)
lets just say im a ex-CI user that wrote a huge app in CI and abandoned CI and went w/ Laravel the move cost 4 months of devs and about 20K... it was worth it.
with no leadership and clear vision CodeIgniter is screwed... L4 follows PHP-Fig standards and it uses composer packaging, it has great leadership, community and is growing...