Blog posts tagged 'PHP'

DRY resource controllers in Laravel

04 April 2017

Handling basic form submissions in Laravel controllers can be a chore, with repeated code doing similar things over and again. The approach I've been using to get DRY-er code is to abstract out form submissions, making them much less laborious and less prone to error. Read more

Tags: Laravel PHP

Skip to navigation

Toggling a form with AJAX and PHP

18 October 2016

I recently had to add a toggling widget to a web page. I didn't want to reload the whole page, but I did want the page to update after the data had been processed. How is this done? Why, AJAX, of course. Read more

Tags: HTML JavaScript PHP

Skip to navigation

The submit-update-refresh cycle

04 October 2016

A common pattern in web applications is to submit data, add it to the database, then update the view. In this post, I outline a very simple set of PHP functions to do this, and a couple of tricks to bear in mind. Read more

Tags: PHP

Skip to navigation

Anchors, buttons and inputs

10 May 2016

CSS frameworks, like Bootstrap, often allow you to style anchors, buttons and inputs in the same way. But what's the difference between them, and when should you choose one over the others? Read more

Tags: Bootstrap HTML PHP

Skip to navigation