Tag Archives: PHP

CakePHP and Character Set in the Database

Today I found something in the CakePHP which saves me a lot of effort when I need to migrate the database as well as searching for non-English characters from the Database. What is the story:
I had 2-3 projects build with Cake which were for non-English environments. That means the localization of the projects as well as storing proper data into DB with proper encoding. The current project is the same.

In these projects I saw that the data was not stored properly in the MySQL. From the Cake project interface everything looks ok, but when I open phpMyAdmin – the chars looked like strange symbols /not ??? neither ӗ&୶/. So far I ignored this because as far it is working from CakePHP interface for me everything was ok.
Continue reading

Extended Autocomplete Helper

When I started with CakePHP, my first project includes also Autocomplete functionality for some fields. Of course I start using default Ajax Helper provided from the library. The main problem was that in most of the cases I needed the ID of the string which I searched. The best example is the Country list which is very easy to be accessed with Autocomplete, but instead to messing up with strings as usual developer I wanted to have the ID of the specified country. I used some kind of hack by adding callback function onComplete, which checks the selection in the Autocomplete field, and by this selection set hidden ID field, but as you can imagine this is not the best choice, first of all because it’s a hack – you rely on a sting which already sound as a hack /imagine if you are searching in a list there are some duplicated entries – examples are too many/ and second if you rely on callback this mean that you need another second or two for the second responce. Anyway, by giving this examples just wanted to convince you once again that Autocomplete helper with Key and Value related are really necessary in the projects /or at least that’s what I am thinking./

Well so far the default Autocomplete helper doesn’t provide such functionality. That’s why I created this helper which solves this problem partly. Why partly? You will see the answer of this in Strict Autocomplete with Scriptaculous (Part II)
Continue reading

CakePHP – my new best friend.

From the beginning of the year I decided to move from my home-grown PHP Framework to CakePHP. Here I will explain how I moved and which were the reasons for this. I will mention only the important things which drive me to this decision.

So here are the most critical issues while you using Home-grown or Community Frameworks:
Continue reading

Komodo – My editor in Ubuntu

since I start using Ubuntu from version 6.06 I had problems finding the proper editor fitting my needs and having similar features like UltraEdit. So I tried all provided by default from standart Ubuntu installation: Ajunta, BlueFish, Screem, but no one match my requirements and I start using gEdit. not bad for simple operations, fast, but macros are applied only to file type: for example if you want to add HTML macro printing directly basic html structure of the document to a *.php file – you cant. It’s only for HTML files. Also suporting function sintax is not the first thing, which you can run on gEdit, but this was the reality – this editor suited me best.

Well a year ago I saw the Komodo Edit and I love it! it looking 99% the same as UltraEdit and also support Macros, there are Syntax Check etc.
Language integration is suported very well and there are hints about functions and their attributes.

What I miss is Code Inteligence API for CakePHP, because I am using that Flamework for building my latest projects. Let’s hope somebody will make cix file for it.

Probably in other posts I will mention about my projects. For now – that’s it