Skip to content

Commit 1397b3f

Browse files
committed
Update documentation for CakePHP 5 compatibility
- Fix "receipient(s)" typo -> "recipient(s)" - Update template paths: src/Template/Element -> templates/element - Update template extensions: .ctp -> .php - Update plugins documentation link: 3.0 -> 5 - Add return types to code examples - Add type declaration to $plugin property
1 parent 40586a0 commit 1397b3f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/en/index.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Creating Preview Classes
180180
------------------------
181181

182182
In order to preview emails before sending them, you need to create a preview
183-
class that defines the receipient and required template variables for your
183+
class that defines the recipient and required template variables for your
184184
mailer methods::
185185

186186
// in src/Mailer/Preview/WelcomePreview.php
@@ -190,10 +190,10 @@ mailer methods::
190190

191191
class WelcomePreview extends MailPreview
192192
{
193-
public function welcome()
193+
public function welcome(): \Cake\Mailer\Mailer
194194
{
195195
$mailer = $this->getMailer('Welcome');
196-
// set any template variables receipients for the mailer.
196+
// set any template variables and recipients for the mailer.
197197

198198
return $mailer;
199199
}
@@ -246,9 +246,9 @@ Panel Elements
246246

247247
Each Panel is expected to have a view element that renders the content from the
248248
panel. The element name must be the underscored inflection of the class name.
249-
For example ``SessionPanel`` has an element named **session_panel.ctp**, and
250-
SqllogPanel has an element named **sqllog_panel.ctp**. These elements should be
251-
located in the root of your **src/Template/Element** directory.
249+
For example ``SessionPanel`` has an element named **session_panel.php**, and
250+
SqllogPanel has an element named **sqllog_panel.php**. These elements should be
251+
located in the root of your **templates/element** directory.
252252

253253
Custom Titles and Elements
254254
--------------------------
@@ -278,7 +278,7 @@ behaves and appears:
278278
Panels in Other Plugins
279279
-----------------------
280280

281-
Panels provided by `plugins <https://book.cakephp.org/3.0/en/plugins.html>`_ work
281+
Panels provided by `plugins <https://book.cakephp.org/5/en/plugins.html>`_ work
282282
almost entirely the same as other plugins, with one minor difference: You must
283283
set ``public $plugin`` to be the name of the plugin directory, so that the
284284
panel's Elements can be located at render time::
@@ -289,7 +289,7 @@ panel's Elements can be located at render time::
289289

290290
class MyCustomPanel extends DebugPanel
291291
{
292-
public $plugin = 'MyPlugin';
292+
public string $plugin = 'MyPlugin';
293293
...
294294
}
295295

0 commit comments

Comments
 (0)