Articles


Injecting a model instance into a controllers action

7 months ago by: matt

This is a continuation/update from my Phalcon PHP route model binding post. My pull request has since been merged and made its way into Phalcon 3.0.0. This is taken from the documentation I wrote for this feature here.


From 3.0.x onwards the dispatcher comes with an option to handle this internally for all models passed into a controller action.

use Phalcon\Mvc\Dispatcher;

$dispatcher = new Dis...

Continue reading


Phalcon PHP Paginator with URL parameters

1 year ago by: matt

So this is an issue that a few people on the forums and github have reported. Common scenario would be searching or filtering where you are adding additional parameters into your request. Something like the following:

http://mydomain.com/articles?sort=desc


Now you would expect the following output if you have your Paginator set up correctly:

<?php echo $page->next ?>

//Output
?page=2&sort=desc


How...

Continue reading


PHP Dublin Meetup - January 2016

1 year ago by: matt

First meetup of 2016 and probably the best one I've attended so far. Rasmus Lerdorf himself gave a great presentation/introduction to PHP 7 which came with examples and benchmarks. I also loved the deployment example without loosing requests in progress. Obviously there is still no similar solution for deployments with schema changes but one can dream...

PHP 7.0.2 has already been released so there...

Continue reading


Phalcon PHP route model binding

1 year ago by: matt

Edit: I have since this article was written updated the Phalcon documentation here to include this example. I have also put in a pull request to 2.1.x to put this functionality into the dispatcher in the phalcon core.


So this is something I discovered today after creating a new feature request over on the cphalcon GitHub. My initial request was to allow for route model binding similar to what is ...

Continue reading


Image upload with Summernote 0.7 and Laravel 5

1 year ago by: matt

Couldn't get this working right out of the box due to some changed syntax/callbacks on summernote so here's some quick code samples on how to get image upload working for summernote 0.7. Keep an eye on the summernote insertion API for any changes in future:

http://summernote.org/deep-dive/#insertimage

Unless you have manually disabled csrf, Laravel will be expecting the post request to also submit t...

Continue reading