Category:

Detect is your website is access from Mobile and Device

This is very simple and useful tip to detect that your user is using Android or iOs device to log in to your website in CakePHP 3 it is even easier CakePHP 3 device detection  $isMobile = $this->request->is(‘mobile’); $isAndroid = stripos($this->request->header(‘User-Agent’), ‘Android’); $isIPhone = stripos($this->request->header(‘User-Agent’), ‘iPhone’); $isIPad = stripos($this->request->header(‘User-Agent’), ‘iPad’); Core PHP $iPhone = stripos($_SERVER[‘HTTP_USER_AGENT’],”iPhone”); $iPad […]

Continue Reading
Posted On :
Category:

Redirect HTTP to HTTPS in Cakephp3

If you are building CakePHP application and want to move all traffic to HTTPS you can follow bellow simple steps without making any change in .htaccess  file Step 1. Edit AppController to make change use Cake\Event\Event; Step 2. Load security component public function initialize() { parent::initialize(); $this->loadComponent(‘Security’, [‘blackHoleCallback’ => ‘forceSSL’]); $this->loadComponent(‘RequestHandler’); $this->loadComponent(‘Flash’); $this->loadComponent(‘Cookie’); } Step […]

Continue Reading
Posted On :
Category:

Send email in cakephp 3

If you are working with cakephp 3 and need to send email then this tip help you to send email. Step 1. Go to your app.php and find EmailTransport and add your SMTP details ‘EmailTransport’ => [ ‘default’ => [ ‘className’ => ‘Mail’, // The following keys are used in SMTP transports ‘host’ => ‘My_HOST’, ‘port’ => […]

Continue Reading
Posted On :
Category:

Enable Debug Kit in Cakephp 3

Last updated on May 26th, 2018 at 03:10 pmThis tip helps you enable your CakePHP 3 debug kit follow simple steps to enable your debug kit. Enable Debug Kit in CakePHP 3 Step 1. Open terminal and run following command, before enter below command go to the root directory of your project  composer.phar require –dev cakephp/debug_kit […]

Continue Reading
Posted On :