Blog


wget – ignore robots.txt rules when grabbing site files

Simply do: wget -r -e robots=off –wait 0.25 http://thesite.com

Read more...



SVG Not Displaying

  • September 11, 2013
  • Apache

I’ve just been configuring and setting up a server environment for a project i’ve been building. Everything working at it should, except my SVGs were not showing. In this instance, Apache doesn’t know how to serve them up, so I added the following lines to a .htaccess file in the document root: [code] AddType image/svg+xml […]

Read more...



fuelphp simpleauth – group or group_id

There’s an error here: /packages/auth/classes/auth/login/simpleauth.php line 257: ‘group_id’ => (int) $group, should actually be: ‘group’ => (int) $group, otherwise you will get an error when generating with Oil.

Read more...



Setting a default order_by in related models using fuelPHP

Notes on the system i’m building: A user has many sets of related data, one set being a list of quote item rates which get used (to form a dropdown) when a user is creating a quote item, this list of course needs to be ordered correctly, as the user can manage these items, deleting, […]

Read more...



Setting up MySQL on Mac OS

A few notes for next time… and this may help someone else you never know! Even after doing this multiple times it’s easy to forget a step and wonder why things aren’t working. After moving all my data to a new mac, i need to install mysql. Install mysql. (Grab a .dmg from mysql.com) Move […]

Read more...



fuelphp custom configurations

I recently built my client management / quote / invoice system using fuelPHP, and needed to add some defaults settings when a new user registers to use the system. For example, a user signs up, their details are stored in a users table, but users also have settings such as quote item rates (£30, £40, […]

Read more...



fuelPHP Related Models

Just as a point of reference, nothing here that isn’t in the fuelPHP documentation. Using fuelPHP Related Models. All relationships are declared in the Model of course. Belongs to A quote will belong to a client, and also a user. [code] protected static $_belongs_to = array( ‘user’ => array( ‘key_from’ => ‘user_id’, ‘model_to’ => ‘Model_User’, […]

Read more...



Pagination in fuelPHP

We always need pagination for displaying many records. fuelPHP makes this easy for us: [code] $countQuotes = count(Model_Quote::query()->where(‘user_id’, Auth::instance()->get(‘id’))->get()); $pagination = Pagination::forge(‘pagedquotes’, array( ‘pagination_url’ => ‘/quotes/’, ‘total_items’ => $countQuotes, ‘per_page’ => 10, ‘uri_segment’ => ‘page’, )); $data[‘quotes’] = Model_Quote::query()->where(‘user_id’, Auth::instance()->get(‘id’))->limit($pagination->per_page)->offset($pagination->offset)->get(); $data[‘pagination’] = $pagination->render(); [/code] And in the View: [code] <table id="quotesTable" class="table table-striped"> <thead> <tr> […]

Read more...



Build a forgot password system in fuelPHP

I built myself a forgot password system in fuelPHP, and have needed it a few times since, so I thought i would write it here. I needed something like this: User visits /forgot, enters their email address, we check that it exists, if so, generate a unique string and email them. The link should expire […]

Read more...