Get the Blog Updates

Your information will not be shared with any 3rd parties under any circumstances.
Image Image Image Image Image
Scroll to Top

To Top

Scroll to Top

To Top

Search Results for: label/Php Developer



No Comments

In CakePHP

By Prakash S.

An introduction to PHP Frameworks

On 24, Jul 2013 | No Comments | In CakePHP | By Prakash S.


A framework is a structure that developers choose to build their application. It determines the structure of the application and facilitates it to connect with many different API’s. A proficient PHP framework enables developers to develop PHP application faster, efficiently and assist in building stable applications thereby reducing the amount of repetitive coding for PHP programmers.

Frameworks provide scaffolding features that facilitates the development team to build faster and cleaner application. They often provide toolsets for both the UI components and the database access.

Note: It is advisable to use the latest stable version of a framework.

Here are few aspects of a proficient PHP framework:

MVC Architecture:

  • The framework should make use of Model View Controller (MVC) architecture. Some of the best frameworks also provide libraries, plug-ins, helpers, and extensions to assist developers. It would be smart and efficient to employ a framework that has at least two of these options.

Database Support:

  • It is one of the most crucial aspects of every PHP development framework. You need decide your framework depending on the database you are going to use for your web application.

For Example:  ‘CodeIgniter’ supports MySQL, Oracle, and SQLite, whereas the ‘Kohana’ framework doesn’t.

Community & Documentation:

  • The framework should be supported by a strong community, not just in terms of size but also in terms of activity and usefulness. Even if it’s a small community, you should be able to get ample support from the community.

A PHP framework should also have good documentation. It should be comprehensive and up-to-date.

Below, I have provided a list of some popular and commonly used PHP frameworks.

CakePHP 2.x:

  • CakePHP is a rapid development framework for PHP. It’s a foundational structure for programmers to create web applications. CakePHP has an active developer team and community, bringing great value to the project. It is also the most preferred development framework.


Symfony 2.x:

  • Speed up the creation and maintenance of your PHP web applications. Replace the repetitive coding tasks by power, control and pleasure.

        Source: http://symfony.com/

CodeIgniter 2.x:

  • CodeIgniter is a powerful PHP framework with a very small footprint, built for PHP coders who need a simple and elegant toolkit to create full-featured web applications.

         Source: http://ellislab.com/codeigniter

Zend Framework 2:

  • It is an open source framework for developing web applications and services using PHP 5.3+. Zend Framework 2 uses 100% object-oriented code and utilizes most of the new features of PHP 5.3, namely namespaces, late static binding, lambda functions and closures.
  • Zend Framework 2 evolved from Zend Framework 1, a successful PHP framework with over 15 million.

        Source: http://framework.zend.com

Yii Framework 1.1.x:

  • Yii comes with rich features: MVC, DAO/ActiveRecord, I18N/L10N, caching, authentication and role-based access control, scaffolding, testing, etc. It can reduce your development time significantly.

        Source: http://www.yiiframework.com

Kohana 3.x:

  • An elegant HMVC (Hierarchical model–view–controller) PHP5 framework that provides a rich set of components for building web applications.

        Source: http://kohanaframework.org/


  • It is a simple, flexible, community driven PHP 5.3+ framework, based on the best ideas of other frameworks.

        Source: http://fuelphp.com/

There are a number of PHP development frameworks in the market which enables the development team to do more with the programming language. Development frameworks makes coding for PHP more manageable and programmers can take its advantage by making use of a convenient development framework.

Tags | ,



No Comments

In CakePHP

By Priyadarshini M.

How to integrate PayPal in PHP

On 05, Jul 2013 | No Comments | In CakePHP | By Priyadarshini M.


To accept online payments through your website you would need a payment gateway. There are numerous payment gateways that can be implemented to your website; however you will need to choose the best for your PHP application. “PayPal” is one of the most renowned payment platforms that offers the best in class services as well as secure payment transaction. One of the best features of PayPal is that it facilitates developers to check-out the integration on merchant sites.

From a developer’s point of view, PayPal API is a simple, user friendly and versatile which facilitates them to avoid the PCI burden of having credit card details to be passed through their servers. PayPal is also the most secure platform that takes care of all the money transactions for the users.

Integrating PayPal in your website

The first thing we need is a Sandbox Credential and API Credentials. This can be availed using the following steps:

  • Create a Business account in “https://developer.paypal.com/” in order to access the Sandbox account.
  • Log into your business account; move to the ‘Application Tab’ and create a Sandbox test account for developers to check-out the PayPal integration.
  • For PayPal payment pro services, you can use this Sandbox Credentials for logging into “https://www.sandbox.paypal.com/”
  • If you want to login to your sandbox account you have to first log into your developer account.

Steps to implement ‘the work’ in your site

  • In PayPal payment pro ‘the work’ is done through API call.
  • In your code you will have to implement a function i.e. ‘PPHttpPost(methodname,str);’
  • ‘methodname’ specifies the name of the API you want to call i.e. ‘CreateRecurringPaymentsProfile’, ‘GetTransactionDetails’ etc.

There are numerous other methods for the integration which can be availed form the PayPal developer site:  https://developer.paypal.com/webapps/developer/docs/classic/api/

Under ‘Merchant’ API you would find a list of functions that can be performed by PayPal website pro.
Clicking on NVP link of each function you can view the methods and the required parameters for that method.

Second Parameter in the string; which is passed to the API, is for getting the response. It includes all the parameters that have to be passed e.g.

$str = "&TOKEN = $token&AMT = $paymentAmount&CURRENCYCODE = $currencyID&PROFILESTARTDATE =



Note: This string might differ for different methods but the structure is similar.

  • This function returns an array having one key as ACK.
  • The value of this key specifies the FAILURE and SUCCESS of the function.

If ACK is a failure then the returned array contains following error message.

