Pages related to the keyword: Code

Bootstrap 3 Helper for CakePHP 2.x 25/09/2013

The new version of the Helper that allows to automatically make your forms Bootstrap compatible has been updated for Bootstrap 3 : find sources on Github.

The Helper for Bootstrap 2.3 is still available.

Read more...
This page belongs to the following categories: news , CakePHP , Code

Managing accents in text searches 21/07/2013

A good search engine must be flexible since words searched by a user may be present in database, but in a different shape. The most obvious example is the presence of uppercase letters in the text: if a sentence begins with "Tomorrow, ...", this word must be recognized by the search engine even if the user has typed "tomorrow" or "TOMORROW".

Many written languages use special characters (accentuated or other) that cause the same issue: the same word can be written in different shapes depending on the presence or absence of those characters (especially because of uppercase letters, which are often unaccentuated). The french word "sérénité", if it appears in a title, may be written in the shape "SERENITE". The engine must not only ignore the case but also the accents.

Read more...
This page belongs to the following categories: news , CakePHP , Code , Plugin , Accents

Document Manager Plugin for CakePHP 2.x 18/07/2013

The Document Manager plugin provides an out of the box simple file management interface for any CakePHP 2.x application.

You define a base directory inside the webroot folder for your arborescence and inside you can create folders, upload/rename/delete files, browse them, obtain the absolute URL of any file in order to be able to link to it. Uploaded files informations are stored inside a Document table which allows to easily access them in your application. 

Moreover it can be hooked to an user management system to manage ownership of files and prevent files edition or deletion by other users. If you do not have an user management system, you can easily disable file ownership management to have an open system.

It requires jQuery to perform.

Read more...
This page belongs to the following categories: news , CakePHP , Code , Plugin

Remove Word formatting in a Rich Text Editor using JavaScript 29/04/2013

Most CMS have a built-in WYSISYG editor allowing to edit formatted text. They have advantages but also some flaws. One of the recurring problem is to handle formatted text imported from Word or OpenOffice, because they create horrible HTML code that is most of the time undesirable and will screw your CSS. Some editors allow to import non formatted text, but sometimes you also want to manage the text formatting yourself.

If you develop an editor or want to adapt one, it can be helpful to handle the text formatting.

Read more...
This page belongs to the following categories: news , Code , JavaScript

How to save HasAndBelongsToMany (HABTM) data in CakePHP 16/04/2013

Saving data from a HasAndBelongsToMany (HABTM) relationship with CakePHP is not the easiest part of using this framework. Just have a look at all the related questions in Stack Overflow or dedicated forums... The main difficulty is that the format of HABTM data is not the same wether you want to associate existing records together (only update entries in the join table), or create new records and also associate them (create new records in the models table and in the join table).

In addition, they are both different from the data format returned by a find() operation which, for all others associations, can be directly used as such with the save() method.

So you have to be extra careful to choose the right data format depending of which use you are considering.

Read more...
This page belongs to the following categories: news , CakePHP , Code

Simple Bootstrap Helper for CakePHP Forms 05/04/2013

Great plugins exist to integrate Bootstrap within CakePHP, like twitter-bootstrap-helper. However, even if they allow to easily integrate Bootstrap elements within an application, they do not allow to change automatically the display of existing forms.

If you have generated your forms within your views with the 'cake bake' console command, or by following the same standard, here is a helper that will instantly make your forms Booststrap compatible.

This Helper is compatible with Bootstrap 2.3.1 and Cake 2.X.

Read more...
This page belongs to the following categories: news , CakePHP , Code

The online CakePHP cheat sheet 02/04/2013

Discover all sorts of code snippets for the CakePHP framework, nicely presented and ordered: http://cakephpcheatsheet.com

 

Read more...
This page belongs to the following categories: news , CakePHP , Code
5103
Petits fours baked