Skip to content

Commit

Permalink
remove auth component from docs
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSimal committed Aug 15, 2023
1 parent 0d15dac commit 377fea9
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 1,103 deletions.
19 changes: 9 additions & 10 deletions en/controllers/components.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ chapter for each component:
.. toctree::
:maxdepth: 1

/controllers/components/authentication
/controllers/components/flash
/controllers/components/security
/controllers/components/form-protection
Expand Down Expand Up @@ -72,29 +71,29 @@ Aliasing Components

One common setting to use is the ``className`` option, which allows you to
alias components. This feature is useful when you want to
replace ``$this->Auth`` or another common Component reference with a custom
replace ``$this->Flash`` or another common Component reference with a custom
implementation::

// src/Controller/PostsController.php
class PostsController extends AppController
{
public function initialize(): void
{
$this->loadComponent('Auth', [
'className' => 'MyAuth'
$this->loadComponent('Flash', [
'className' => 'MyFlash'
]);
}
}

// src/Controller/Component/MyAuthComponent.php
use Cake\Controller\Component\AuthComponent;
// src/Controller/Component/MyFlashComponent.php
use Cake\Controller\Component\FlashComponent;

class MyAuthComponent extends AuthComponent
class MyFlashComponent extends FlashComponent
{
// Add your code to override the core AuthComponent
// Add your code to override the core FlashComponent
}

The above would *alias* ``MyAuthComponent`` to ``$this->Auth`` in your
The above would *alias* ``MyFlashComponent`` to ``$this->Flash`` in your
controllers.

.. note::
Expand Down Expand Up @@ -341,4 +340,4 @@ When raising a ``RedirectException`` you can include additional headers::

.. meta::
:title lang=en: Components
:keywords lang=en: array controller,core libraries,authentication request,array name,access control lists,public components,controller code,core components,cookiemonster,login cookie,configuration settings,functionality,logic,sessions,cakephp,doc
:keywords lang=en: array controller,core libraries,array name,access control lists,public components,controller code,core components,cookiemonster,login cookie,configuration settings,functionality,logic,sessions,cakephp,doc
Loading

0 comments on commit 377fea9

Please sign in to comment.