Integrate Razorpay in CakePHP application
Step 1: Create Razor Pay Account
First of all you need a test account for Razorpay integration. Click the below link https://dashboard.razorpay.com/#/access/signup and set up a test account there:
Step 2: Get your Read more…
What Is PHP_CodeSniffer?
PHP_CodeSniffer is an essential development tool that helps developers to work in a standardise format so as to make code clean and consistent. It ensures that same coding style is being followed. It allows a set of rules or a standard to be Read more…
WordPress Version 4.9.5
WordPress 4.9.5 is released on 3rd April 2018. This version is released to fix the security issues. There were three major security issues which are solved by the WordPress community in this version:
1. Don’t treat Read more…
I am working on a client project which is using Codeigniter running on version 2.0.3 and PHP 5.3. I got a requirement from client to upgrade the PHP version from 5.3 to 5.6 or higher. While I tried to upgrade the PHP version I have Read more…
In Laravel, when a user directly accesses a post route then an exception page is shown. How to show a 404 page instead?
To fix this issue :
Firstly, you need to create an error page in view folder of your project like 404.blade.php and Read more…
To send an email in cakephp use Email class of Cakephp 3. In app.php under config folder, add a new entry in the table EmailTransport.
For example here ‘mail’. Specify host, port, username and password in it:
‘EmailTransport’ => [
‘default’ => [
‘className’ => ‘Mail’,
// The following keys are used Read more…
Sometimes situation arises when we have to show the ratings on our site like user rating of all the products available on our site. Then we have to first get the rating from where we have it like sometimes it may be from the third party etc. Once we have Read more…
These are the steps to upgrade to PHP 5.6:
Add the PPA containing version 5.6 of php for Ubuntu 12.04:
sudo apt-add-repository ppa:ondrej/php5-5.6
sudo apt-add-repository ppa:ondrej/php5
Run these command in terminal to upgrade php :
sudo apt-get Read more…
In Eclipse (Luna Service Release 2 (4.4.2), jump to method definition is available for Java and other languages. But sometimes, it gets disabled for PHP.
For example ,if eclipse crashes. So to enable this, first you have to select the Php Perspective in Eclipse:
– Right Click on your Read more…
Generally, Google PageSpeed Insights API is used to measure the performance of a web page but you can also use Google PageSpeed Insights API to get a screenshot of the website from URL. In this post, we will show you how to capture a screenshot of the webpage using its Read more…
Here are the steps to set up PHPMYADMIN to connect to database servers located at different ip addresses:
1. Open config.inc.php located in C:\xampp\phpMyAdmin directory in windows and located in /etc/phpmyadmin directory in Ubuntu.
2. Add the below written code at the end of the Read more…
In Cakephp, To translate the application language into another, we use internationalization and localization. To display the correct translated date string on change of locale, we need to use right classes.
I18n::Locale(‘es’’); // es locale is for Spanish
$date = ‘2017-08 Read more…
SQL transaction in Cakephp 3 is a series of statements working in a logical order to handle database errors and ensure data integrity. There are four main methods being used in Sql transaction in Cakephp 3.
1. Initialize the statement using begin() method.
2. Execute the statement which Read more…
Steps to integrate CyberSource payment gateway with CakePHP 2.*:
1. Download zip file of CyberSource library from “https://github.com/chrismeller/cybersource”.
2. Extract cybersource-master folder into cakephp vendors folder.
3. Create tests/config.php for test transaction with code and add credentials like below:
Suppose we have a table cake_test with a column named modified that contains epoch values.
$options = array (
‘fields’ => array (
“to_timestamp(modified) as New__original”,
“to_timestamp(modified) AT TIME ZONE ‘America/Denver’ as New__converted”
$result = $this->CakeTest->find ( ‘all’, $options );
In the above query we have Read more…
Error: Call to a member function schema() on a non-object
Description: I was trying to execute the following cake query to fetch the records:
$records = $this->find ( ‘all’, array Read more…
Use Heroku cron jobs to run CakePHP code at fixed intervals of time.
Cron is a time-based scheduler used to run commands periodically at fixed intervals. Cron means time. It is used for scheduling repetitive tasks. In order to use it in Heroku, you just need to install the Read more…
First of all, we should know what features are provided by jquery-ui plugin. To know about details, please see link,
Jquery UI plugin can be downloaded from the link
Now, today, we will discuss about Autocomplete feature of jquery-ui plugin Read more…
How to use concatenate, cases, substring in CakePHP 2.* find query.
Suppose given records are:
Problem: Display user details in one column and the first character of user role in front of the user full name. Also suppose in case of superadmin role as well we want to display (a Read more…
Before uploading any document to Amazon AWS S3 server, make sure that user has to write access on the bucket where files will be saved else it will throw ‘Access denied’ error. Apart from the write permissions, access keys are also required in the code which we get while creating Read more…