[Cakephp3] Stop the execution of a query !
Hi, Sorry for may bad english :( I want *to stop and break the execution of query if there is an error*, let's say that i have two chained find(*find('default')-find('first')*) I passed a param to the *find('default')*(exp.: *min=5*) and this param *hasn't the format that i want*(*min=a_string*), the problem that the executed query *just ignore the param* ! How i can stop the execution ? I tried to do *return false* inside the find instead of *return $query* but this doesn't has any effect ! Thanks -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Custom config file CakePHP 3.0 RC1
My problem is solved ;) Finally, i understand how the config files work In the* bootstrap* file i have just to add this line: Configure::load('Company'); In the *Company.php* file(*/config/Company.php*) i have to return an array like this: ?php return array ( 'Company' = array ( 'sitename' = 'SITENAME', 'website' = 'www.mywebsite.com' ) ); If i want to *read* a key i have just to do: Configure::read('Company.my_key'); If i want to *update/delete* a value i have to do: Configure::write('Company.my_key', 'my_new_value'); Configure::delete('Company.my_key'); then just for *updating* the *Company.php* file Configure::dump('Company', 'default', ['Company']); Hopefully this will help someone :) Le samedi 21 février 2015 20:09:21 UTC+1, Saif Turki a écrit : Hi, Sorry for my bad english :( I tried to create a custom config file to *read/update* my application params like the sitename, phone, mail *using a form* ... I read the CakePHP doc( http://book.cakephp.org/3.0/en/development/configuration.html). I add this lines on the *bootsrap.php* file: // Custom config file Configure::config('default', new PhpConfig('/config/')); Configure::load('Company'); I create the *Company.php* file on the config folder(*/config/Company.php*) and add this line: ?php use Cake\Core\Configure; use Cake\Core\Configure\Engine\PhpConfig; Configure::write('Company.sitename', My Company); but when i want to debug the config vars using debug(Configure::read()); i have this error: Could not load configuration file: /config/Company.php Cake\Core\Exception\Exception Documentation http://book.cakephp.org/3.0/ API http://api.cakephp.org/3.0/ If you want to customize this error message, create *src/Template/Error/error500.ctp* toggle vendor stack frames http://localhost:3000/admin/parentbookings# - ⟩ Cake\Core\Configure\Engine\PhpConfig-_getFilePathCORE/src/Core/Configure/Engine/PhpConfig.php, line 70 http://localhost:3000/admin/parentbookings# - ⟩ Cake\Core\Configure\Engine\PhpConfig-readCORE/src/Core/Configure.php, line 262 http://localhost:3000/admin/parentbookings# - ⟩ Cake\Core\Configure::loadROOT/config/bootstrap.php, line 199 http://localhost:3000/admin/parentbookings# - ⟩ requireROOT/webroot/index.php, line 27 http://localhost:3000/admin/parentbookings# What i have to do to access to my Company.php configure params and how overwrite this params on the file ? Thanks -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Re: Custom config file CakePHP 3.0 RC1
I'm using the CakePHP 3.0 RC2 not RC1 Le samedi 21 février 2015 20:09:21 UTC+1, Saif Turki a écrit : Hi, Sorry for my bad english :( I tried to create a custom config file to *read/update* my application params like the sitename, phone, mail *using a form* ... I read the CakePHP doc( http://book.cakephp.org/3.0/en/development/configuration.html). I add this lines on the *bootsrap.php* file: // Custom config file Configure::config('default', new PhpConfig('/config/')); Configure::load('Company'); I create the *Company.php* file on the config folder(*/config/Company.php*) and add this line: ?php use Cake\Core\Configure; use Cake\Core\Configure\Engine\PhpConfig; Configure::write('Company.sitename', My Company); but when i want to debug the config vars using debug(Configure::read()); i have this error: Could not load configuration file: /config/Company.php Cake\Core\Exception\Exception Documentation http://book.cakephp.org/3.0/ API http://api.cakephp.org/3.0/ If you want to customize this error message, create *src/Template/Error/error500.ctp* toggle vendor stack frames http://localhost:3000/admin/parentbookings# - ⟩ Cake\Core\Configure\Engine\PhpConfig-_getFilePathCORE/src/Core/Configure/Engine/PhpConfig.php, line 70 http://localhost:3000/admin/parentbookings# - ⟩ Cake\Core\Configure\Engine\PhpConfig-readCORE/src/Core/Configure.php, line 262 http://localhost:3000/admin/parentbookings# - ⟩ Cake\Core\Configure::loadROOT/config/bootstrap.php, line 199 http://localhost:3000/admin/parentbookings# - ⟩ requireROOT/webroot/index.php, line 27 http://localhost:3000/admin/parentbookings# What i have to do to access to my Company.php configure params and how overwrite this params on the file ? Thanks -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
Custom config file CakePHP 3.0 RC1
Hi, Sorry for my bad english :( I tried to create a custom config file to *read/update* my application params like the sitename, phone, mail *using a form* ... I read the CakePHP doc( http://book.cakephp.org/3.0/en/development/configuration.html). I add this lines on the *bootsrap.php* file: // Custom config file Configure::config('default', new PhpConfig('/config/')); Configure::load('Company'); I create the *Company.php* file on the config folder(*/config/Company.php*) and add this line: ?php use Cake\Core\Configure; use Cake\Core\Configure\Engine\PhpConfig; Configure::write('Company.sitename', My Company); but when i want to debug the config vars using debug(Configure::read()); i have this error: Could not load configuration file: /config/Company.php Cake\Core\Exception\Exception Documentation http://book.cakephp.org/3.0/ API http://api.cakephp.org/3.0/ If you want to customize this error message, create *src/Template/Error/error500.ctp* toggle vendor stack frames http://localhost:3000/admin/parentbookings# - ⟩ Cake\Core\Configure\Engine\PhpConfig-_getFilePathCORE/src/Core/Configure/Engine/PhpConfig.php, line 70 http://localhost:3000/admin/parentbookings# - ⟩ Cake\Core\Configure\Engine\PhpConfig-readCORE/src/Core/Configure.php, line 262 http://localhost:3000/admin/parentbookings# - ⟩ Cake\Core\Configure::loadROOT/config/bootstrap.php, line 199 http://localhost:3000/admin/parentbookings# - ⟩ requireROOT/webroot/index.php, line 27 http://localhost:3000/admin/parentbookings# What i have to do to access to my Company.php configure params and how overwrite this params on the file ? Thanks -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.
logout a specific user using the Auth Component
Hi, Sorry for my bad english :( I want to logout a specific user (not the logged one) using the cakephp Auth Component but the logout method doesn't accept any param !! is there any alternative way to specify the ID of the user that we want to logout ? thanks -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php. For more options, visit https://groups.google.com/d/optout.