Posts

Showing posts with the label cake php

How to Install Cakephp?

Image
On Cakephp Welcome Screen, you will fine two error. To remove this error, you must be change 01. Security . salt value. 02. Security . cipherSeed value.     Please Change Security.salt value: 1. Open this project in php text editor. 2. Go to app/config/core.php file 3. In line no 204 change Security . salt value. // you can change this value whatever you want 4. Then refresh the startup screen. Our 1 st error has been removed. »Change Security.cipherSeed value: 1. Open this project in php text editor 2. Go to app/config/core.php file 3. In line no 208 change Security . cipherSeed value. // you can change this value whatever you want but only in digits Then at the end of page you will find database error so for remove this error you need to edit the page 1. Open this project in php text editor 2. Go to app/config/database.php.default file and rename (remove .default ) this file. 3. Rename file will be like this database.php 4. Then refresh the startup screen.

Time Zone Error in Cake php

PHP Warning:  strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date. timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Los_Angeles' for '-8.0/no DST' instead in C:\xampp\htdocs\cake_1_2\cake\libs\cache.php on line 429   Warning in cake to resolve this you have to follow this path. Yourfoldername/cake/libs/cache.php Open this file Press ctrl+g and go line no. 570 You will find the code like this if (!is_numeric($this->settings['duration'])) {           $this->settings['duration'] = strtotime($this->settings['duration']) - time();     }    return true; simply paste this code:    date_default_timezone_set('UTC'); Example: if (!is_numeric($this->settings['duration'])) {                                 d

how to Dreamweaver read the CakePHP Files or Opening CakePHP Files in Dreamweaver?

In cake php there are two type of file which is mostly used in cake php THTML and CTP Files. So in dreamweaver There are ultimately 3 files that you need to edit. Path of file is C:\Program Files\Adobe\Adobe Dreamweaver CS3\configuration Open this folder and Open up “Extensions.txt” and on the first line at the very end add THTML and CTP separated by commas, in this file there is line like this MASTER,THTML,CTP:All Documents Similarly add these two extensions to the “:PHP Files” line. PHP,PHP3,PHP4,PHP5,TPL,THTML,CTP:PHP Files Next open the “DocumentTypes” folder and edit the “MMDocumentTypes.xml” file, just open it up using notepad or wordpad. Search for the line which has an id “PHP_MySQL” and add the THTML/CTP file extensions to both the “winfileextension” and “macfileextension” so the line should read: 1. winfileextension="php,php3,php4,php5,thtml,ctp" 2. macfileextension="php,php3,php4,php5,thtml,ctp" The final file is another version of t

How to write a where query in cakephp?

write a where query in cakephp    $var = $this->module->find('all',array('conditions' =>array('name' => 'xyz')));    this->set('user',$var); Note:- where 'all' is putting all field from table; you can replace 'all' by single field name also; 'name => xyz' is condition of query in cake php; 'user' is a variable which you will use in view folder for a page; // example: foreach($user as $users) in index.php

Star rating plugin for CakePHP

Download Latest version for CakePHP 1.2: http://www.wuala.com/mystic11/public/rating2.3.zip Latest version for CakePHP 1.3: http://www.wuala.com/mystic11/public/rating2.4.zip   Installation and Use 1) Make sure you meet the requirements above. For the download and integration of a javascript framework, please visit http://www.prototypejs.org/ for Prototype and http://jquery.com/ for jQuery. 2) Extract the plugin, including the subfolder rating , to your app plugins folder app/plugins . 3) Copy the rating/config/plugin_rating.php to your app configs folder app/config and change the settings to your desire. It is recommended to let Rating.showHelp set to true until everything works. 4) Apply the install.sql to your database to create the ratings table CREATE TABLE `ratings` (   `id` int(11) unsigned NOT NULL auto_increment,   `user_id` char(36) NOT NULL default '',   `model_id` char(36) NOT NULL default '',     `model` varchar(100) NOT NULL 

select query in cake php with where and like

$data = $this->paginate('Recipe',array ("OR" => array ("title LIKE" => "%".$recipe_search_word."%","short_desc LIKE" =>  "%".$recipe_search_word."%")));         $this->set('search',$data);