TipLite Keep It Simple Smart

30Jan/120

CakePHP 1.3 helper auto-complete in netbeans

CakePHP 1.3 introduced a new way to use helpers. This was added to prevent confusion between helper variables and local variables added to the view file. You can access helper methods in a view by using $this->Helper->method(). This way make a problem if you want to use auto-complete for helpers introduced in a previous article

1Nov/110

Quick tip: Get element content within the controller in CakePHP

This is an easy quick tip to able able to get an element's content from within a controller in CakePHP 1.2 or 1.3. The trick is simple you just need an instance from View class to be able to use its element function within the controller.

21May/114

How to install RVM on Windows using cygwin

rvm-logo

Ruby enVironment Management (RVM) is a tool to install multiple versions of Ruby which may be necessary when you want to develop or test applications that run on different versions of Ruby. RVM can be installed on Unix like operating systems like Linux or Mac OS. RVM doesn't support Windows operating system yet. But you can overcome this by using cygwin which brings Unix shell tools to Windows.

10May/114

Convert all your MySQL database text fields to unicode (or any other encoding)

php_mysql

Have you ever faced a problem when the text fields in your database have different encoding? This usually happens when you import table structure from another database with a different encoding, or when you neglect the encoding at all, which I consider as a bad practice.
Later, this can cause some queries to fail specially if you are comparing two text fields. This may seem as a rare case but I ran into it enough times to write this post :D .

30Aug/1012

CakePHP debug in NetBeans

Break point in NetBeans

Debugging code can be the most vital task a developer required to do. Debugging makes it easy to find logical errors in code. NetBeans supports PHP debug using xdebug, but in CakePHP it is hard to make this work straight. This is due to custom, pretty, URL rewriting. However you can enable debugging even with pretty URLs and URL rewriting.

12Jun/100

Quick tip: Enhanced bash completion in Fedora and CentOS

If you are using fedora or CentOS as a work station or on a VPS you can enhance your bash auto-completion (That appears when you press TAB key). To do this print the following command as root:

12Feb/1028

CakePHP support in NetBeans

NetBeans is a very powerful development environment for many languages including PHP. With the release of its latest version, NetBeans announced full support for symfony PHP framework. NetBeans can also support many other PHP frameworks and libraries although it is not officially supported by NetBeans. This support needs some effort to enable some tools specially auto-complete, or intellisense, which saves a lot of time for developers.

We will start to make NetBeans support CakePHP. Firstly we need to create a cake project using cake command line tools.

5Feb/1011

Useful NetBeans 6.8 – PHP tips

NetBeans has introduced a very powerful development environment for PHP since version 6.5. It has some features that make development even easier. Until NetBeans has launched its 6.8 version, it introduced many features for PHP developers. Here is some features:

21Jan/105

A Quick jQuery tutorial

A quick jQuery tutorial which I found during my preparation for 'jQuery How To Start' series of tutorials for learning the amazing JavaScript library. This is a slideshow which I liked and liked to share it with you. It introduces some basic features of jQuery and shows some advanced uses of this library like jQuery-UI the jquery library which is used to create UI effects and widgets.
5Jan/100

Expand swap space (virtual memory) on a Linux machine

Linux needs swap space or virtual memory to expand the real memory (RAM), and believe me it won't work as expected all the time if there is no sufficient swap space. Swap space usually is setup as a separate partition which is set during installation or later by the system administrator. But sometimes you need to create extra space for virtual memory for any purpose (Oracle installation for example). But if you don't want to mess up with your hard disk, here is a simple way to create a file which serves as a swap partition.