I want to mark down CakePHP, but I can't fix the error.

Asked 2 years ago, Updated 2 years ago, 56 views

Currently, I was trying to implement the markdown function in the Notepad app, so I introduced the markdown plug-in from github and proceeded according to the procedure. An error has occurred.
I checked and checked, but it seems that the load component is not loading well.
How can I solve this problem?
Here is the github sauce.
https://github.com/ivanamat/cakephp3-markdown/blob/master/README.md
Enter a description of the image here

Code

public function initialize()
{
    parent::initialize();

    $this->loadComponent('Paginator');
    $this->loadComponent('Flash');// Include FlashComponent
    $this->Auth->allow(['tags']);
    $this->loadComponent('Markdown.Markdown');
}
public$components=[
    'Markdown' = > [
      'className' = > 'Markdown.Markdown'
        ]
    ];

cakephp

2022-09-30 19:44

1 Answers

As you can see in hinaloe's comment, there is a duplicate error because both $this->loadComponent and $components are calling the Markdown component.

The controller's $components property deprecates calling components and should use the loadComponent method.

Remove the Markdown item from the controller $components property.


2022-09-30 19:44

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.