cakephp

Cake 3.x How to setup a queue technology for jobs and news feeds?

江枫思渺然 提交于 2020-07-19 18:32:44
问题 I am using Cake 3.x I need to have the following things set up. A job queue to queue jobs that require long processing in the background A feed (like Facebook Feed) that informs various users of what's happening within the app This is what I have in terms of requirements: Job Queue This needs to be persistent and reliable. Meaning to say if the server suddenly rebooted, any jobs queued but not yet executed will still be there waiting to be processed upon reboot. News Feed / Activity Stream

PHP Fatal error: You must enable the intl extension to use CakePHP. in C:\xampp\htdocs\Cakecrud\config\requirements.php on line 31

主宰稳场 提交于 2020-07-16 09:40:25
问题 I have enabled both in php.ini extension= intl extension= php_intl.dll Still the error is same when I run the command on cmd Cake bake all students 回答1: It sounds like you might have added the intl exension to the wrong php.ini file. It needs to be added to the web php.ini file, not cli. To check what extensions are loaded for the web, write phpinfo();exit; in a PHP file then hit hit. To see whats loaded in PHP cli (where you may have added it by mistake), run php -m at a terminal. 来源: https:

how to access parameters from url in cakephp 3

混江龙づ霸主 提交于 2020-07-03 08:53:30
问题 In cook book of cakephp 3. It is given to build url using echo $this->Url->build([ "controller" => "Posts", "action" => "view", "foo" => "bar" ]); which will output as /posts/view/foo:bar How to access the foo:bar in action and save in a variable $foo ? 回答1: there's an error in the cookbook, so I opened this ticket if you use this code echo $this->Url->build([ "controller" => "Posts", "action" => "view", "foo" => "bar" ]); you'll get an url like this /posts/view/?foo=bar the manual here

how to access parameters from url in cakephp 3

允我心安 提交于 2020-07-03 08:52:06
问题 In cook book of cakephp 3. It is given to build url using echo $this->Url->build([ "controller" => "Posts", "action" => "view", "foo" => "bar" ]); which will output as /posts/view/foo:bar How to access the foo:bar in action and save in a variable $foo ? 回答1: there's an error in the cookbook, so I opened this ticket if you use this code echo $this->Url->build([ "controller" => "Posts", "action" => "view", "foo" => "bar" ]); you'll get an url like this /posts/view/?foo=bar the manual here

Using the paginator directly is not recognising the configuration

纵然是瞬间 提交于 2020-06-29 05:22:28
问题 CakePHP Version: 4.0.1 Introduction I have 2 methods that both use the index view, index and search . On index the column can be selected from a select list and a value can be inputted via an input form control enabling a search by column and value. This data is sent via GET to the search method where empty values are checked and the query is executed and the index view is rendered. In the later 3x versions with the below configuration the index view had the sort on the selected column which

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

CakePHP 4.0 database configuration

我们两清 提交于 2020-06-28 05:48:58
问题 'default' => [ 'className' => Connection::class, 'driver' => Mysql::class, 'persistent' => false, 'username' => 'root', 'password' => 'root', 'port' => '8889', 'database' => 'rajasthan_skill_development', 'timezone' => 'UTC', /** * For MariaDB/MySQL the internal default changed from utf8 to utf8mb4, aka full utf-8 support, in CakePHP 3.6 */ //'encoding' => 'utf8mb4', /** * If your MySQL server is configured with `skip-character-set-client-handshake` * then you MUST use the `flags` config to

How to manipulate the child items of the tree menu in cakephp 3?

自古美人都是妖i 提交于 2020-06-23 14:13:32
问题 I'm having doubts about manipulating the child menu items to improve the display style. I am currently generating according to documentation: function index() { $list = $this->Categorias->find('threaded')->toArray(); $this->set('list', $list); } $renderItems = function($items) use (&$renderItems) { echo '<ul>'; foreach ($items as $item) { echo '<li>'; echo h($item->name); if ($item->children) { $renderItems($item->children); // < recursion } echo '</li>'; } echo '</ul>'; }; $renderItems($list

How to redirect from an authenticator to an external authentication endpoint?

跟風遠走 提交于 2020-06-23 08:58:45
问题 I'm writing a web app which I want to have flexible authentication options due to different customers' needs. I'm using the official cakephp/authentication library, but it doesn't have an OpenID Connect Authenticator, so I'm rolling my own. The problem I'm having is that I can't return a modified Cake\Http\Response object with a redirect header from my Authenticator. AuthenticatorInterface requires the authenticate() method to return a Result object. I'm hoping to not have to modify more than

Using the paginator directly and defining the sort on an associated column not working

北慕城南 提交于 2020-06-17 09:39:08
问题 CakePHP Version: 4.0.1 Introduction This problem follows on from another problem I had here where a not ideal solution was to redirect back to itself. Unfortunately the controller I was testing didn't have any associated columns so this new problem was not identified. I referenced this in the cookbook. Hopefully the below code will allow the problem to be reproduced. Contacts Table public function initialize(array $config): void { parent::initialize($config); $this->setTable('contacts');