cakephp

How to run CakePHP 3.7 Shell Commands in Heroku console

Author - Kailash Kumar
|
0 Comments
|

Learn how to run CakePHP 3.7 Shell Commands in Heroku console

1. Create myCommandShell.php file in src/Shell folder with below content

<?php
namespace App\Shell;
use Cake\Console\Shell;
use App\Controller\PagesController;
class myCommandShell extends Shell {
public function main() {
// do your Read more…

How to Install nginx and configure it for CakePHP

Author - Manoj Thakur
|
0 Comments
|

How to Install nginx and configure it for CakePHP

Quick Summary:

1. What is Web Server?
2. What is Nginx?
3. Nginx Installation.
4. Create server block (VirtualHost).
5. Install CakePHP and configure it for Nginx.
6. How to check CakePHP version.

What Read more…

How to Detect Mobile devices in php

Author - Gopi Garg

Detect mobile device php code

We often need to detect if site visitor is using an iPad, a smartphone or any other mobile device in order to change website appearance and even make it faster by reducing data load. Normally we use the media queries and Read more…

Class ‘App\Controller\Aws\S3\S3Client’ not found error in CakePHP 3.*

Author - Kailash Kumar

How to resolve “Class ‘App\Controller\Aws\S3\S3Client’ not found” error in CakePHP 3.*

Problem: Class ‘App\Controller\Aws\S3\S3Client’ not found error occurs when we are trying to create S3Client class object with given code (code copied from github):

$s3 = new Read more…

Sort query result according to search conditions in CakePHP 2.

Author - Kailash Kumar
|
0 Comments
|

How to sort query result according to various search conditions in fetch query of CakePHP 2.

Problem: Priority based sorting of records

Example: Search a string (“Proposalways StudySection”) and display records in following order:

Contain all words (“Proposalways StudySection”) in Read more…

What is the purpose of multiple .htaccess files in CakePHP?

Author - Varun Chopra

Purpose of multiple .htaccess files in CakePHP

In Cakephp, contained .htaccess files are as follows:

newcakeproject/.htaccess
/app/.htaccess
/app/webroot/.htaccess

1. newcakeproject/.htaccess

CakePHP root directory .htaccess redirects everything to your CakePHP app (means to webroot). We can also redirect the url to some Read more…

Using Google Search Operators

Author - Mayank Srivastava

Using Google Search Operators for Better Results

Google defines Search Operators as the “words or symbols in one’s search phrase that make the search results more precise”. These operators have their basis in coding as they are nothing but shortcuts in procuring the best results Read more…

How to use CakePHP Validation class

Author - Kailash Kumar
|
0 Comments
|

How to use CakePHP Validation class

We can use CakePHP validation functions and speed up development. These functions already follow the correct rules so we don’t need to write custom code.

Example:
In Controller:

$validate = new Validation();
$string = ‘Name123’;
$result = $validate->alphaNumeric ( $string );
if ($result Read more…

Sending Emails in CakePHP with Example

Author - Sahil Bhalla
|
0 Comments
|

What support/library is there in CakePHP for sending emails and how to use it?

In CakePHP3, there are Transport and Email classes available under Cake/Network/Email namespace that are used for sending emails. After an update in the version 3.1 email functionality has Read more…

Convert HTML to pdf using mpdf plugin in cakePHP

Author - Sahil Bhalla
|
0 Comments
|

How to use mpdf plugin in cakePHP to convert HTML documents to pdf?

mPDF is a PHP library which is used to generate PDF files from HTML Documents. It converts utf-8 encoded documents and also supports almost all languages including Arabic and Hebrew. It includes Read more…