function PPHttpPost($methodName, $nvpStr_) {

$APIUserName = urlencode('API USERNAME');

$APIPassword = urlencode('API PASSWORD');

$APISignature = urlencode('API SIGNATURE');

$APIEndpoint = "https://api-3t.sandbox.paypal.com/nvp"; //sandbox url.

$version = urlencode('51.0');

//setting the curl parameters.

$choice = curl_init();

curl_setopt($choice, CURLOPT_URL, $APIEndpoint);

curl_setopt($choice, CURLOPT_VERBOSE, 1);

//turning off the server and peer verification(TrustManager Concept).

curl_setopt($choice, CURLOPT_SSL_VERIFYPEER, FALSE);

curl_setopt($choice, CURLOPT_SSL_VERIFYHOST, FALSE);

curl_setopt($choice, CURLOPT_RETURNTRANSFER, 1);

curl_setopt($choice, CURLOPT_POST, 1);

//NVPRequest for submitting to server

$nvprequest = "METHOD=$methodName&VERSION=$version&PWD=$APIPassword&USER=$APIUserName&SIGNATURE=$APISignature";

// setting the nvprequest as POST FIELD to curl

curl_setopt($choice, CURLOPT_POSTFIELDS, $nvprequest);

//getting response from server

$httpResponse = curl_exec($choice);

if(!$httpResponse) {

exit("$methodName failed: ".curl_error($choice).'('.curl_errno($choice).')');


// Here Extract the RefundTransaction response details

$httpResponseArr = explode("&", $httpResponse);

$httpParsedResponseArr = array();

foreach ($httpResponseArr as $i => $value) {

$tmpAr = explode("=", $value);

if(sizeof($tmpAr) > 1) {

$httpParsedResponseArr[$tmpAr[0]] = $tmpAr[1];

if((0 == sizeof($httpParsedResponseArr)) || !array_key_exists('ACK', $httpParsedResponseArr)) {
exit("Invalid HTTP Response for POST request($nvprequest) to $APIEndpoint.");
return $httpParsedResponseArr;

Setting of IPN URL

IPN stands- Instant Payment Notification

Under the Profile tab of the sandbox site there is an ‘Instant Payment Notification preference’ link. Set the IPN URL from the link.


This notification is sent from server to server when any transaction is done in PayPal. To capture this transaction we can set URL in Instant Payment Notification preferences page and manage those transaction information.

Tags | ,



No Comments

In CakePHP

By Gayadhar K.

How to convert documents to PDF in PHP?

On 07, Jan 2013 | No Comments | In CakePHP | By Gayadhar K.

‘Unoconv’ is the tool to convert doc, docx, odt to PDF file in PHP.


‘Unoconv’ is a command line utility that can convert files from any ‘OpenOffice’ supported formats to a different ‘OpenOffice’ supporting format.


Installation Required:

  • OpenOffice and Unoconv

You can provide one or more files as arguments to convert each of them to the specified output format.


unoconv -f pdf  example.doc

bove command will convert the example.doc to example.pdf in the current working directory.

Some other commands are:

unoconv -f odt example.doc
unoconv -f doc example.odt
unoconv -f jpg example.odt
unoconv -f xsl example.csv

Tags | ,



No Comments

In CakePHP

By Jay Dee

Why cakePHP is popular? And the role of CakePHP developer

On 16, Jan 2013 | No Comments | In CakePHP | By Jay Dee

cakePHPCakePHP is an open source PHP based rapid development framework. It offers great run-time infrastructure along with abundant set of libraries for CakePHP developers. Cake PHP development is supported by the MVC (Model View and Controller) architecture which differentiates the programming logic from the data presentation layer.

It also features other programming concepts like Front Controller, Association Data Mapping and Active Record. Along with these, there are numerous other features that make CakePHP one of the most preferred web development frameworks among others.

Let’s take a look at some features here

Wide Community:

CakePHP developers are supported by huge peers who make use of this framework. There are many contributors and programmers who share the community. For this reason, using the framework is simpler for development as well as for research.


It facilitates the developers in saving a lot of efforts through PHP development. Because the programmer make use of a prewritten code for more than one project. In other words, they can focus on the logical and creative part of application whereas the tedious task of coding could be handled with ease.

Open Source:

The framework is open source, for which the CakePHP developers do not have to spend any amount in the process of development and have complete access to its source code. It also assists the developers in adding robustness and improves performance in web applications.

Some of the roles of CakePHP developers include

    • Manage development efforts and framework efficiently
    • Support product releases
    • Ability to handle lot of projects in less time
    • Overall review of the quality & progress of the work
    • Support stable user growth

Here at Andolasoft we provide our customers with a unique and up-to-date approach towards their Web-app development. We design and develop intriguing web applications using PHP/CakePHP. We follow agile development approach to deliver project on time and within budget to our customer

Tags | ,



No Comments

In CakePHP

By Mahavir S.

Facebook Login Migration (Using PHP SDK (v3.0.0))

On 29, Jan 2013 | No Comments | In CakePHP | By Mahavir S.

PHP1If you are doing migration from v2.2.x to v3.0.0

You need to do the following changes.

  • Download SDK: https://github.com/facebook/facebook-php-sdk
  • Keep the two classes base_facebook.php and facebook.php with the certificate fb_ca_chain_bundle.crt
  • Include facebook.php in your php file.
  • If you’re currently using the PHP SDK (v2.2.x) for authentication, you will recall that the login code looked like this:
include_once("facebook.php"); OR include_once("base_facebook.php");
$facebook = new Facebook(…);
$session = $facebook->getSession();
if ($session) {
// proceed knowing you have a valid user session
} else {
// proceed knowing you require user login and/or authentication
  • The login code is now:
$facebook = new Facebook(…);
$user = $facebook->getUser();
if ($user) {
// proceed knowing you have a logged in user who's authenticated
} else {
// proceed knowing you require user login and/or authentication

I hope you like this post and if you want to get such type of updates then please subscribe our email. You can also visit our PHP/CakePHP portfolio page to see all our apps developed on php or cakephp platform.

Tags | ,



One Comment

In CakePHP

By Mahavir S.

How to use PHP SDK for Facebook Posting

On 01, Jul 2013 | One Comment | In CakePHP | By Mahavir S.


Facebook is a leading social media website that houses over 1.1 billion active users and 665 million daily active users over the world. Facebook is preferred by the businesses for its cost-effective marketing strategy. It is one of the best social marketing website for better customer engagement.

Marketing experts believe that ‘Facebook’ posting is the key to social marketing.

Facebook Posts through Application:

    • For Facebook posting, the first thing we need is the User Access Token.
    • We can get the Access Token when user connects Facebook account to the application.
    • There are two types of page where we can post.1.    Personal Page2.    Fan Page
    • To post on Fan page, we need to get the Page Access Token using the User Access Token.
    • An API call to https://graph.facebook.com/me/accounts?access_token={USER_ACCESS_TOKNE}
    • Facebook PHP SDK: https://github.com/facebook/facebook-php-sdk/tree/master/src

Here I have mentioned some major types of Facebook postings.

Status Update

Update your status or write on your wall in plain text.
We can use “\n\n” for line break.

$post_type = '/$page_id/feed';
$post_params = array(
'message' => “Andolasoft, solutions delivered.\n\n Ruby on Rails Development | CakePHP Development | Android and iPhone Application Development”

Share Link

Share a link on Facebook. The link can be a website, news feed, YouTube or an image.
Facebook will get the OG (open graph) title, description and image of that link and post it as a link share to the wall.

$post_type = '/$page_id/feed';
$post_params = array(
'message' => “We're Hiring!”,
'link' => “http://www.andolasoft.com/”

When Facebook finds multiple images, it would choose the first image and post it as a thumbnail.
We can also provide the thumb image to display on the link share.

Note: Facebook use the thumb image greater than size 200*200

$post_params = array(
'message' => “We're Hiring!”,
'link' => “http://www.andolasoft.com/”,
'picture' => “http://blog.andolasoft.com/wp-content/themes/aware/images/blog_as_logo.png”

Upload a Photo

Other than image link share, we can upload a photo to Facebook wall.
We need to upload the photo to a Facebook album. There is a default album “timeline” for the wall photos.

To get the timeline album use FQL,

$fql = “SELECT object_id FROM album WHERE owner=$page_id AND type='all'”
$fql = urlencode($fql);
$fql_query_url = 'https://graph.facebook.com/fql?q=' . $fql . '&' . $access_token . '&format=json-strings';
$fql_query_result = file_get_contents($fql_query_url);
$fql_query_obj = json_decode($fql_query_result, true);
$wall_album = isset($fql_query_obj['data'][0]['object_id']) ? $fql_query_obj['data'][0]['object_id'] : $page_id;

You have to provide the relative path of image to upload.
That image might be a link, but save it in your local file system and provide the relative path.

$imgSrc = '/var/www/html/andolasoft/logo.jpg';
$post_type = '/$wall_album/photos';
$post_params = array(
'name' => “Based in Silicon Valley, we design, develop iPhone, iPad, Android & Web application for startups & established businesses”,
'photo' => '@'.realpath($imgSrc)

Upload a Video

Other than share a YouTube video, we can also upload video to Facebook.
The video must be in the local file system to be uploaded to Facebook.

$videoSrc = '/var/www/html/andolasoft/tour.flv';

$post_type = '/me/video';
$post_params = array(
'title' => “Andolasoft”,
'name' => “Based in Silicon Valley, we design, develop iPhone, iPad, Android & Web application for startups & established businesses”,
'photo' => '@'.realpath($videoSrc),
'picture' => 'http://blog.andolasoft.com/wp-content/themes/aware/images/blog_as_logo.png'

Post to Facebook using the Facebook PHP SDK.

$facebook = new Facebook(array(
'appId' => APP_KEY,
'secret' => SECREATE_KEY

$fbpost = $facebook->api($post_type, 'POST', $post_params);
} catch (Exception $e) {
echo $e->getMessage();


Basic permissions required for above operations are,

    • publish_stream
    • manage_pages
    • photo_upload
    • offline_access

Access Token might invalidate for following reasons,

    • The token expires after the allotted expire time
    • The default expire time of Facebook access token is 2 hours, but we can get the extended Access Token up to 60 days.
    • The user changes her password which invalidates the access token.
    • The user de-authorizes your app.

See More: Facebook Login Migration Using PHP SDK

Tags | ,



No Comments

In CakePHP

By Gayadhar K.

Merge and split PDF in PHP using PDFtk

On 21, Dec 2012 | No Comments | In CakePHP | By Gayadhar K.

PdftkMerge a group of PDF files to a single PDF file without disturbing the contents using PDFtk.

  • PDFtk runs on a variety of platforms, including: Windows, Linux, Mac OSX, FreeBSD and Solaris.
  • It does not require Acrobat and allows you to manipulate PDF easily and freely.

What all you can do in PHP using PDFtk

  • Merge PDF documents to one.
  • Rotate PDF Pages or documents.
  • Split the pages of the PDF into a new document.
  • Encrypt the output as desired.
  • Decrypt the Input as necessary but requires password
  • Background watermark or a foreground stamp can be applied
  • Report on PDF metrics can be generated such as metadata, bookmarks, and page labels.
  • Update PDF metadata.
  • Attach numerous files to the PDF document.
  • Compress a PDF document into a single page.

Under the GPL, PDFtk is licensed for the public.
Download Link: https://github.com/bensquire/php-pdtfk-toolkit

You can provide two or more PDF files as arguments to create single PDF file as output.
Merge two or more PDFs into a new PDF file with all the original contents

  • pdftk example1.pdf example2.pdf example3.pdf cat output result.pdf

Rotate the first page of a PDF to 90 degrees clockwise

  • pdftk in.pdf cat 1E 2-end output out.pdf

Rotate all the pages of the PDF document by 180 degrees

  • pdftk in.pdf cat 1-endS output out.pdf

Report on PDF document metadata, bookmarks and page labels

  • pdftk mydoc.pdf dump_data output report.txt


Tags | ,



No Comments

In CakePHP

By Prabhudas B.

Step by step guide for Image cropping using ‘ImageMagick’ in PHP

On 14, May 2013 | No Comments | In CakePHP | By Prabhudas B.


While using images in a web application, developers can’t always include images of a particular measurement. In such cases, resizing the images for the application would be a good option but, not efficient either. For example, resizing a long vertical image into a horizontal dimension would just squeeze the image; thereby, affecting the aesthetics of the website and also reducing the purpose of it. Hence it would be smart to implement a cropping tool like ‘ImageMagick’ in order to fit images of various dimensions into a specified size.

ImageMagick is a collection of robust and convenient tools for manipulating images. It can be used to crop images of numerous formats such as JPEG, PNG, GIF, TIFF, PhotoCD and many more. ImageMagick facilitates creation of dynamic images that are fitting to the specific requirements of web applications.

Difference between cropping in GD library and ImageMagic:

GD is the most commonly used extension for PHP. It is popular because it is easier to install and configure (`yum install php-gd` on Fedora, CentOS etc or `sudo apt-get php5-gd` on ubuntu). However, it has some limitations such as:

  • It is comparatively slower
  • It is more memory intensive
  • For certain aspects it can be more complex to use.

Below I have mentioned a sample code for image cropping using GD:

function resize_my_image($file, $w, $h, $crop=FALSE) {
list($width, $height) = getimagesize($file);
$r = $width / $height;
if ($crop) {
if ($width > $height) {
$width = ceil($width-($width*($r-$w/$h)));
} else {
$height = ceil($height-($height*($r-$w/$h)));
$newGDwidth = $w;
$newGDheight = $h;
} else {
if ($w/$h > $r) {
$newGDwidth = $h*$r;
$newGDheight = $h;
} else {
$newGDheight = $w/$r;
$newGDwidth = $w;
$src = imagecreatefromjpeg($file);
$dst = imagecreatetruecolor($newGDwidth, $newGDheight);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $newGDwidth, $newGDheight, $width, $height);

return $dst;

$img = resize_my_image(‘/path/to/some/image.jpg’, 150, 150);

You can either output it to the browser or save it to a file using the ‘imagejpeg’ function.


Imagick is a less frequently used PECL extension. ImageMagick is a free tool that is used for creating and manipulating images that supports over 100 different image formats. This can be used on a command line tool for any programming language. The Imagick extension essentially provides an API for all of the functionalities available in the `convert` command line tool.

Some of its advantages are:

  • It is faster
  • It uses less memory
  • Offers more powerful functionality
  • Imagick’ is lot easier to use (once you figure out how), your code may end up smaller and cleaner.

The down side of using this extension is that the documentation is extremely limited and there are almost no examples available on the web. Installation on the other hand can be a painful task as well.

Although it should just be a matter of running the command `pecl install imagick`.

Sample code:
Cropping larger images:

Put a big picture named andolasoft_logo.jpg along side with your php page, run the test and check the directory to see andolasoft_logo_thumb.jpg.

imagemagick with imagick extension

$obj = new imagick('andolasoft_logo.jpg');
//resize the above image
$obj->thumbnailImage(160, 0);
//write the thumb

To crop animated image:

$image = new imagick(“andolasoft_animated_logo.gif”);
$image = $image->coalesceImages(); // the trick! To crop animated image
foreach ($image as $frame) {
$frame->cropImage($width, $height, $x, $y);
$frame->setImagePage(0, 0, 0, 0); // Remove gif canvas

$x → The X coordinate of the cropped region’s top left corner
$y → The Y coordinate of the cropped region’s top left corner

Implementing ‘ImageMagick’ would make the website look clean and flawless. Images on the other hand retain its look and feel, thereby making the application look professional and optimized.

Find anything amiss here, then share it with us.

Tags | ,



No Comments

In CakePHP

By Prakash S.

How to send files to remote server via SSH in PHP

On 05, Dec 2012 | No Comments | In CakePHP | By Prakash S.

PHP1This example describes ‘How to SSH to remote server in PHP and send files from one server to another server using libssh2.’

ssh2_connect() – Connect to a remote server
ssh2_scp_send() – Send a file via SSH
ssh2_exec() – Execute a command on a remote server

Install libssh2 and then install PECL SSH2 extension for PHP.


$ip = "";
$username = "test";
$port = 22;
$public_ssh_key = "/var/www/html/ssh_keys/id_dsa.pub";
$private_ssh_key = "/var/www/html/ssh_keys/id_dsa";
if(function_exists("ssh2_connect")) {
$ssh_conn = ssh2_connect($ip, $port);
if($ssh_conn) {
//Validate your username with ssh keys
if(ssh2_auth_pubkey_file($ssh_conn, $username, $public_ssh_key, $private_ssh_key, 'secret')) {
// Check file list
$stream = ssh2_exec($ssh_conn, 'ls -l /home/test/');
if($stream) {
stream_set_blocking($stream, true);
while ($buf = fread($stream,4096)) {
flush(); // comment this line
print_r($buf); // comment this line
// send file from one server to another
ssh2_scp_send($ssh_conn, '/path/from/file.ext', '/home/test/file.ext', 0777);
else {
die("SSH validation failed using Username: ".$username." (specify valid SSH keys or check your SSH key path)");
else {
die("SSH validation failed for IP: ".$ip);
else {
die("'ssh2_connect()' doesn't exists. Install libssh2 with PECL SSH2 extension");

Other commands:
ssh2_sftp() – Initialize SFTP subsystem
ssh2_sftp_mkdir()– Create directory on remote server

$sftp = ssh2_sftp($ssh_conn);
ssh2_sftp_mkdir($sftp, '/var/www/html/test');

ssh2_auth_password()  – Authenticate over SSH using a plain password
ssh2_auth_pubkey_file() – Authenticate using a public key
ssh2_shell() – Request an interactive shell
ssh2_tunnel() – Open a tunnel through a remote server

Tags | ,



No Comments

In CakePHP

By Prakash S.

How to generate a full working CRUD skeleton using CakePHP 2.x Bake console?

On 09, Jan 2015 | No Comments | In CakePHP | By Prakash S.

CakePHP’s bake console is a command line tool to build fully functional CRUD(Create, Read, Update, Delete) skeleton for your project. As we know CakePHP 3.x is at our doorstep and scaffolding has been removed from it. Cake’s bake console is the extensive scaffolding that generates well documented code for the CRUD operation.

The Cake’s bake console helps you to generate the code for model validations and model relationship. It will ask you, what kind of validation you want and also suggest you the model relationship as per the database convention. We just have to confirm them in command prompt. Going further, Bake can also write Unit Tests for you.



  1. Set the environment variable in your windows machine. Add this line on your environment path –“;D:\xampp\php\;D:\xampp\htdocs\myproject\app\Console\;”
  2. Open the windows command prompt and go to the path – myproject/app/Console

NOTE: If you you have git bash in windows, you don’t have to set the environment variables. Go to the project folder myproject/app/Console and open git bash.


  • No configurations needed, just go to the path – myproject/app/Console in your command line.



The bake console commands are very easy. It is well documented and it will walk you through the process while you are generating the code.

cake bake   is the command to start generating CRUD and it will ask, what do you want to bake.

cake bake all – this will generate code for your model, view and controller. But before that, it will ask you to select a model(as per the database table).

Other commands are: cake bake controller, cake bake model, cake bake view, cake bake project

List of Files (Command: cake bake all)

  • It creates your Controller with four actions – index, view, add, edit.
  • The same index, view, add, edit .ctp view files will be created respectively in the view folder.
  • Model file will be created with all the validations and relationships stated by you while generating them on bake console. (If you have an existing Model, it will ask you to overwrite that)



  • In the add.ctp file you can find the form and the fields to add a new record.


  • The listing(index.ctp) comes with sorting and pagination.
    The view.ctp is the view details of the record.


  • It is the edit.ctp, file with pre-filled data in the form to edit the record.


  • In the listing, you can find the delete link in each records to delete that record.

People say, Cake’s bake is the best friend of “lazy type” developer, but its not true. Smart developer does things quicker and faster with the help of CakePHP’s bake console.

We hope this article would help you to kickstart your CakePHP project real quick. If you have any question or suggestions, you can ask us in the comment section.

Tags | ,



No Comments

In CakePHP

By Prakash S.

How to migrate CakePHP 1.x to 2.x

On 26, Nov 2012 | No Comments | In CakePHP | By Prakash S.

cakePHP1Today, we will focus on what we need to do to get CakePHP 1.3 application upgraded to CakePHP 2.2.3-the latest official stable release


This is pretty straight forward, same as CakePHP 1.3 version.
Download and unzip the CakePHP 2.2.3 and follow these below-mentioned instructions.


  • core.php
  • Make sure to copy the security.salt and Security.cipher_seed from your old core.php
  • Take notice of how errors, sessions and caching have changed.
  • database.php
  • There is a minor change on this file,
  • CakePHP 1.3: ‘driver’ => ‘mysqli’
  • CakePHP 2.2.3: ‘datasource’ => ‘Database/Mysql’
  • routes.php
  • Don’t overwrite this file with your older one.
  • You can place your custom routes before or after CakePlugin::routes()
  • bootstrap.php
  • Copy all functions, constants and other code from your old bootstrap into the new one.

Folder Structure

  • The cake folder is now inside lib folder. There is nothing to do with this.
  • Files and folders are now CamelCased instead of lower_underscored
  • Example: The “users” folder inside the View becomes “Users”
  • The controller files are now UsersController.php instead of users_controller.php
  • project_user_controller.php becomes “ProjectUsersController.php”
  • The model files are now User.php instead of user.php
  • project_user.php model becomes “ProjectUser.php”
  • The components files are now FormatComponent.php instead of format.php
  • The helpers files are now DatetimeHelper.php instead of datetime.php

Moved APP files

  • The parent app_classes have been moved and renamed as well.
  • Instead of app_controller.php, app_model.php, and app_helper.php now become Controller/AppController.php, Model/AppModel.php, and View/Helper/AppHelper.php.

Auth Component and Login

  • Auth now supports multiple authorization adapters that can all be used together
  • Cake 1.3.x was automatically checking if user has correctly entered username/password inside your login () method of users_controller but in cake 2.x we need to manually call $this->Auth->login () this returns Boolean value based on successful login or failure.

If you are using “email” as your login field name
CakePHP 1.3: (inside AppController beforeFilter)

$this->Auth->fields = array('username' => 'email', 'password' => 'passw

CakePHP 2.2.3: (inside AppController beforeFilter)

$this->Auth->authenticate = array('Form' => array('fields' => array('username' => 'email', 'password' => 'password')));

Auth Login

CakePHP 2.2.3: (inside UsersController login function)

if (!empty($this->request->data)) {
if ($this->Auth->login()) {
} else {
//$this->Session->setFlash('Your Email or Password was incorrect.');

CakePHP 2.x auth automatically hashes the password on login but not on save.

We can add a beforeSave() method on the User model to hash the password.

public function beforeSave($options = array())
$this->data['User']['password'] = AuthComponent::password($this->data['User']['password']); return true;

Request Data

  • CakePHP 2.0 has done some request related changes.
  • The Request Object does not have “form” element any longer.
  • You will need to replace $this->params[‘form’] with $this->request[‘data’] or $this->request->data.
  • $this->data needs to be replaced with $this->request->data
  • So, now we can use $this->request->data on both form submit and AJAX post.
  • Now, we need to check !empty($this->request->data) instead of “!empty($this->data)” while saving a form.

Views Changes

  • Use $this->Html->link() instead of $html->link()
  • Use $this->Form-> instead of $form->
  • Use $this->Session-> instead of $session->
  • Use $this->Paginator-> intead of $paginator ->
  • For JavaScript inclusion use $this->Html->script(“”) instead of $javascript->link()

Moved Email Elements

  • Email elements have been moved from views/elements to View/Emails.


  • The Ajax, Javascript, and XML helpers have been removed. You will need to replace these helper calls with appropriate alternatives
  • Helpers can no longer be called with “$helper->function()”. You need to update your helper calls to use $this->Helper->function()
  • If you are loading or importing your helpers inside another custom helper or component,
  • $myhelper = new DatetimeHelper() becomes $myhelper = new DatetimeHelper($this->_View) or $myhelper = new DatetimeHelper(new View(null))


  • All component files should be extended by Component Class instead of Object

DB and Code Caution

  • There is no Enum Support in cakephp2.x as sql server doesnt have similar datatype.
  • You can change enum to tinyint(2)
  • In cake 1.3 used tinyint(1) for is_active database fields.
  • While retrieveing from database it returns 0/1
  • But, cakePHP2.x no longer returns as 0. This will return bool(true) /bool(false)
  • Boolean column values will be casted to php native boolean type automatically.

__() Function and Pagination

  • The __() function no longer has the option to echo. It always returns
  • Change the Pagination code,

CakePHP 1.3:

echo $this->Paginator->counter(array( 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%'', true)));

CakePHP 2.2.3:

echo $this->Paginator->counter(array( 'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%'')));

Tags | ,



No Comments

In CakePHP

By Prakash S.

How to setup CakePHP DataSource for Solr?

On 04, Jul 2014 | No Comments | In CakePHP | By Prakash S.


Imagine that you have millions of data and your SQL database is not optimized enough to handle them, then “Solr” is your best data source. Apache Solr is a fast search platform. It’s major features include full-text search faceted search, dynamic clustering, database integration, rich document handling. Solr is highly scalable and it is the most popular enterprise search engine.

This document will guide you through DataSource setup for Solr in CakePHP. Set-up the Solr DataSource in CakePHP and query Solr with your CakePHP model “find” function, just similar to querying any other SQL database.


Configuring your the DataSource for Solr database connection:

  • host: Solr server address.
  • port: Solr server port.
  • datasource: This should match with your DataSource at /app/Model/Datasource/SolrSource.php
public $solr = array(
 'datasource' => 'SolrSource',
 'host' => '',
 'port' => '9983',
 'path' => '/solr/'


Use the database config in your models like:

class Solr extends AppModel {
 public $useTable = false;
 public $useDbConfig = 'solr';


Below code describes only the most required functions.

  • You can find other required functions at http://book.cakephp.org/2.0/en/models/datasources.html
    Like: calculate($model, $func, $params) and others create(), update(), delete().
  • Below DataSource only implements read() function.
  • Create a file called SolrSource.php and use below code:
App::uses('HttpSocket', 'Network/Http');
 class SolrSource extends DataSource {

protected $_schema = array();
 protected $_host;
 protected $_port;

public function __construct($config){
 $this->Http = new HttpSocket();

$this->host = $config['host'];
 $this->port = $config['port'];
 $this->_schema = $config['path'];

$this->solr=new Apache_Solr_Service($this->host, $this->port, $this->_schema);

public function read(Model $model, $queryData = array(), $recursive = null) {
 $results = array();
 $query = $queryData['conditions']['solr_query'];
 if (Configure::read('log_solr_queries') === true) {
 CakeLog::write('debug', $query); /* Logs the solr query in app/tmp/logs/debug.log file */

try {
 $solr_docs = $this->solr->search($query, $queryData['offset'], $queryData['limit'], array('sort' => $queryData['order']));
 } catch (Exception $e) {
 CakeLog::write('error', $e->getMessage()); /* Logs the solr errors message in app/tmp/logs/error.log file */
 CakeLog::write('error', $query); /* Logs the solr query in app/tmp/logs/error.log file */
 $model->params = $solr_docs->responseHeader->params;
 $model->numFound = $solr_docs->response->numFound;
 $docs = $solr_docs->response->docs;
 foreach ($docs as $doc) {
 $document = array();
 foreach ($doc as $fieldName => $fieldValue) {
 $document[$fieldName] = $fieldValue;
 $results[] = $document;
 return array($model->alias => $results);


Getting data from Solr server by using above SolrSource.

App::uses('AppController', 'Controller');
 class UsersController extends AppController {

public $name = 'Users'; //Controller name
 public $uses = array('Solr'); //Model name

function beforeFilter(){

public function index(){
 $cond = "active:1";
 $sort = "timestamp desc";

$params = array(
 'conditions' =>array(
 'solr_query' => $cond
 'order' => $sort,
 'offset' => 0,
 'limit' => 1

$result = $this->Solr->find('all', $params);
 $this->layout = 'ajax';
 header('Content-Type: application/json; charset=utf-8'); /* To send response in json format */
 echo json_encode($result);

See Also : How to use ‘neighbors’ with ‘find’ method


The above code has been tested and validated with CakePHP 2.2.3, PHP 5.3.1 .
Incase you face any problems:

  • First check the DataSource configuration in /app/Config/database.php.
  • Check /app/Model/Solr.php for this line: public $useDbConfig = ‘solr';
  • Make sure Solr Service Vendor loaded in /app/Model/Datasource/SolrSource.php.
  • Check the path is correct for the Solr vendor.

Hope you liked this. Let me know if you want to add anything?

Tags | ,



No Comments

In CakePHP

By Jay Dee

How to access remote Amazon RDS with PhpMyAdmin

On 07, Nov 2014 | No Comments | In CakePHP | By Jay Dee


Amazon Relational Database Service (Amazon RDS) is a web service that makes it easy to set up, operate, and scale a relational database in the cloud. It provides cost-efficient and resizable capacity while managing time-consuming database management tasks, freeing you up to focus on your applications and business.

First of all we need to install PhpMyAdmin in ec2 instance (Centos, Fedora, Amazon Linux AMI)

Step:1 First we need to enable the RPMforge repository on our CentOS system as phpMyAdmin is not available in the official CentOS/Fedora/Amazon Linux AMI repositories:

Import the RPMforge GPG key:

# rpm --import  http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt


On x86_64 systems:

#  yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm


On i386 systems:

# yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm


Step:2 PhpMyAdmin can now be installed as follows:

# yum install phpmyadmin


Step:3 Now, we configure PhpMyAdmin. We change the Apache configuration so that phpMyAdmin allows connections not just from localhost (by commenting out the <Directory “/usr/share/phpmyadmin”> stanza):

vi /etc/httpd/conf.d/phpmyadmin.conf
# Web application to manage MySQL
#<Directory "/usr/share/phpmyadmin">
# Order Deny, Allow
# Deny from all
# Allow from
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin


Step:4 Next, we change the authentication in phpMyAdmin from cookie to http: and host from local to RDS host url:

vi /usr/share/phpmyadmin/config.inc.php
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';
/* Server parameters */
$cfg['Servers'][$i]['host'] = '*******.******.us-east-1.rds.amazonaws.com';


Step:5 Restart Apache service:

# /etc/init.d/httpd restart


Step:6 Now we can browse RDS database.

# http://<IPADDRESS> /phpmyadmin


# http://<Domain name>/phpmyadmin


Advantages of PhpMyadmin Over Command line Interface.

  • One of the advantages of using PhpMyadmin is that it has a user interface and you can run queries within the SQL.
  • It is also used in checking referential integrity in MyISAM tables.
  • One can execute, edit and bookmark any SQL-statement, even batch-queries (This will work only in the latest version of phpMyAdmin).
  • Multiple MySQL servers can be managed by PhpMyadmin.
  • One can export data to various formats: CSV, SQL, XML, Excel and more.
  • Using Query-By-Example(QBE), create complex queries automatically connecting required tables.
  • One can Browse, view and drop databases, tables, views, fields and indexes.
  • It supports InnoDB tables and foreign keys.

Also See: How to install and configure Jaspersoft in Linux Server(RHEL/Centos/Fedora)

I hope you will find this useful. Feel free to give your valuable feedback.

If you want to update your traditional IT infrastructure to cloud computing, then you can hire expert cloud engineers from Andolasoft.

Tags | ,



No Comments

In CakePHP

By Prakash S.

Hash Class: Makes CakePHP Coding easier!

On 07, Mar 2014 | No Comments | In CakePHP | By Prakash S.

Hash is a predefined class provided by CakePHP. It is used for array manipulation such as inserting an element to an array, remove an element from an array, sort an array, extract part of a large array, filter the non empty elements, rearrange the whole array, which makes the code more optimized and understandable. So it makes CakePHP easier and flexible to use. Because most of the operations like find, insert, update in CakePHP returns/takes array as output/input.

Hash provides an improved interface, more consistent and predictable set of features over Set. While it lacks the spotty support for pseudo XPath, its more fully featured dot notation provides similar features in a more consistent implementation.

Operations performed by Hash class:

  • extract()
  • combine()
  • filter()
  • check()
  • insert()
  • remove()
  • sort()
  • and many more…

Some important tips:

{n} – Match any numeric key.
{s} – Match any string value and numeric string values.
[id] – Matches elements with a given array key.
[id=2] – Matches elements with id equal to 2.
[id!=2] – Matches elements with id not equal to 2.
[id<=2] – Matches elements with id less than or equal to 2.

– Matches elements that have values matching the regular expression inside.

  • Hash::extract(array $data, $path):

Retrieve required data from array. You do not have to loop through the array.

Ex: // Common Usage:

$users = $this->User->find("all");
 $results = Hash::extract($user, '{n}.User.id');
 // $results equals:
 // array(1,2,3,4,5,...);
  • Hash::insert(array $data, $path, $values = null):

Insert sub-array’s into the original array.


$temp = array(
 'page' => array('name' => 'page')
$result = Hash::insert($temp, 'file', array('name' => 'files'));
// $result now looks like:
 [page] => Array
 [name] => page
 [file] => Array
 [name] => files
  • Hash::remove(array $data,  $path = null):
Remove data from any path specified.


$arr_test = array(
 'page' => array('name' => 'page'),
 'file' => array('name' => 'files')
$result = Hash::remove($arr_test, 'file');
/* $result now looks like:
 [page] => Array
 [name] => page
  • Hash::combine(array $data$keyPath = null$valuePath = null$groupPath = null)

Combine the results to form a new array of expected result. Helpful in case, where we are displaying data in the form of select box. Like categories, states, city etc. We don’t have to retrieve the data separately. We can find the required data from the original result set retrieved, containing the information..


$arr_test = array(
 'User' => array(
 'id' => 2,
 'group_id' => 1,
 'Data' => array(
 'user' => 'John.doe',
 'name' => 'Matt Lee'
 'User' => array(
 'id' => 14,
 'group_id' => 2,
 'Data' => array(
 'user' => 'phpunt',
 'name' => 'Jack'
$result = Hash::combine($arr_test, '{n}.User.id', '{n}.User.Data');
/* $result now looks like below:
 [2] => Array
 [user] => John.doe
 [name] => Matt Lee
 [14] => Array
 [user] => phpunt
 [name] => Jack
  • Hash::check(array $datastring $path = null)
    Check whether an element exists in the array or not.


$set = array(
 'My Index' => array('First' => 'The first item1')
$result = Hash::check($set, 'My Index.First');
// $result == True
  • Hash::filter(array $data$callback = array(‘Hash ‘‘Filter’)):
Keep only non-empty elements and filter the empty elements.
$data_arr = array(
 array('test', 'is you own', false)
$result = Hash::filter($data_arr);
/* Out put:
 Array (
 [0] => 0
 [2] => true
 [3] => 0
 [4] => Array
 [0] => one thing
 [2] => is you own
  • Hash::sort(array $data$path$dir$type = ‘regular’)

Sort an array according to the path, direction and type provided.


$arr_test = array(
 0 => array('Person' => array('name' => 'Jeff1')),
 1 => array('Shirt' => array('color' => 'black1'))
$result = Hash::sort($arr_test, '{n}.Person.name', 'asc');
/* $result now looks like:
 [0] => Array
 [Shirt] => Array
 [color] => black1
 [1] => Array
 [Person] => Array
 [name] => Jeff1

$type can be of the following type:

natural(ex. Will sort fooo10 below fooo2 as an example)

$dirc can be of two type asc & desc

For more information refer: http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html

However if you want you can hire or get free consultation from our experienced CakePHP developers.

Read More: Password Hashing API in PHP

Have I missed out anything? Comment at end of this topic.

Tags | ,



No Comments

In CakePHP

By Jay Dee

Why hire PHP Developers for high quality web app development

On 30, Nov 2011 | No Comments | In CakePHP | By Jay Dee

PHP is a widely-usedopen source general-purpose scripting language. It is a cross-platform, HTML embedded server-side scripting language, suits especially for web development.

PHP Framework is a fundamental platform that helps programmer for rapid and effective development. It’s one of the powerful tool which helps to tweak code in a standard configured manner. It can be used with many relational database management systems(RDBMS).

Reasons of choosing PHP scripting language

Simple and easy to learn

PHP is one of the easiest scripting language to learn and understandable by developers. The syntax is somewhat similar to Java and C. However, knowledge of HTML is the only prerequisite to code in PHP.

Instant Support

When a developer stuck with any coding issue, there are huge numbers of references, forums and support communities available online and they are free. This is simply because, PHP is very popular, widely used and having the largest user base.

Supports all major OS

PHP can be run on top of major operating systems such as Windows, Linux, UNIX, Mac OSX and so on.

Free of Cost

PHP is an open source and 100% Free for use by anyone. This cuts down cost of production as well as hosting. For these reasons it enjoys popularity over other expensive scripting languages such as ASP, JSP and others.


PHP makes developers life easy as it can be integrated easily with any of the systems like MongoDB, Memcache, Pusher and more. More or less PHP applications can cater any verticals such as banking sectors, health/hospital industry, government sector or corporates and so on.


PHP developers can develop robust application within a very short timeframe using a variety of frameworks like Symfony, Slim, Silex, Zend and Aiki. Each framework allows you to avail a set of benefits including code reuse, better session management and database access libraries.

Easier to fix problems

It is obvious that the web application development is not free from issues, however with PHP it is comparatively easier to troubleshoot than it’s counterparts. This is because with each request, PHP cleans up and starts over. So issue with one request does not affect another request.


Scalability is always in demand be it for databases, hosting, or programming, scalability. PHP is built in such a way that you can easily increase your cluster size with grow of your projects.

Object Oriented

Java and Windows COM objects can be called called from PHP. Also PHP allows to create custom classes which in turn can be borrowed by other classes. This is one of the useful capabilities of PHP.


PHP does not take lot of system resource and operates much faster than other scripting languages. PHP maintains its speed even if it is used with other software. Since PHP is out for a long time, continuous effort is on to make it even better. As a result of which it is fairly stable compared to it’s counterparts.

Tags | ,



No Comments

In CakePHP

By Omkar

5 Reasons why CakePHP so Popular!

On 24, Nov 2015 | No Comments | In CakePHP, Infographic | By Omkar

Banner_CakePHP_24_11_15_v3Hello Tech-gurus!

This time Andolasoft’s CakePHP Research Team publishing an Infographic to highlight ‘why opt for CakePHP’. This platform is most sought after by the developers and adapted by numerous companies.

CakePHP is one of the coolest platform for creating dynamic applications, making the whole exercise of writing programs a lot easier than other languages and frameworks. As the syntax of CakePHP and its various functions and methods are more comprehensible to a layman. Developers and techies adore CakePHP to create sophisticated applications as they can pack it with incredible features, faster, easier. Currently, CakePHP is the backbone for some of the best-selling web applications. Please have a look at the Infographic to know why the popularity of CakePHP has been multiplied to great heights.
CakePHP_Infographics_23_11_15_v4 (1)
It’s Your Turn to Make Things Better with CakePHP

At Andolasoft, we help you to build custom software that can help your business differentiate itself from others and provide a deep competitive advantage through data collection, visualization, and distribution at the edges of your organization. CakePHP makes these type of software development economical.

The facts we have shown above would have made you aware and upgrade your knowledge about CakePHP. We are sure this article will be of help.

We welcome your comments. Please Visit Andolasoft’s CakePHP Service for more information and details. You can also write to us at info@andolasoft.com

Talk to our Experts about your next CakePHP project.
Send us your inputs and don’t forget to share with your family ‘n’ friends!


Tags | , , , , ,



No Comments

In CakePHP

By Prakash S.

How to do Custom Pagination in CakePHP

On 15, Aug 2014 | No Comments | In CakePHP | By Prakash S.

Sometimes we need to do pagination in CakePHP using a traditional SQL query, thereby the CakePHP predefined pagination functionality is lost.


We can implement pagination method in the Model or Behavior when we are using standard SQL query in CakePHP. Just need to make sure that the result cannot be obtained with core model methods or a custom finder before implementing custom queries pagination. But we can’t just use the standard pagination on the custom queries, we have to override the paginate functions in model or behavior.

To use our own method/logic to override the CakePHP pagination in the model, we need to add two functions: paginate() and paginateCount().

In these functions, we can implement our own paginate logic.

Overriding paginate() function in CakePHP Post Model:

public function paginate($conditions, $fields, $order, $limit, $page = 1, $recursive = null, $extra = array()) {
 $orderStr = '';
 foreach($order as $k => $ord) {
 $orderStr[] = $k . ' ' . $ord;
 $orderStr = 'ORDER BY '. implode(', ', $orderStr);

 $qryCond = '1';
 if (isset($conditions['Post.title LIKE'])) {
 $qryCond = 'title LIKE \''.$conditions['Post.title LIKE'].'\'';

 $qryFlds = '*';
 if ($fields) {
 $qryFlds = implode(', ', $fields);

 $sql = 'SELECT '.$qryFlds.' FROM posts as Post WHERE '.$qryCond.' '.$orderStr . ' LIMIT ' . (($page-1) * $limit) . ', ' . $limit;
 $results = $this->query($sql);
 return $results;

Overriding paginateCount() function in CakePHP Post Model:

public function paginateCount($conditions = null, $recursive = 0, $extra = array()) {
 $qryCond = '1';
 if (isset($conditions['Post.title LIKE'])) {
 $qryCond = 'title LIKE \''.$conditions['Post.title LIKE'].'\'';

 $sql = 'SELECT COUNT(*) as count FROM posts as Post WHERE '.$qryCond;

 $this->recursive = -1;

 $results = $this->query($sql);
 return $results[0][0]['count'];

Using in the Post Controller: We can adjust the fields to get, column ordering, add certain conditions or adjust row limit per page.

public function index() {
 $this->paginate = array(
 'limit' => 10,
 'fields' => array('Post.id', 'Post.title', 'Post.created'),
 'conditions' => array('Post.title LIKE' => '%search_keyword%'),
 'order' => array('Post.title' => 'asc', 'Post.id' => 'asc')
 try {
 $this->set('posts', $this->paginate('Post'));
 } catch (NotFoundException $e) {

The above example is based on specific model and requirement, need to adjust the methods according to the requirements.

See Also: Creating a custom handler session in CakePHP 2.x

Best of luck and happy pagination.

Hope you liked this. Let me know if you want to add anything?

Tags | ,



No Comments

In CakePHP

By Lopamudra M.

SSL authentication using security component in CakePHP

On 09, Jul 2013 | No Comments | In CakePHP | By Lopamudra M.



We can achieve SSL authentication in CakePHP by writing own methods like ‘forceSSL’ and ‘unforceSSL’. Also there is an in-built Security Component in CakePHP to achieve SSL authentication.

  • Using Security Component we can integrate tighter security in our application.
  • Like all components it needs configurations through several parameters.
  • We can get CSRF and form tampering protection using Security Component.
  • CsrfExpires controls the form submission.


All SSL URLs will redirect to a sub-domain ‘https://app.andolacrm.com/’ and the non SSL URL will redirect to a sub-domain ‘http://www.andolacrm.com’

How to use Security Component

  • Include the security component in you AppControler.php
  •  Like as below
class AppController extends Controller {
public $components =array( 'Acl','Session','Email','Security','Cookie' );

  • There are 3 configurable variable for which you need to set the values as per the requirement of your application in the beforeFilter functions of AppController.php
  • validatePost: This variable basically used to validate your post data , Set false if you want skip validating you post data or incase data coming from 3rd party Services . Default its true.
  • csrfCheck : CSRF(Cross-Site_Request_Forgery)  Used for form protection   . Set to false to skip CSRF protections.
  • CsrfUseOnce : This is used for CSRF token.If it is set as false then it will user one csrf token through out the application else it will generate new token for each form submissions.

Sample Code :

function beforeFilter() {
// Codes added for SSL security
  • In the ‘AppController.php’ you need to define the list of URLs that doesn’t need to be checked for SSL
  • Code to be written in your ‘beforeFilter()’ of ‘AppController.php’
function beforeFilter() {
// Codes added for SSL security
$sslnotallowed_url  = array('beta_user','terms','privacy','security');
$this->Security->blackHoleCallback = 'forceSSL';

ForceSSL Method

function forceSSL() {
$this->redirect('https://app.andolacrm.com' . $this->here);

NOTE: Security Component can only be used for the forms create using FormHelper.


Using the steps as described above would facilitate you to successfully implement the SSL in CakePHP. But you need to be more careful while using security component for your application i.e. it may cause ‘blackhole’ error if there is any kind of security hole in your application. However, you could avoid such errors by setting above described variable to ‘false’.

Tags | ,



No Comments

In CakePHP

By Jay Dee

Why CakePHP is popular for Web App development

On 08, Apr 2013 | No Comments | In CakePHP | By Jay Dee

What is CakePHP?

CakePHP is a free and open-source platform, which facilitates the developers to build highly affordable web-applications using the MVC framework. This is a robust and efficient platform for the developers to create exciting PHP web applications.


What makes CakePHP popular?

Here I would like to discuss the aspects responsible for popularizing CakePHP among developers.

  • Easy-to-use functionality
    Developers are constantly looking for ways to make development process easier and hassle-free. Hence we can use code generation and scaffolding features built-in in CakePHP to rapidly build prototypes. CakePHP facilitates this opportunity which adds to its popularity. With CakePHP, the application development is not burdened with writing complex codes for the application hence saves a lot of development time. The code lines are also simplified and reduced to facilitate the developers with productive development process.
  • Flexible and Versatile
    CakePHP is used for web app development is because the configuration is flexible and versatile. It can automatically cater itself based on the requirements of the developers and the changes made by them. Hence, it doesn’t require any elaborate configuration settings for project development. Most features and settings are auto detected in the system and require only the settings for database connections. It’s a feature rich light weight PHP framework comes with lot of features like code generation, translations, database access, caching, validation, authentication etc.
  • MVC (Model View Control) Architecture
    CakePHP development uses the model-view-control architecture which helps in distinguishing the business logic from data and design. It does a clear discrimination among the presentation layer, the business logic and database. It enables the developers to work independently on separate aspects of development at the same time. It enables the developers to develop faster and make optimum use of the resources.
  • Security
    The security of the application must be top notch such that they make the website full proof from any security breaches and is safe from the hands of hackers. CakePHP comes with built-in tools for input validation, CSRF protection, Form tampering protection, SQL injection prevention, and XSS prevention, helping you keep your application safe & secure. 
  • Friendly License
    CakePHP is licensed under the MIT license which makes it perfect for use in commercial applications.

CakePHP Development has become the foremost option for web developers as well as the Businesses to build exciting and unique applications. No wonder it is one of the most preferred MVC framework.

Tags | ,



No Comments

In CakePHP

By Jay Dee

CakePHP framework for faster development of next generation web application

On 04, Feb 2013 | No Comments | In CakePHP | By Jay Dee


There are numerous PHP frameworks available such as Zend, CodeIgniter, Akelos etc. CakePHP on the other hand is the most popular framework among them and reduces significant coding time and investment.  CakePHP is an open source web application development tool. It helps to build the web pages and applications faster and simpler.

Some features of CakePHP framework

  • Compatible with almost all PHP versions
  • Facilitates code scaffolding for faster development of prototypes
  • Doesn’t require any complex configuration
  • CakePHP is safe and secure:  It provides in-built tools for input validation, XSS prevention, SQL prevention for secure application development.
  • It provides built-in view helpers for AJAX, JavaScript, HTML etc.
  • CakePHP offers faster and flexible templating features as well as data validation features

These features make installation and use of CakePHP easy which in turn makes PHP more manageable. As it is an open source, it can be customized according to the needs of specific business requirements. It provides the CakePHP developers with MVC framework, Class inheritance, re-usability, Ajax support and many more to make the development process easier and effortless.  It assists the PHP developers at all levels and provide the ability to manage every part of project development.

Our CakePHP development team is highly experienced to deliver robust, logical, most reliable and effective solutions to our global clients. Our expertise in CakePHP development helps us for building cost effective apps that too matching customer budget with quick turn-around time.

Tags | ,