PHP / mySQL 6 comments
I couldn't find any helper for CakePHP to implement GeSHi, so I had to write my own. Bellow are the results of this helper in action.

To be able to use this helper you need to download GeSHi and put it in /app/vendors/geshi directory. You only need geshi.php and the geshi folder.

/app/views/helpers/formatting.php
 to view the code read the full post

Load the helper into your cotroller var $helpers=Array('Formatting');. To tell the helper what to highlight, the text from your view must be between the <code></code> tags. You can specify the language you wish to highlight like this: <code language="php"></code>. If no language is defined, the default ...read more
PHP / mySQL 3 comments
In CakePHP it is possible to make rules to validate form post values. In the model you use $validate as an array of validation rules.

Usually this would look like this:
 to view the code read the full post

This is all good unless somebody is inserting spaces. At that point the validation returns true and saves spaces into your database table. I guess that is not the desired result. One solution would be to trim individually every input in the controller before validation. That would result in too many lines. CakePHP should have this built in.

The other solution for doing this and loosing those extra lines it is to put the following code in your app_controller.php:
 to view the 
 ...read more
PHP / mySQL 0 comments
Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Provides a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.

I don't like to use WordPress or any other blog system, the reason for this you can read it here: Once you start doubting, there's no end to it, so I (re)wrote my own. Initially was written only using some classes, no framework, code contained design and it was hard to maintain. So I decided to build something more flexible, for this I needed a framework.

After many hours off googleing ...read more
Pages: 1