Zend Anwar

Full stack web developer

Category: Cakephp

Cakephp

Call to a member function cd() on a non-object in cakephp

It has very simple solution. in your /app/config/core.php uncomment the date_default_timezone_set line or date_default_timezone_set(‘Asia/Dhaka’);

Read More

How to add class in submit button cakephp 2.9 ?

 Please check below code. <?php     echo $this->Form->submit(__(‘Submit’,true), array(‘class’=>’your-class’));     echo $this->Form->end(); ?>

Read More

Error: Affected Num. rows Took (ms) in cake

This is not an error. This is just debugging. If u dont want to display go to app/config/core.php and then change Configure::write(‘debug’, 0);   Hope it will work.

Read More

How to increase Session Timeout in cakePHP?

Please follow at the following code. APP -> config-> core.php /** * Session time out time (in seconds). * Actual value depends on ‘Security.level’ setting. */ Configure::write(‘Session.timeout’, ‘3600’); //3600 seconds Hope it will work.

Read More

How to Create a custom 404 error page in cakePHP

If you need to change the page that users see when a document is not found, create: /app/views/errors/error404.thtml Hope it will work.

Read More

How to enable/disable debug messages for an action

This is very simple to enable/disable debug message for cakephp action Edit app\config\core.php.     Configure::write(‘debug’, 2); replace to Configure::write(‘debug’, 0); Hope your debug work properly.

Read More

please change the value of ‘security. cipher seed ‘ in app/config/core.php problem in Cakephp

Just follow bellow information – Edit yourInstallation/app/config/core.php Search for Security.salt and change some random characters (this is so your application  doesn’t have the same security seed as a billion other installations, which would be a serious security loophole. Do the same with Security.cipherSeed but use only numbers save core.php Hope it will work

Read More

CakePHP – Export data to a .html file

CakePHP – Export data to a .html file header(‘Content-Type: text/html; charset=utf-8’); header(‘Content-Type: application/force-download’); header(‘Content-Type: application/octet-stream’); header(‘Content-Type: application/download’); header(  ‘Content-disposition: attachment; filename=”<your file name here>.html”‘);   Hope it will work, Have a nice day!.

Read More

CakePHP – Export data to a .docx file

CakePHP – Export data to a .docx file Very simple. Just copy below code and paste. header(“Expires: Mon, 26 Jul 2020 05:00:00 GMT”); header(“Last-Modified: ” . gmdate(“D, d M Y H:i:s”) . ” GMT”); header(“Cache-Control: no-store, no-cache, must-revalidate”); header(“Cache-Control: post-check=0, pre-check=0”, false); header(“Pragma: no-cache”); header(“Content-Type: application/msword; charset=ISO-8859-1”); header(“Content-Disposition: attachment; filename=\””.<your file name>.”.doc”); echo “<html><head><title> Cakephp  […]

Read More

TCPDF ERROR: Some data has already been output to browser, can’t send PDF file

TCPDF ERROR: Some data has already been output to browser, can’t send PDF file Above message show that TCPDF Header yet not clear. you should clear header. just use below code :  ob_end_clean(); echo $pdf->Output(‘SE-‘.$data[‘first_name’].pdf’,’D’); If you face any problem just reply me.    

Read More