Answers for "cakephp"

1

cakephp life cycle

// https://stackoverflow.com/questions/20525897/what-is-the-lifecycle-of-a-cakephp-request/20534204#20534204
Posted by: Guest on November-18-2020
1

cakephp 4 change layout view in a method

//chnage the layout in Cakephp 4 with the layout file called ajax.php
$this->viewBuilder()->setLayout('ajax');
Posted by: Guest on October-26-2020
4

setup cakephp

1. Add .htaccess
<IfModule mod_rewrite.c>
	RewriteEngine on
	RewriteRule ^$ webroot/ [L]
	RewriteRule (.*) webroot/$1 [L]
</IfModule>

2. Add Permission tmp, Vendor, Webroot
- Window Set permisson
- Linux Set chmod -R 777
Posted by: Guest on November-16-2020
0

cakephp

composer create-project --prefer-dist cakephp/app:~4.0 my_app_name
Posted by: Guest on July-13-2021
0

multiple OR cakephp

// ------------------------------------
// ------------ MULTI OR --------------
// ------------------------------------

$conditions = array();


$conditions = array(
  'OR' => array(
    array(
      'MemberRole.school_id' 	=> array(),
      'MemberRole.role_id' 	=> $role,
    ),
    array(
      'MemberRole.school_id' 	=> array(),
      'MemberRole.role_id' 	=>  Environment::read('role.register'),
    ),
    array(
      'MemberRole.school_id' 	=> $school_id,
      'MemberRole.role_id' 	=> Environment::read('role.register'),
    ),
    array(
      'MemberRole.school_id' 	=> $school_id,
      'MemberRole.role_id' 	=> $role
    ),
  ),
);
Posted by: Guest on October-02-2020

Browse Popular Code Answers by Language