cakephp-4.x

CakePHP: upgrade from 3.6.x to 4.0 “Missing Template Exception”

天涯浪子 提交于 2021-02-19 07:55:30
问题 I followed the upgrade guide (after I upgraded from 3.6 to 3.8 ) but I get this error: Error: [Cake\View\Exception\MissingTemplateException] Template file "Error\error500.ctp" is missing .... If you want to customize this error message, create src\Template\Error\fatal_error.ctp After the upgrade procedure my templates moved to app_name\templates directory and renamed to *.php instead of *.ctp . I updated the app.php and app.default.php with the new paths: 'App' => [ 'namespace' => 'App',

Cakephp 4 Windows Installation Issues

杀马特。学长 韩版系。学妹 提交于 2021-01-29 22:33:57
问题 I am running into composer/installation errrors on wamp64 setup on Windows 10... had this working previously on older app but now starting new app on 4.0.3 and running into dependency issues Below is output - Any thoughts on why it's not finding any matching packages? the "myapp" folder is created and cakephp source is copied but then a number of dependencies show "no matching package found" Can these packages be ignored? some, such as migrations fall under "require" in the composer.json I

How to Fix Cakephp 4 Composer Install Error

自闭症网瘾萝莉.ら 提交于 2021-01-29 06:10:22
问题 Having issues installing all packages for cakephp 4.0 via Composer. Running a fresh wamp server install on Windows with PHP 7.4.0 Here is composer output. Using the command found in the cakephp docs. www/> composer create-project --prefer-dist cakephp/app:^4.0 myapp Installing cakephp/app (4.0.0) - Installing cakephp/app (4.0.0): Loading from cache Created project in kollectit Loading composer repositories with package information Updating dependencies (including require-dev) Your

CakePHP 4.1 User entity as authorization identity associated fields

假装没事ソ 提交于 2020-08-10 13:02:01
问题 I have just created a very minimal project in CakePHP 4.1, mostly mimicking the CMS tutorial, and want to implement a fairly straightforward piece of logic. Using the Authorization module I want to allow a user A to be able to view a user B if 1) they are actually the same user ( A = B ) OR 2) if A is an admin. There are two DB tables - users and user_types . users has a foreign key user_type_id to user_types . This relationship is reflected in code as: ##### in UsersTable.php ##### class

CakePHP 4.1 User entity as authorization identity associated fields

ぐ巨炮叔叔 提交于 2020-08-10 13:01:25
问题 I have just created a very minimal project in CakePHP 4.1, mostly mimicking the CMS tutorial, and want to implement a fairly straightforward piece of logic. Using the Authorization module I want to allow a user A to be able to view a user B if 1) they are actually the same user ( A = B ) OR 2) if A is an admin. There are two DB tables - users and user_types . users has a foreign key user_type_id to user_types . This relationship is reflected in code as: ##### in UsersTable.php ##### class

CakePHP 4 CMS Authentication Tutorial redirection to login not working (subfolder ignored)

久未见 提交于 2020-06-29 04:40:06
问题 Im trying to implement an authentication according to the offical CMS Tutorial: https://book.cakephp.org/4/en/tutorials-and-examples/cms/authentication.html#adding-login But the Redirection implemented here: public function getAuthenticationService(ServerRequestInterface $request): AuthenticationServiceInterface { $authenticationService = new AuthenticationService([ 'unauthenticatedRedirect' => '/users/login', 'queryParam' => 'redirect', ]); does not work as expected. My Installation is in a