Skip to content

Commit 298c07b

Browse files
authored
Add headings for method signatures missing anchors (#8171)
Adds ### or #### headings above method signatures that previously had no anchor for deep linking. This enables direct URL references to individual methods in the documentation. Files updated: - views/helpers/html.md: linkFromPath, scriptStart/scriptEnd - views/helpers/paginator.md: sortDir, sortKey, prev, next, first, last, current, hasNext, hasPrev, hasPage, total - views/helpers/url.md: buildFromPath - views/helpers.md: 6 callback methods - controllers.md: fetchModel, beforeFilter, beforeRender, afterFilter - orm/deleting-data.md: delete, deleteAll - orm/entities.md: set, get, patch
1 parent 8565aee commit 298c07b

7 files changed

Lines changed: 56 additions & 0 deletions

File tree

docs/en/controllers.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,8 @@ $recentArticles = $this->fetchTable('Articles')->find('all',
476476
->all();
477477
```
478478

479+
### fetchModel()
480+
479481
`method` Cake\\Controller\\Controller::**fetchModel**(string|null $modelClass = null, string|null $modelType = null)
480482

481483
The `fetchModel()` method is useful to load non ORM models or ORM tables that
@@ -557,10 +559,16 @@ logic around the request life-cycle:
557559
By default the following callback methods are connected to related events if the
558560
methods are implemented by your controllers
559561

562+
#### beforeFilter()
563+
560564
`method` Cake\\Controller\\Controller::**beforeFilter**(EventInterface $event)
561565

566+
#### beforeRender()
567+
562568
`method` Cake\\Controller\\Controller::**beforeRender**(EventInterface $event)
563569

570+
#### afterFilter()
571+
564572
`method` Cake\\Controller\\Controller::**afterFilter**(EventInterface $event)
565573

566574
In addition to controller life-cycle callbacks, [Components](controllers/components)

docs/en/orm/deleting-data.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
`class` Cake\\ORM\\**Table**
44

5+
## Deleting a Single Entity
6+
57
`method` Cake\\ORM\\Table::**delete**(EntityInterface $entity, array $options = [])
68

79
Once you've loaded an entity you can delete it by calling the originating
@@ -80,6 +82,8 @@ $this->Articles->deleteManyOrFail($entities);
8082
The `$options` for these methods are the same as `delete()`. Deleting
8183
records with these method **will** trigger events.
8284

85+
### deleteAll()
86+
8387
`method` Cake\\ORM\\Table::**deleteAll**($conditions)
8488

8589
There may be times when deleting rows one by one is not efficient or useful.

docs/en/orm/entities.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,12 @@ echo $article->title;
9595

9696
You can also use the `get()` and `set()` methods.
9797

98+
### set()
99+
98100
`method` Cake\\ORM\\Entity::**set**($field, $value = null, array $options = [])
99101

102+
### get()
103+
100104
`method` Cake\\ORM\\Entity::**get**($field)
101105

102106
For example:
@@ -106,6 +110,8 @@ $article->set('title', 'This is my first post');
106110
echo $article->get('title');
107111
```
108112

113+
### patch()
114+
109115
`method` Cake\\ORM\\Entity::**patch**(array $fields, array $options = [])
110116

111117
Using `patch()` you can mass assign multiple fields at once:

docs/en/views/helpers.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,14 +375,26 @@ subscribe your helper to the relevant event. Unlike previous versions of CakePHP
375375
you should *not* call `parent` in your callbacks, as the base Helper class
376376
does not implement any of the callback methods.
377377

378+
#### beforeRenderFile()
379+
378380
`method` Helper::**beforeRenderFile**(EventInterface $event, $viewFile)
379381

382+
#### afterRenderFile()
383+
380384
`method` Helper::**afterRenderFile**(EventInterface $event, $viewFile, $content)
381385

386+
#### beforeRender()
387+
382388
`method` Helper::**beforeRender**(EventInterface $event, $viewFile)
383389

390+
#### afterRender()
391+
384392
`method` Helper::**afterRender**(EventInterface $event, $viewFile)
385393

394+
#### beforeLayout()
395+
386396
`method` Helper::**beforeLayout**(EventInterface $event, $layoutFile)
387397

398+
#### afterLayout()
399+
388400
`method` Helper::**afterLayout**(EventInterface $event, $layoutFile)

docs/en/views/helpers/html.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,8 @@ Will output:
425425
Also check `Cake\View\Helper\UrlHelper::build()` method
426426
for more examples of different types of URLs.
427427

428+
### Creating Links from Route Paths
429+
428430
`method` Cake\\View\\Helper\\HtmlHelper::**linkFromPath**(string $title, string $path, array $params = [], array $options = [])
429431

430432
If you want to use route path strings, you can do that using this method:
@@ -592,6 +594,8 @@ $this->Html->scriptBlock('alert("hi")', ['defer' => true]);
592594
$this->Html->scriptBlock('alert("hi")', ['block' => true]);
593595
```
594596

597+
### Starting and Ending Script Blocks
598+
595599
`method` Cake\\View\\Helper\\HtmlHelper::**scriptStart**(array $options = [])
596600

597601
`method` Cake\\View\\Helper\\HtmlHelper::**scriptEnd**()

docs/en/views/helpers/paginator.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ The lock option can be used to lock sorting into the specified direction:
187187
echo $this->Paginator->sort('user_id', null, ['direction' => 'asc', 'lock' => true]);
188188
```
189189

190+
### Getting Sort Direction and Key
191+
190192
`method` Cake\\View\\Helper\\PaginatorHelper::**sortDir**(string $model = null, mixed $options = [])
191193

192194
`method` Cake\\View\\Helper\\PaginatorHelper::**sortKey**(string $model = null, mixed $options = [])
@@ -247,12 +249,20 @@ In addition to generating links that go directly to specific page numbers,
247249
you'll often want links that go to the previous and next links, first and last
248250
pages in the paged data set.
249251

252+
### prev()
253+
250254
`method` Cake\\View\\Helper\\PaginatorHelper::**prev**($title = '<< Previous', $options = [])
251255

256+
### next()
257+
252258
`method` Cake\\View\\Helper\\PaginatorHelper::**next**($title = 'Next >>', $options = [])
253259

260+
### first()
261+
254262
`method` Cake\\View\\Helper\\PaginatorHelper::**first**($first = '<< first', $options = [])
255263

264+
### last()
265+
256266
`method` Cake\\View\\Helper\\PaginatorHelper::**last**($last = 'last >>', $options = [])
257267

258268
### Creating Header Link Tags
@@ -270,14 +280,24 @@ echo $this->Paginator->meta(['first' => true, 'last' => true]);
270280

271281
### Checking the Pagination State
272282

283+
#### current()
284+
273285
`method` Cake\\View\\Helper\\PaginatorHelper::**current**()
274286

287+
#### hasNext()
288+
275289
`method` Cake\\View\\Helper\\PaginatorHelper::**hasNext**(string $model = null)
276290

291+
#### hasPrev()
292+
277293
`method` Cake\\View\\Helper\\PaginatorHelper::**hasPrev**()
278294

295+
#### hasPage()
296+
279297
`method` Cake\\View\\Helper\\PaginatorHelper::**hasPage**(int $page = 1)
280298

299+
#### total()
300+
281301
`method` Cake\\View\\Helper\\PaginatorHelper::**total**()
282302

283303
### Creating a Page Counter

docs/en/views/helpers/url.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ $this->Url->build('/posts', [
111111
]);
112112
```
113113

114+
### Building URLs from Route Paths
115+
114116
`method` Cake\\View\\Helper\\UrlHelper::**buildFromPath**(string $path, array $params = [], array $options = [])
115117

116118
If you want to use route path strings, you can do that using this method:

0 commit comments

Comments
 (0)