Featured
-
Top 5 Features That Make Laravel the Best PHP Framework for Development
Laravel is a free open source Web Framework of PHP
by abhishek.tiwari.458 -
Best 5 Lightweight PHP Frameworks for REST APIs Development
Are you ready to develop the Rest AP
by ankur.kumar -
PHP: Full-Stack Framework vs Micro Framework
A web framework can be described as a software fra
by ankit.bhatia -
How to get facebook profile picture by Facebook App
If you would like to get your profile picture in f
by vivek.rastogi -
Creating RESTful API in cakephp
This tutorial will help you to learn how to create
by pushpendra.rawat
Tags
How to implement captcha in cakephp ?
A CAPTCHA is a system that ensures sites against bots by producing and evaluating tests that people can pass however current PC programs can't. A CAPTCHA (an acronym for "Completely Automated Public Turing test to tell Computers and...
Sort object array alphabetically and arrange according to first letter
Sort the values of an Object array alphabetically in php and arrange them into sections of alphabets according to the first letter of their name.
/* Code to sort the data elements in alphabetic order .
The following snippet will sort the ...
Difference between array_key_exists() and in_array()
array_key_exists() and in_array() are two most useful functions in PHP. This article demonstrate the details and differences of these function.
array_key_exists() : This function checks if the given key or index exists in array or no...
How to create Category Tree Structure in cake php
Hello readers. This is a small blog on Tree structure. How to add , update and delete category in this structure. Now we will create a category tree using cakephp. Category tree is like parent - child type records. Well will add new category, upd...
Dompdf Library
Dompdf is a standard library for generating a PDF file. This library is used to convert an HTML file to PDF file. Dompdf is a style-driven renderer, as it will download and read external stylesheets, style attributes of individual HTML elements.
...
Implementing captcha in cakephp
Captcha is a test which can't be pass by computer but it is very easy for the humans to pass it.
For implementing captcha in cakephp we have to follow simple steps.
Step1:- First we have download captcha package from https://github...
Active and inactive users concept using Ajax in Cakephp
Concept of active,inactive script is mostly used in Online shopping website, Where adminstrator has right to access the database table and can be able to do changes on the table according to his need. For example a site owner wants to hide some o...
Html to pdf conversion in cakephp
Step1- For converting html to pdf first we have to download dompdf, then we have to extract it and put it into /app/Vendor.
Step2- Then we have to import this dompdf folder and its file dompdf_config.inc.php by using below co...
Submit and validate data with ajax (without refreshing)
A form can be submit and validate without refreshing with the help of ajax and jquery. You just need to include one ajax file and there is no need of any js validation file to check the validations.Validation can be done on the basis of ajax resp...
String in php
A string is sequence of character.
Every thing that is declared in a string will considered as a character.
Like abcd1234 is a string.
And when you add the string like 2+2 will give 22 not 4.
PHP string function
strlen()- It is used ...
How to send emails in CakePHP applications
Sending email becomes a very common feature for web applications, Emails generally used for sending notifications, newsletters and invoices etc. Email can be send in simple text format or in HTML format. This tutorial demonstrate different method...
Qimage Component in cakephp
Qimage Component:
It is used to upload and manipulate images. It can be easily downloaded from github. We can crop or resize image using Qimage crop(), resize() methods.
Some of the methods of Qimage component:
copy : copy() method is us...
CakePHP tree behaviour
In a tree structure data or records are stored in hierarchical manner, In tree structure the starting data record is called root node or parent node and other are child or subchild of parent node.
For implementing tree behaviour in cakep...
Creating PDF file from HTML using DOMPDF in cakephp
In order to convert HTML data into a pdf file here are the followings steps you need to follow:
Step 1: Download the DOMPDF file from Github. here is the link
https://github.com/dompdf/dompdf
or you can download from the zip attached at ...
Hooks in cakephp
Hooks are the functions that we can call prior and afterward doing any task in Models related to database. These are also known as callback methods. Like after finding data, before saving data etc.
e.g beforeSave(), afterSave(), b...
How To Do Administration Prefix Routing with Cakephp 3?
To map the URL controller action the feature that is used is routing and in CakePHP to make URLs more configurable and flexible routing is introduced. So in this tutorial we will see the process of Administration Prefix Routing with Cakephp 3.
...
How to use where clause and inner join in Cakephp 3 ?
How to use where clause and inner joins?
This is the way to use where clause and inner joins in Cakephp 3
Use matching if its cakephp 3.0.x.
Use innerJoinWith() if its cakephp 3.1.x
For example:
return $this->Product->find(...
Multiple layout in CakePHP
This blog is going to explain "How to apply multiple layout in CakePHP".
By default layout file located in (app/View/Layouts/default.ctp) in CakePHP. if we don't apply any layout, then all pages will take default layout.
if we are...
Drag and drop with jQuery UI Sortable
If you want to make the drag and drop with jQuery UI Sortable then you have to do the following things. The jQuery UI sortable feature include the serialize method. A text string in standard URL-encoded notation is created with serialize ().
&...
How to set increment variable in twig?
Hello Friends
This PHP tutorial will help you to implement a set of incremental variable in twig which you can use to show listing in twig with numbers in the first column. This will include defining twig variable and increment/decrements vari...
Creating association between tables using bindModel method in cakephp
Sometime we need to create association between models .we need this because ,we want that all associated data came on the first level of recursion.
In cakephp creation of association is done by using cakephp bindModel() method.
In below cod...
Use of bindModel and unbindModel function
bindModel and unbindModel:
bindModel() function is used to create association between models when needed and unbindModel() function is used to destroy the created association when it is no longer required. Association are used when we need dat...
Tree structure in CakePhp
Hello readers, today we discuss about "Tree Structure (or hierarchical data) in cakephp".
It can fairly common to want to maintain hierarchical data in a database stand. Examples of such data might be categories with unlimited subcat...
How to check if record exists in Cakephp 3?
How to check if record exists in Cakephp 3
I am writing this blog for them who are learning Cakephp 3. This blog will going to help you to find the solution for checking if record exists.
In Cakephp 2 we can check records which ex...
Difference between array_merge() and array_combine()
PHP have a vast collection of array functions which makes the use and manipulation of arrays much easier. This article defines the difference between two important array functions array_merge and array_combine which sounds similar but used for di...
Converting .DOCX file to .PDF file using LIBREOFFICE in cakephp
In order to convert DOCX file to PDF file directly, LIBRE OFFICE should be installed in your system.
LibreOffice is an OpenOffice's successor that allows command line conversion using the LibreOffice conversion engine. The advantage of Lib...
How to import vendor files in CakePHP 3 ?
Importing vendor files in Cakephp 3
If you have used Cakephp 2x then we know how to import vendor files there. In Cakephp 2x we do the following to import vendor files:
App::import('Vendor', 'Twitter', array('file' => 'Twitter' . D...
PHP Session Vs Cookies
PHP Session is defined as a storage type which hold the values that are set to the $SESSION[], until we attempt to destroy the session.
Whereas Cookies are the temporary and also have the small storage.
For each data, the name, value, expiratio...
Php - Design Patterns
Design Patterns: Hello Readers, This is a small blog on design patterns , hope this blog will help you to understand this topic. Microsoft design pattern Theory is, "The document introduces patterns and then presents them in a repository, or...
Drag, Drop , Sort and Save using jquery in cakephp
To implement drag and drop in cakephp using jquery, you need to follow following steps :-
Step 1: Make index.ctp and add following code in it :-
<head>
<style>
#sortable-list { padding:0; }
#sortable-list li...
CakePHP find conditions
Find is the data-retrieval functions in cakephp.
Below is the list of CakePHP find conditions :-
Name
Default
Description
type
'first'
it can be 'all...
How to join tables and find by conditions in Cakephp 2 ?
How to join tables and find by conditions in Cakephp 2 ?
There are 3 tables Venues, Venues type and Venue Opening Days. First and the most preferred way is use associations in the Model like hasMany, BelongsTo. Second way to join tables is to ...
PHPExcel
Hello Readers! In this blog we are going to export data from database using PHPExcel. PHPExcel supports reading and writing of many formats in one API. PHPExcel is a library that provides a set of classes for the PHP programming language, which a...
Relationship with modals
Defining One to One Relationship
To define a situation of one to one relationship in modals we think of a situation where we store information about authors and books. This means that book has only one author this is one to one relationship. T...
How to get last query executed in Cakephp ?
Get last query run in Cakephp 2.x :
There is a situation when we need to check what was the last query which was executed in Cakephp. My purpose for writing this blog is to provide you the solution for this as I was also stuck here.
I wante...
CONVERTING DOC FILE TO PDF IN CAKE PHP
In order to convert .doc file to .pdf file in cake PHP I have used ZEND library here. Following steps are needed to be done:
You need to make sure SOAP extension is enable on your server.
Use ZEND library as third party. Put ZEND library ...
Qimage Component
In CakePhp we have a component called Quick Image Component or simply Qimage for uploading and manipulating images.
Some of common methods that are used :
copy: to copy the uploaded images.
resize: to resize an image.
crop:...
Tree structure in cakephp
When you want to store a heirarchical data in the database table, then we use the tree structure in cakephp.
For e.g : When you need to form a heirarchy of categories & subcategories like:-
My Categories
Fun
Sport
Sur...
Tier Price in Magento
The tier pricing allows us to apply discount from the product detail and catalog list pages. This discount can be applied to the specific type of customer group or store view.
The calculated quantity discount in tier pricing on ...
Autocomplete form feild using PHP and jQuery
As we see in many of the forms in different websited that we just type a letter then the form automatic start guessing the the test or word we want to write in the feild. In this tutorial we will learn how to do autocomplete functionality using a...
How to convert your html page to pdf using fpdf in cakephp
Some time we need to convert the html page to pdf dynamically.
Like we are getting some form filled and then we want the data to be converted to a pdf file that is downloadable by the user.
We use fpdf for that in cakephp.
fpdf is basica...
Wordpress: Create custom fields for post type at admin end & fetch them at front end
Create custom fields for post type at admin end and fetch them at front end in Wordpress
The below code will create custom meta box at post type at admin end. You have to put the following code in your theme's function.php file if you want...
Installation of cakephp
Easy way to install cakephp:
Hello Readers. Here is small blog on how to install cakephp. Cakephp is very fast and easy to install. The minimun requirements to install cakephp are a web server and a copy of cakephp.
...
Scope Resolution Operator PHP
In Programming language we use the scope resolution operation in different ways. Here we are taking about the its uses in PHP. PHP is easy to use and manage. Scope resolutionary operator is also known as double colon. This is basically a operator...
Installation of Yii 2.0 Framework
Hello Friends, My first blog on Yii Framework Yii : A Futurisitic Framework was about an introduction of Yii 2.0 framework and its features. To explore those marvellous features and to test them practically, Let's give a try to Yii 2.0 Framew...
How to set OR condition in Cakephp ?
Cakephp 2.*: OR condition
I am writing this blog which will let you know how to set OR condition in Cakephp 2.*:
Write following lines of code to use OR condition:
'User' => array (
'conditions' => array (
'OR' =&g...
Using unBindModel() in CakePHP
If we have to many tables in our project and we have many association between them. So whenever we use one of the model in our controller the other model which are associated with it , automatically get attached with user data .
Sometime we do...
How to get IP Address in Cakephp?
How to get IP Address in Cakephp
I am writing this blog which will let you know how to get client's IP Address in Cakephp. The simplest way for getting client's IP Address in core php is $_SERVER['REMOTE_ADDR']. Similarly it is...
How to check an Ajax request in Cakephp?
How to check an Ajax request:
I am writing this blog specially for beginners who are learning Cakephp. In order to check whether the request is through Ajax or not. This can be checked by enabling the RequestHandler component in AppController ...
How to check if record exists in Cakephp ?
Hello friends, welcome to findnerd. I am writing this blog which will let you know how to check if record exists in Cakephp 2.* . The best way to do is to use Model::hasAny
hasAny( array $conditions null ) : Returns true if a record that meets...