Posts Tagged ‘cake php’

General mixed stuff about CakePHP, Delta Search

by on Friday, June 27th, 2014

Q1 : how to print query of find cakephp?
ans: $log = $this->getDataSource()->getLog(false, false); debug($log);

Q2: Socket transport “ssl” in PHP not enabled?
ans:
Rename php.ini-production to php.ini (in C:\xampp\php\ folder)
Edit php.ini and uncomment extension_dir=ext.
Also uncomment extension=php_openssl.dll.

Q3. how to close current tab
ans: window.open(”,’_self’).close();

 

Q4: How to remove Delta search:
I have a solution after finding zero help online, i decided to do it myself and found it was profoundly easy.

type in “about:config” in the url

accept “ill be careful i promise”

type in “new tab browser”

find the delta search bogus garbage and double click the url link.

replace it with what ever you like, google, yahoo, about:blank, after that everything should be the way it was.
Q5. how to take backup database ubuntu:
ans: mysqldump -u spendtrenz -p -h localhost –all-databases > naveen_db.sql

Q6. how to disable click of anchor tag using css:
ans: pointer-events: none; /* for disable click on anchor tag */

CakePHP HABTM List all related items

by on Wednesday, May 29th, 2013

public function getRolePermisions( $roleId ){
  $employee = $this->find('all', array(
   'conditions' => array( 'RolePermission.role_id' => $roleId )
 ));
 $list = Set::combine($employee,'{n}.Permission.id','{n}.Permission.name');
 return $list;
}

condition in find function cakephp

by on Wednesday, May 8th, 2013

How to get data on condition that start time only have current year data:


$event = $this->Event->find('first', array(
 'conditions' => array(
 'Event.id' => $targetEvent['Eventtarget']['event_id'],
 'Event.stage' => 'created',
 'year(Event.startTime)' => date('Y') ), //this is the condition we have to check
 'fields' => array('Event.startTime', 'Event.city', 'Event.zip', 'Event.employee_id')
 ));

CakePHP cake bake command

by on Tuesday, January 8th, 2013

step 1: set path to environment variable. like:

C:\xampp\php;C:\xampp\htdocs\yourproject\lib\cake\console\;

step 2: open command prompt and type

cd C:\xampp\htdocs\yourproject\app  and press enter.

step 3: now type cake bake

now you can see the options there. you can continue accordingly.