From b2b086f3240b7f5d13bffd0f0e7bf6214aaf4909 Mon Sep 17 00:00:00 2001 From: mscherer Date: Sun, 1 Feb 2026 20:07:56 +0100 Subject: [PATCH] Fix broken anchor links across documentation. Update internal cross-reference anchors to match actual heading slugs in target documents. Fixes links in migration guides, controllers, ORM, views, core libraries, and tutorial documentation. --- docs/en/appendices/5-0-migration-guide.md | 2 +- docs/en/appendices/5-1-migration-guide.md | 2 +- docs/en/appendices/5-2-migration-guide.md | 2 +- docs/en/appendices/5-3-migration-guide.md | 4 +- docs/en/console-commands.md | 2 +- docs/en/contributing/code.md | 2 +- docs/en/controllers.md | 10 ++-- docs/en/controllers/pagination.md | 4 +- docs/en/controllers/request-response.md | 2 +- docs/en/core-libraries/caching.md | 4 +- docs/en/core-libraries/email.md | 6 +- docs/en/core-libraries/events.md | 4 +- docs/en/core-libraries/httpclient.md | 4 +- docs/en/core-libraries/logging.md | 4 +- docs/en/core-libraries/time.md | 2 +- docs/en/core-libraries/validation.md | 6 +- docs/en/deployment.md | 2 +- docs/en/development/application.md | 2 +- docs/en/development/configuration.md | 14 ++--- docs/en/development/rest.md | 4 +- docs/en/development/routing.md | 8 +-- docs/en/development/sessions.md | 4 +- docs/en/development/testing.md | 12 ++-- docs/en/intro.md | 2 +- docs/en/intro/conventions.md | 4 +- docs/en/orm.md | 4 +- docs/en/orm/associations.md | 6 +- docs/en/orm/behaviors.md | 4 +- docs/en/orm/database-basics.md | 8 +-- docs/en/orm/deleting-data.md | 2 +- docs/en/orm/query-builder.md | 10 ++-- docs/en/orm/retrieving-data-and-resultsets.md | 22 +++---- docs/en/orm/saving-data.md | 28 ++++----- docs/en/orm/schema-system.md | 2 +- docs/en/orm/table-objects.md | 6 +- docs/en/plugins.md | 8 +-- docs/en/topics.md | 2 +- .../cms/articles-controller.md | 4 +- .../cms/articles-model.md | 2 +- .../cms/tags-and-users.md | 4 +- docs/en/views.md | 10 ++-- docs/en/views/helpers.md | 2 +- docs/en/views/helpers/breadcrumbs.md | 2 +- docs/en/views/helpers/form.md | 60 +++++++++---------- docs/en/views/helpers/html.md | 2 +- docs/en/views/json-and-xml-views.md | 6 +- docs/en/views/themes.md | 4 +- 47 files changed, 155 insertions(+), 155 deletions(-) diff --git a/docs/en/appendices/5-0-migration-guide.md b/docs/en/appendices/5-0-migration-guide.md index e80770dcb9..6325033a75 100644 --- a/docs/en/appendices/5-0-migration-guide.md +++ b/docs/en/appendices/5-0-migration-guide.md @@ -303,7 +303,7 @@ CakePHP 5 leverages the expanded type system feature available in PHP 8.1+. CakePHP also uses `assert()` to provide improved error messages and additional type soundness. In production mode, you can configure PHP to not generate code for `assert()` yielding improved application performance. See the -[Symlink Assets](../deployment#symlink-assets) for how to do this. +[Symlink Assets](../deployment#moving-files) for how to do this. ### Collection diff --git a/docs/en/appendices/5-1-migration-guide.md b/docs/en/appendices/5-1-migration-guide.md index 64836865ad..efd1a4ac83 100644 --- a/docs/en/appendices/5-1-migration-guide.md +++ b/docs/en/appendices/5-1-migration-guide.md @@ -93,7 +93,7 @@ bin/cake upgrade rector --rules cakephp51 a typesafe way to cast request data or other input and return `null` when conversion fails. - `pathCombine()` was added to help build paths without worrying about duplicate and trailing slashes. - A new `events` hook was added to the `BaseApplication` as well as the `BasePlugin` class. This hook - is the recommended way to register global event listeners for you application. See [Registering Listeners](../core-libraries/events#registering-event-listeners) + is the recommended way to register global event listeners for you application. See [Registering Listeners](../core-libraries/events#registering-listeners) ### Database diff --git a/docs/en/appendices/5-2-migration-guide.md b/docs/en/appendices/5-2-migration-guide.md index 6a59c78b3e..fff206dfdc 100644 --- a/docs/en/appendices/5-2-migration-guide.md +++ b/docs/en/appendices/5-2-migration-guide.md @@ -51,7 +51,7 @@ bin/cake upgrade rector --rules cakephp52 - The `errorClass` option of `FormHelper` has been deprecated in favour of using a template string. To upgrade move your `errorClass` definition to - a template set. See [Customizing Templates](../views/helpers/form#customizing-templates). + a template set. See [Customizing Templates](../views/helpers/form#customizing-the-templates-formhelper-uses). ## New Features diff --git a/docs/en/appendices/5-3-migration-guide.md b/docs/en/appendices/5-3-migration-guide.md index 2648a07d3c..81f09ef40d 100644 --- a/docs/en/appendices/5-3-migration-guide.md +++ b/docs/en/appendices/5-3-migration-guide.md @@ -119,7 +119,7 @@ If you are not running on **PHP 8.2 or higher**, you will need to upgrade PHP be ### Core - Added `Configure` attribute to support injecting `Configure` values into - constructor arguments. See [Configure Dependency Injection](../development/dependency-injection#configure-dependency-injection). + constructor arguments. See [Configure Dependency Injection](../development/dependency-injection#using-configuration-data). ### Database @@ -174,7 +174,7 @@ If you are not running on **PHP 8.2 or higher**, you will need to upgrade PHP be - Added `SelectQuery::projectAs()` for projecting query results into Data Transfer Objects (DTOs) instead of Entity objects. DTOs provide a memory-efficient alternative (approximately 3x less memory than entities) for - read-only data access. See [Dto Projection](../orm/query-builder#dto-projection). + read-only data access. See [Dto Projection](../orm/query-builder#projecting-results-into-dtos). - Added the `#[CollectionOf]` attribute for declaring the element type of array properties in DTOs. This enables proper hydration of nested associations into DTOs. diff --git a/docs/en/console-commands.md b/docs/en/console-commands.md index 5635af6b39..9ca9f828ee 100644 --- a/docs/en/console-commands.md +++ b/docs/en/console-commands.md @@ -79,7 +79,7 @@ class Application extends BaseApplication ``` In the above example, the only commands available would be `help`, `version` -and `user`. See the [Plugin Commands](plugins#plugin-commands) section for how to add commands in +and `user`. See the [Plugin Commands](plugins#commands) section for how to add commands in your plugins. > [!NOTE] diff --git a/docs/en/contributing/code.md b/docs/en/contributing/code.md index 3aa04b320e..9117a7fe70 100644 --- a/docs/en/contributing/code.md +++ b/docs/en/contributing/code.md @@ -39,7 +39,7 @@ to date with CakePHP: git remote add upstream git://github.com/cakephp/cakephp.git Now that you have CakePHP setup you should be able to define a `$test` -[database connection](../orm/database-basics#database-configuration), and +[database connection](../orm/database-basics#configuration), and [run all the tests](../development/testing#running-tests). ## Working on a Patch diff --git a/docs/en/controllers.md b/docs/en/controllers.md index f3ef6aaef6..ec0c890fea 100644 --- a/docs/en/controllers.md +++ b/docs/en/controllers.md @@ -77,10 +77,10 @@ class AppController extends Controller When a request is made to a CakePHP application, CakePHP's `Cake\Routing\Router` and `Cake\Routing\Dispatcher` -classes use [Routes Configuration](development/routing#routes-configuration) to find and create the correct +classes use [Routes Configuration](development/routing#connecting-routes) to find and create the correct controller instance. The request data is encapsulated in a request object. CakePHP puts all the important request information into the `$this->request` -property. See the section on [Cake Request](controllers/request-response#cake-request) for more information on the +property. See the section on [Cake Request](controllers/request-response#request) for more information on the CakePHP request object. ## Controller Actions @@ -319,7 +319,7 @@ This would render **plugins/Users/templates/UserDetails/custom_file.php** Controllers can define a list of view classes they support. After the controller's action is complete CakePHP will use the view list to perform -content-type negotiation with either [File Extensions](development/routing#file-extensions) or `Accept` +content-type negotiation with either [File Extensions](development/routing#routing-file-extensions) or `Accept` headers. This enables your application to re-use the same controller action to render an HTML view or render a JSON or XML response. To define the list of supported view classes for a controller is done with the `addViewClasses()` @@ -359,7 +359,7 @@ public function export(): void If within your controller actions you need to process the request or load data differently based on the content type you can use -[Check The Request](controllers/request-response#check-the-request): +[Check The Request](controllers/request-response#checking-request-conditions): ``` php // In a controller action @@ -482,7 +482,7 @@ return $this->redirect('/order/confirm', 301); return $this->redirect('/order/confirm', 303); ``` -See the [Redirect Component Events](controllers/components#redirect-component-events) section for how to redirect out of +See the [Redirect Component Events](controllers/components#using-redirects-in-component-events) section for how to redirect out of a life-cycle handler. ## Loading Additional Tables/Models diff --git a/docs/en/controllers/pagination.md b/docs/en/controllers/pagination.md index c1ab4b2938..0aa21932de 100644 --- a/docs/en/controllers/pagination.md +++ b/docs/en/controllers/pagination.md @@ -54,7 +54,7 @@ class ArticlesController extends AppController > [!TIP] > Default `order` options must be defined as an array. -You can also use [Custom Find Methods](../orm/retrieving-data-and-resultsets#custom-find-methods) in pagination by using the `finder` option: +You can also use [Custom Find Methods](../orm/retrieving-data-and-resultsets#custom-finder-methods) in pagination by using the `finder` option: ``` php class ArticlesController extends AppController @@ -166,7 +166,7 @@ paginate both tags and articles at the same time: /dashboard?article[page]=1&tag[page]=3 -See the [Paginator Helper Multiple](../views/helpers/paginator#paginator-helper-multiple) section for how to generate scoped HTML +See the [Paginator Helper Multiple](../views/helpers/paginator#paginating-multiple-results) section for how to generate scoped HTML elements and URLs for pagination. ### Paginating the Same Model multiple Times diff --git a/docs/en/controllers/request-response.md b/docs/en/controllers/request-response.md index 7ebba0f533..ee2cd59f39 100644 --- a/docs/en/controllers/request-response.md +++ b/docs/en/controllers/request-response.md @@ -734,7 +734,7 @@ $this->response = $this->response->withType('vcf'); Usually, you'll want to map additional content types in your controller's `~Controller::beforeFilter()` callback, so you can benefit from -automatic view switching provided by [Controller Viewclasses](../controllers#controller-viewclasses). +automatic view switching provided by [Controller Viewclasses](../controllers#content-type-negotiation). diff --git a/docs/en/core-libraries/caching.md b/docs/en/core-libraries/caching.md index 476f330e72..7028e2997b 100644 --- a/docs/en/core-libraries/caching.md +++ b/docs/en/core-libraries/caching.md @@ -303,7 +303,7 @@ of trips made to the database to fetch posts. > [!NOTE] > If you plan to cache the result of queries made with the CakePHP ORM, > it is better to use the built-in cache capabilities of the Query object -> as described in the [Caching Query Results](../orm/query-builder#caching-query-results) section +> as described in the [Caching Query Results](../orm/query-builder#caching-loaded-results) section ### Cache::writeMany() @@ -541,7 +541,7 @@ You can greatly improve the performance of your application by putting results that infrequently change, or that are subject to heavy reads into the cache. A perfect example of this are the results from `Cake\ORM\Table::find()`. The Query object allows you to cache -results using the `cache()` method. See the [Caching Query Results](../orm/query-builder#caching-query-results) section +results using the `cache()` method. See the [Caching Query Results](../orm/query-builder#caching-loaded-results) section for more information. diff --git a/docs/en/core-libraries/email.md b/docs/en/core-libraries/email.md index 0e0a785393..1bae62129b 100644 --- a/docs/en/core-libraries/email.md +++ b/docs/en/core-libraries/email.md @@ -126,9 +126,9 @@ following configuration keys are used: variables to be used in the view. See `Mailer::setViewVars()`. - `'attachments'`: List of files to attach. See `Mailer::setAttachments()`. - `'emailFormat'`: Format of email (html, text or both). See `Mailer::setEmailFormat()`. -- `'transport'`: Transport configuration name. See [Email Transport](#email-transport). +- `'transport'`: Transport configuration name. See [Email Transport](#configuring-transports). - `'log'`: Log level to log the email headers and message. `true` will use - LOG_DEBUG. See [Logging Levels](../core-libraries/logging#logging-levels). Note that logs will be emitted under the scope named `email`. + LOG_DEBUG. See [Logging Levels](../core-libraries/logging#using-levels). Note that logs will be emitted under the scope named `email`. See also [Logging Scopes](../core-libraries/logging#logging-scopes). - `'helpers'`: Array of helpers used in the email template. `ViewBuilder::setHelpers()`/`ViewBuilder::addHelpers()`. @@ -441,7 +441,7 @@ $this->Users->getEventManager()->on($this->getMailer('User')); > [!NOTE] > For information on how to register event listener objects, -> please refer to the [Registering Event Listeners](../core-libraries/events#registering-event-listeners) documentation. +> please refer to the [Registering Event Listeners](../core-libraries/events#registering-listeners) documentation. diff --git a/docs/en/core-libraries/events.md b/docs/en/core-libraries/events.md index beb6af7f13..3669052113 100644 --- a/docs/en/core-libraries/events.md +++ b/docs/en/core-libraries/events.md @@ -150,8 +150,8 @@ There are a number of core events within the framework which your application can listen to. Each layer of CakePHP emits events that you can use in your application. -- [ORM/Model events](../orm/table-objects#table-callbacks) -- [Controller events](../controllers#controller-life-cycle) +- [ORM/Model events](../orm/table-objects#lifecycle-callbacks) +- [Controller events](../controllers#request-life-cycle-callbacks) - [View events](../views#view-events) ### `Server.terminate` diff --git a/docs/en/core-libraries/httpclient.md b/docs/en/core-libraries/httpclient.md index 37ddb8a4ea..2c19b76182 100644 --- a/docs/en/core-libraries/httpclient.md +++ b/docs/en/core-libraries/httpclient.md @@ -167,7 +167,7 @@ addition request information. The following keys can be used in `$options`: The options parameter is always the 3rd parameter in each of the HTTP methods. They can also be used when constructing `Client` to create -[scoped clients](#http_client_scoped_client). +[scoped clients](#creating-scoped-clients). ## Authentication @@ -330,7 +330,7 @@ $response = $http->get('http://foo.com/test.php'); The above will replace the domain, scheme, and port. However, this request will continue using all the other options defined when the scoped client was created. -See [Http Client Request Options](#http_client_request_options) for more information on the options +See [Http Client Request Options](#request-method-options) for more information on the options supported. ## Setting and Managing Cookies diff --git a/docs/en/core-libraries/logging.md b/docs/en/core-libraries/logging.md index 14c8c9c232..edf9bade4b 100644 --- a/docs/en/core-libraries/logging.md +++ b/docs/en/core-libraries/logging.md @@ -57,7 +57,7 @@ Log::setConfig('error', [ The above creates three loggers, named `info`, `debug` and `error`. Each is configured to handle different levels of messages. They also store their log messages in separate files, so we can separate debug/notice/info logs -from more serious errors. See the section on [Logging Levels](#logging-levels) for more +from more serious errors. See the section on [Logging Levels](#using-levels) for more information on the different levels and what they mean. Once a configuration is created you cannot change it. Instead you should drop @@ -454,7 +454,7 @@ param array `$config` Array of configuration information and constructor arguments for the logger. -Get or set the configuration for a Logger. See [Log Configuration](#log-configuration) for +Get or set the configuration for a Logger. See [Log Configuration](#logging-configuration) for more information. ### Log::configured() diff --git a/docs/en/core-libraries/time.md b/docs/en/core-libraries/time.md index edc6d9aa8f..7b78eb6fd5 100644 --- a/docs/en/core-libraries/time.md +++ b/docs/en/core-libraries/time.md @@ -550,7 +550,7 @@ It wraps the `Cake\Chronos\ChronosTime` class. ## Accepting Localized Request Data When creating text inputs that manipulate dates, you'll probably want to accept -and parse localized datetime strings. See the [Parsing Localized Dates](../core-libraries/internationalization-and-localization#parsing-localized-dates). +and parse localized datetime strings. See the [Parsing Localized Dates](../core-libraries/internationalization-and-localization#parsing-localized-datetime-data). ## Supported Timezones diff --git a/docs/en/core-libraries/validation.md b/docs/en/core-libraries/validation.md index 7c8b84151e..5dc9191eed 100644 --- a/docs/en/core-libraries/validation.md +++ b/docs/en/core-libraries/validation.md @@ -201,7 +201,7 @@ containing data related to the validation process: Closures should return boolean true if the validation passes. If it fails, return boolean false or for a custom error message return a string, see the -[Conditional/Dynamic Error Messages](#dynamic_validation_error_messages) +[Conditional/Dynamic Error Messages](#conditionaldynamic-error-messages) section for further details. ::: info Changed in version 5.3.0 @@ -212,7 +212,7 @@ The `entity` key was added to validation context. ### Conditional/Dynamic Error Messages -Validation rule methods, being it [custom callables](#custom-validation-rules), +Validation rule methods, being it [custom callables](#using-custom-validation-rules), or [methods supplied by providers](#adding-validation-providers), can either return a boolean, indicating whether the validation succeeded, or they can return a string, which means that the validation failed, and that the returned string @@ -639,7 +639,7 @@ $valid = $this->Articles->newEntity($article, [ Apart from validating user provided data maintaining integrity of data regardless where it came from is important. To solve this problem CakePHP offers a second level of validation which is called "application rules". You can read more about -them in the [Applying Application Rules](../orm/validation#application-rules) section. +them in the [Applying Application Rules](../orm/validation#applying-application-rules) section. ## Core Validation Rules diff --git a/docs/en/deployment.md b/docs/en/deployment.md index 8de20ce29e..51b3917356 100644 --- a/docs/en/deployment.md +++ b/docs/en/deployment.md @@ -65,7 +65,7 @@ variables. If you're throwing your application out into the wild, it's a good idea to make sure it doesn't have any obvious leaks: -- Ensure you are using the [Csrf Middleware](security/csrf#csrf-middleware) component or middleware. +- Ensure you are using the [Csrf Middleware](security/csrf#cross-site-request-forgery-csrf-middleware) component or middleware. - You may want to enable the [Form Protection Component](controllers/components/form-protection) component. It can help prevent several types of form tampering and reduce the possibility of mass-assignment issues. diff --git a/docs/en/development/application.md b/docs/en/development/application.md index 8a025df7e1..600cf707f2 100644 --- a/docs/en/development/application.md +++ b/docs/en/development/application.md @@ -80,5 +80,5 @@ class Application extends BaseApplication ``` Loading plugins and events in `Application::bootstrap()` makes -[Integration Testing](../development/testing#integration-testing) easier as events and routes will be re-processed on +[Integration Testing](../development/testing#controller-integration-testing) easier as events and routes will be re-processed on each test method. diff --git a/docs/en/development/configuration.md b/docs/en/development/configuration.md index a08fd0a73c..8d24a81b82 100644 --- a/docs/en/development/configuration.md +++ b/docs/en/development/configuration.md @@ -148,7 +148,7 @@ of paths for plugins, view templates and locale files respectively. App.uploadedFilesAsObjects Defines whether uploaded files are being represented as objects (`true`), or arrays (`false`). This option is being treated as enabled by default. -See the [File Uploads section](../controllers/request-response#request-file-uploads) in the Request & +See the [File Uploads section](../controllers/request-response#file-uploads) in the Request & Response Objects chapter for more information. Security.salt @@ -192,27 +192,27 @@ If you set `App.imageBaseUrl` to `https://mycdn.example.com/`: ### Database Configuration -See the [Database Configuration](../orm/database-basics#database-configuration) for information +See the [Database Configuration](../orm/database-basics#configuration) for information on configuring your database connections. ### Caching Configuration -See the [Caching Configuration](../core-libraries/caching#cache-configuration) for information on +See the [Caching Configuration](../core-libraries/caching#configuring-cache-engines) for information on configuring caching in CakePHP. ### Error and Exception Handling Configuration -See the [Error and Exception Configuration](../development/errors#error-configuration) for +See the [Error and Exception Configuration](../development/errors#configuration) for information on configuring error and exception handlers. ### Logging Configuration -See the [Log Configuration](../core-libraries/logging#log-configuration) for information on configuring logging in +See the [Log Configuration](../core-libraries/logging#logging-configuration) for information on configuring logging in CakePHP. ### Email Configuration -See the [Email Configuration](../core-libraries/email#email-configuration) for information on +See the [Email Configuration](../core-libraries/email#configuration) for information on configuring email presets in CakePHP. ### Session Configuration @@ -222,7 +222,7 @@ handling in CakePHP. ### Routing configuration -See the [Routes Configuration](../development/routing#routes-configuration) for more information +See the [Routes Configuration](../development/routing#connecting-routes) for more information on configuring routing and creating routes for your application. ## Additional Class Paths diff --git a/docs/en/development/rest.md b/docs/en/development/rest.md index 855a07e56f..3abe30a88f 100644 --- a/docs/en/development/rest.md +++ b/docs/en/development/rest.md @@ -92,7 +92,7 @@ In our `RecipesController`, we have several actions that define the logic to create, edit, view and delete recipes. In each of our actions we're using the `serialize` option to tell CakePHP which view variables should be serialized when making API responses. We'll connect our controller to the -application URLs with [Resource Routes](../development/routing#resource-routes): +application URLs with [Resource Routes](../development/routing#restful-routing): ``` php // in config/routes.php @@ -123,7 +123,7 @@ If we wanted to modify the data before it is converted into JSON we should not define the `serialize` option, and instead use template files. We would place the REST templates for our RecipesController inside **templates/Recipes/json**. -See the [Controller Viewclasses](../controllers#controller-viewclasses) for more information on how CakePHP's +See the [Controller Viewclasses](../controllers#content-type-negotiation) for more information on how CakePHP's response negotiation functionality works. ## Parsing Request Bodies diff --git a/docs/en/development/routing.md b/docs/en/development/routing.md index 95f26b371e..98c0e33da0 100644 --- a/docs/en/development/routing.md +++ b/docs/en/development/routing.md @@ -288,7 +288,7 @@ will go to the 'update' action. There are HTTP helper methods for: - HEAD All of these methods return the route instance allowing you to leverage the -[fluent setters](#route-fluent-methods) to further configure your route. +[fluent setters](#configuring-route-options) to further configure your route. ### Route Elements @@ -414,7 +414,7 @@ CakePHP, and should not be used unless you want the special meaning - `action` Used to name the controller action for a route. - `plugin` Used to name the plugin a controller is located in. - `prefix` Used for [Prefix Routing](#prefix-routing) -- `_ext` Used for [File extensions routing](#file-extensions). +- `_ext` Used for [File extensions routing](#routing-file-extensions). - `_base` Set to `false` to remove the base path from the generated URL. If your application is not in the root directory, this can be used to generate URLs that are 'cake relative'. @@ -428,7 +428,7 @@ CakePHP, and should not be used unless you want the special meaning - `_https` Set to `true` to convert the generated URL to https or `false` to force http. Prior to 4.5.0 use `_ssl`. - `_method` Define the HTTP verb/method to use. Useful when working with - [Resource Routes](#resource-routes). + [Resource Routes](#restful-routing). - `_name` Name of route. If you have setup named routes, you can use this key to specify it. @@ -1496,7 +1496,7 @@ $routes->url([ You can also use any of the special route elements when generating URLs: -- `_ext` Used for [File Extensions](#file-extensions) routing. +- `_ext` Used for [File Extensions](#routing-file-extensions) routing. - `_base` Set to `false` to remove the base path from the generated URL. If your application is not in the root directory, this can be used to generate URLs that are 'cake relative'. diff --git a/docs/en/development/sessions.md b/docs/en/development/sessions.md index 7345c422a7..a12c73afa1 100644 --- a/docs/en/development/sessions.md +++ b/docs/en/development/sessions.md @@ -245,8 +245,8 @@ blocking users to e.g. open a second tab of your app to do something else in the meantime. To prevent this behavior you will have to change the way how sessions are being -handled in CakePHP by using a different session handler like [Sessions Cache Sessions](#sessions-cache-sessions) -combined with the [Redis Engine](../core-libraries/caching#caching-redisengine) or another cache engine. +handled in CakePHP by using a different session handler like [Sessions Cache Sessions](#cache-sessions) +combined with the [Redis Engine](../core-libraries/caching#redisengine-options) or another cache engine. > [!TIP] > If you want to read more about Session Locking see [here](https://ma.ttias.be/php-session-locking-prevent-sessions-blocking-in-requests/) diff --git a/docs/en/development/testing.md b/docs/en/development/testing.md index 6c8cebc823..8c431b4db6 100644 --- a/docs/en/development/testing.md +++ b/docs/en/development/testing.md @@ -1244,7 +1244,7 @@ public function setUp(): void } ``` -You should also take care to try and use [Application Bootstrap](../development/application#application-bootstrap) to load +You should also take care to try and use [Application Bootstrap](../development/application#applicationbootstrap) to load any plugins containing events/routes. Doing so will ensure that your events/routes are connected for each test case. Alternatively if you wish to load plugins manually in a test you can use the `loadPlugins()` method. @@ -1362,7 +1362,7 @@ that option when `debug` is enabled. ### Testing with file uploads Simulating file uploads is straightforward when you use the default -"[uploaded files as objects](../controllers/request-response#request-file-uploads)" mode. You can simply +"[uploaded files as objects](../controllers/request-response#file-uploads)" mode. You can simply create instances that implement [\Psr\Http\Message\UploadedFileInterface](https://www.php-fig.org/psr/psr-7/#16-uploaded-files) (the default implementation currently used by CakePHP is @@ -1711,7 +1711,7 @@ git status ## Console Integration Testing -See [Console Integration Testing](../console-commands/commands#console-integration-testing) for how to test console commands. +See [Console Integration Testing](../console-commands/commands#testing-commands) for how to test console commands. ## Mocking Injected Dependencies @@ -1720,7 +1720,7 @@ the dependency injection container in your integration tests. ## Mocking HTTP Client Responses -See [Httpclient Testing](../core-libraries/httpclient#httpclient-testing) to know how to create mock responses to external APIs. +See [Httpclient Testing](../core-libraries/httpclient#testing) to know how to create mock responses to external APIs. ## Testing Views @@ -2012,11 +2012,11 @@ $this->assertEventFiredWith('My.Global.Event', 'user', 1); ## Testing Email -See [Email Testing](../core-libraries/email#email-testing) for information on testing email. +See [Email Testing](../core-libraries/email#testing-mailers) for information on testing email. ## Testing Logging -See [Log Testing](../core-libraries/logging#log-testing) for information on testing log messages. +See [Log Testing](../core-libraries/logging#testing-logs) for information on testing log messages. ## Creating Test Suites diff --git a/docs/en/intro.md b/docs/en/intro.md index 910cd8306b..980bf752f1 100644 --- a/docs/en/intro.md +++ b/docs/en/intro.md @@ -73,7 +73,7 @@ or a XML formatted result for others to consume: ``` -The View layer provides a number of extension points like [View Templates](views#view-templates), [View Elements](views#view-elements) +The View layer provides a number of extension points like [View Templates](views#view-templates), [View Elements](views#elements) and [View Cells](views/cells) to let you re-use your presentation logic. The View layer is not only limited to HTML or text representation of the data. diff --git a/docs/en/intro/conventions.md b/docs/en/intro/conventions.md index 408f097b75..d1f0eee142 100644 --- a/docs/en/intro/conventions.md +++ b/docs/en/intro/conventions.md @@ -104,7 +104,7 @@ class user extends AppController > **Acronyms:** Treat them as words. `CMS` becomes `CmsController`, not `CMSController` > [!NOTE] -> CakePHP uses the `DashedRoute` class by convention to automatically convert camelCase action names to dashed URLs. See [Routes Configuration](../development/routing#routes-configuration) for details. +> CakePHP uses the `DashedRoute` class by convention to automatically convert camelCase action names to dashed URLs. See [Routes Configuration](../development/routing#connecting-routes) for details. **URL Arrays:** @@ -371,4 +371,4 @@ URL: `https://example.com/articles/view/5` Now that you understand CakePHP's structure and conventions, try the [Content Management Tutorial](../tutorials-and-examples/cms/installation) to see how everything fits together in a real application. -For routing and URL handling, see [Routes Configuration](../development/routing#routes-configuration). +For routing and URL handling, see [Routes Configuration](../development/routing#connecting-routes). diff --git a/docs/en/orm.md b/docs/en/orm.md index d80c153105..17f76ed3ad 100644 --- a/docs/en/orm.md +++ b/docs/en/orm.md @@ -20,12 +20,12 @@ patterns. It aims to create a hybrid implementation that combines aspects of both patterns to create a fast, simple to use ORM. Before we get started exploring the ORM, make sure you [configure your -database connections](orm/database-basics#database-configuration). +database connections](orm/database-basics#configuration). ## Quick Example To get started you don't have to write any code. If you've followed the -[CakePHP conventions for your database tables](intro/conventions#model-and-database-conventions) you can just start using the ORM. For example +[CakePHP conventions for your database tables](intro/conventions#database-tables) you can just start using the ORM. For example if we wanted to load some data from our `articles` table we would start off creating our `Articles` table class. Create **src/Model/Table/ArticlesTable.php** with the following code: diff --git a/docs/en/orm/associations.md b/docs/en/orm/associations.md index 753a49555b..a8a2ebe4e8 100644 --- a/docs/en/orm/associations.md +++ b/docs/en/orm/associations.md @@ -465,7 +465,7 @@ Possible keys for hasMany association arrays include: records not in the current set will be removed. If the foreign key is a nullable column or if `dependent` is true records will be orphaned. - **finder**: The finder method to use when loading associated records. See the - [Association Finder](#association-finder) section for more information. + [Association Finder](#using-association-finders) section for more information. Once this association has been defined, find operations on the Articles table can contain the Comment records if they exist: @@ -620,7 +620,7 @@ Possible keys for belongsToMany association arrays include: do a wipe and replace to create the links between the passed entities when saving. - **finder**: The finder method to use when loading associated records. See the - [Association Finder](#association-finder) section for more information. + [Association Finder](#using-association-finders) section for more information. Once this association has been defined, find operations on the Articles table can contain the Tag records if they exist: @@ -783,4 +783,4 @@ $users = $role->users; ## Loading Associations -Once you've defined your associations you can [eager load associations](../orm/retrieving-data-and-resultsets#eager-loading-associations) when fetching results. +Once you've defined your associations you can [eager load associations](../orm/retrieving-data-and-resultsets#eager-loading-associations-via-contain) when fetching results. diff --git a/docs/en/orm/behaviors.md b/docs/en/orm/behaviors.md index 803b5507ee..4b1b355656 100644 --- a/docs/en/orm/behaviors.md +++ b/docs/en/orm/behaviors.md @@ -192,7 +192,7 @@ class SluggableBehavior extends Behavior The above code shows a few interesting features of behaviors: - Behaviors can define callback methods by defining methods that follow the - [Table Callbacks](../orm/table-objects#table-callbacks) conventions. + [Table Callbacks](../orm/table-objects#lifecycle-callbacks) conventions. - Behaviors can define a default configuration property. This property is merged with the overrides when a behavior is attached to the table. @@ -217,7 +217,7 @@ Alternatively, you can return false from the callback. This has the same effect Now that we are able to save articles with slug values, we should implement a finder method so we can fetch articles by their slug. Behavior finder -methods, use the same conventions as [Custom Find Methods](../orm/retrieving-data-and-resultsets#custom-find-methods) do. Our +methods, use the same conventions as [Custom Find Methods](../orm/retrieving-data-and-resultsets#custom-finder-methods) do. Our `find('slug')` method would look like: ``` php diff --git a/docs/en/orm/database-basics.md b/docs/en/orm/database-basics.md index e22a36b5f2..38b2ca12ba 100644 --- a/docs/en/orm/database-basics.md +++ b/docs/en/orm/database-basics.md @@ -178,7 +178,7 @@ When using a DSN string you can define any additional parameters/options as query string arguments. By default, all Table objects will use the `default` connection. To -use a non-default connection, see [Configuring Table Connections](../orm/table-objects#configuring-table-connections). +use a non-default connection, see [Configuring Table Connections](../orm/table-objects#configuring-connections). There are a number of keys supported in database configuration. A full list is as follows: @@ -266,7 +266,7 @@ cacheMetadata Either boolean `true`, or a string containing the cache configuration to store meta data in. Having metadata caching disabled by setting it to `false` is not advised and can result in very poor performance. See the -[Database Metadata Cache](#database-metadata-cache) section for more information. +[Database Metadata Cache](#metadata-caching) section for more information. mask Set the permissions on the generated database file. (Only supported by SQLite) @@ -370,7 +370,7 @@ ConnectionManager::setConfig('my_connection', $config); $connection = ConnectionManager::get('my_connection'); ``` -See the [Database Configuration](#database-configuration) for more information on the configuration +See the [Database Configuration](#configuration) for more information on the configuration data used when creating connections. ## Data Types @@ -1191,7 +1191,7 @@ reason for this is identifier quoting has a few drawbacks: If you are using a legacy schema that requires identifier quoting you can enable it using the `quoteIdentifiers` setting in your -[Database Configuration](#database-configuration). You can also enable this feature at runtime: +[Database Configuration](#configuration). You can also enable this feature at runtime: ``` php $connection->getDriver()->enableAutoQuoting(); diff --git a/docs/en/orm/deleting-data.md b/docs/en/orm/deleting-data.md index 1057a23d10..90abcc48ad 100644 --- a/docs/en/orm/deleting-data.md +++ b/docs/en/orm/deleting-data.md @@ -17,7 +17,7 @@ $result = $this->Articles->delete($entity); When deleting entities a few things happen: -1. The [delete rules](../orm/validation#application-rules) will be applied. If the rules +1. The [delete rules](../orm/validation#applying-application-rules) will be applied. If the rules fail, deletion will be prevented. 2. The `Model.beforeDelete` event is triggered. If this event is stopped, the delete will be aborted and the event's result will be returned. diff --git a/docs/en/orm/query-builder.md b/docs/en/orm/query-builder.md index 529e938925..d27aaa58ea 100644 --- a/docs/en/orm/query-builder.md +++ b/docs/en/orm/query-builder.md @@ -15,7 +15,7 @@ The easiest way to create a `SelectQuery` object is to use `find()` from a `Table` object. This method will return an incomplete query ready to be modified. You can also use a table's connection object to access the lower level query builder that does not include ORM features, if necessary. See the -[Database Queries](../orm/database-basics#database-queries) section for more information: +[Database Queries](../orm/database-basics#executing-queries) section for more information: ``` php use Cake\ORM\Locator\LocatorAwareTrait; @@ -156,7 +156,7 @@ foreach ($list as $id => $title) { ``` For more information on how to customize the fields used for populating the list -refer to [Table Find List](../orm/retrieving-data-and-resultsets#table-find-list) section. +refer to [Table Find List](../orm/retrieving-data-and-resultsets#finding-keyvalue-pairs) section. ### ResultSet Is A Collection Object @@ -208,7 +208,7 @@ evaluated, no SQL is ever sent to the database. Once executed, modifying and re-evaluating a query will result in additional SQL being run. Calling the same query without modification multiple times will return same reference. If you want to take a look at what SQL CakePHP is generating, you can turn -database [query logging](../orm/database-basics#database-query-logging) on. +database [query logging](../orm/database-basics#query-logging) on. ## Selecting Data @@ -265,7 +265,7 @@ $query->where(function (QueryExpression $exp, SelectQuery $q) { }); ``` -See the [Advanced Query Conditions](#advanced-query-conditions) section to find out how to construct +See the [Advanced Query Conditions](#advanced-conditions) section to find out how to construct more complex `WHERE` conditions. ### Selecting Specific Fields @@ -914,7 +914,7 @@ After your queries, you may need to do some post-processing. If you need to add a few calculated fields or derived data, you can use the `formatResults()` method. This is a lightweight way to map over the result sets. If you need more control over the process, or want to reduce results you should use -the [Map/Reduce](../orm/retrieving-data-and-resultsets#map-reduce) feature instead. If you were querying a list +the [Map/Reduce](../orm/retrieving-data-and-resultsets#modifying-results-with-mapreduce) feature instead. If you were querying a list of people, you could calculate their age with a result formatter: ``` php diff --git a/docs/en/orm/retrieving-data-and-resultsets.md b/docs/en/orm/retrieving-data-and-resultsets.md index 38d4ed6f0b..7f1a8da168 100644 --- a/docs/en/orm/retrieving-data-and-resultsets.md +++ b/docs/en/orm/retrieving-data-and-resultsets.md @@ -61,7 +61,7 @@ $article = $articles->get($id, cache: 'custom', key: 'mykey'); $article = $articles->get($id, cache: false); ``` -Optionally you can `get()` an entity using [Custom Find Methods](#custom-find-methods). For +Optionally you can `get()` an entity using [Custom Find Methods](#custom-finder-methods). For example you may want to get all translations for an entity. You can achieve that by using the `finder` option: @@ -171,7 +171,7 @@ Any options that are not in this list will be passed to `beforeFind` listeners where they can be used to modify the query object. You can use the `getOptions()` method on a query object to retrieve the options used. While you can pass query objects to your controllers, we recommend that you package -your queries up as [Custom Find Methods](#custom-find-methods) instead. Using custom finder +your queries up as [Custom Find Methods](#custom-finder-methods) instead. Using custom finder methods will let you re-use your queries and make testing easier. By default, queries and result sets will return [Entities](../orm/entities) objects. You @@ -215,7 +215,7 @@ $query = $articles->find('all', conditions: ['Articles.title LIKE' => '%Ovens%'] $number = $query->count(); ``` -See [Query Count](../orm/query-builder#query-count) for additional usage of the `count()` method. +See [Query Count](../orm/query-builder#returning-the-total-count-of-records) for additional usage of the `count()` method. @@ -408,7 +408,7 @@ While all the examples so far have shown finder methods on table classes, finder methods can also be defined on [Behaviors](../orm/behaviors). If you need to modify the results after they have been fetched you should use -a [Map Reduce](#map-reduce) function to modify the results. The map reduce features +a [Map Reduce](#modifying-results-with-mapreduce) function to modify the results. The map reduce features replace the 'afterFind' callback found in previous versions of CakePHP. ## Dynamic Finders @@ -438,7 +438,7 @@ $query = $users->findAllByUsernameOrEmail('joebob', 'joe@example.com'); While you can use either `OR` or `AND` conditions, you cannot combine the two in a single dynamic finder. Other query options like `contain` are also -not supported with dynamic finders. You should use [Custom Find Methods](#custom-find-methods) to +not supported with dynamic finders. You should use [Custom Find Methods](#custom-finder-methods) to encapsulate more complex queries. Lastly, you can also combine dynamic finders with custom finders: @@ -472,12 +472,12 @@ You should use `contain()` when you want to load the primary model, and its associated data. While `contain()` will let you apply additional conditions to the loaded associations, you cannot constrain the primary model based on the associations. For more details on the `contain()`, look at -[Eager Loading Associations](#eager-loading-associations). +[Eager Loading Associations](#eager-loading-associations-via-contain). You should use `matching()` when you want to restrict the primary model based on associations. For example, you want to load all the articles that have a specific tag on them. For more details on the `matching()`, look at -[Filtering By Associated Data](#filtering-by-associated-data). +[Filtering By Associated Data](#filtering-by-associated-data-via-matching-and-joins). If you prefer to use join functions, you can look at [Adding Joins](../orm/query-builder#adding-joins) for more information. @@ -633,7 +633,7 @@ $query = $articles->find()->contain([ In the above example, you'll still get authors even if they don't have a published profile. To only get authors with a published profile use -[matching()](#filtering-by-associated-data). If you have defined custom +[matching()](#filtering-by-associated-data-via-matching-and-joins). If you have defined custom finders in your associations, you can use them inside `contain()`: ``` php @@ -981,7 +981,7 @@ databases that limit the amount of bound parameters per query, such as While CakePHP uses eager loading to fetch your associations, there may be cases where you need to lazy-load associations. You should refer to the -[Lazy Load Associations](../orm/entities#lazy-load-associations) and [Loading Additional Associations](#loading-additional-associations) +[Lazy Load Associations](../orm/entities#lazy-loading-associations) and [Loading Additional Associations](#loading-additional-associations) sections for more information. ## Working with Result Sets @@ -1050,7 +1050,7 @@ $authorList = $results->combine('id', 'author.name'); ``` The [Collections](../core-libraries/collections) chapter has more detail on what can be -done with result sets using the collections features. The [Format Results](../orm/query-builder#format-results) +done with result sets using the collections features. The [Format Results](../orm/query-builder#adding-calculated-fields) section show how you can add calculated fields, or replace the result set. > [!WARNING] @@ -1349,7 +1349,7 @@ $query->where(['created >=' => new DateTime('1 day ago')]); ``` This is particularly useful for building custom finder methods as described in the -[Custom Find Methods](#custom-find-methods) section: +[Custom Find Methods](#custom-finder-methods) section: ``` php public function findPublished(SelectQuery $query): SelectQuery diff --git a/docs/en/orm/saving-data.md b/docs/en/orm/saving-data.md index 031f96f76c..980d286b52 100644 --- a/docs/en/orm/saving-data.md +++ b/docs/en/orm/saving-data.md @@ -141,7 +141,7 @@ $entity = $articles->newEntity($this->request->getData()); > [!NOTE] > If you are using newEntity() and the resulting entities are missing some or > all the data they were passed, double check that the columns you want to -> set are listed in the `$_accessible` property of your entity. See [Entities Mass Assignment](../orm/entities#entities-mass-assignment). +> set are listed in the `$_accessible` property of your entity. See [Entities Mass Assignment](../orm/entities#mass-assignment). The request data should follow the structure of your entities. For example if you have an article, which belonged to a user, and had many comments, your @@ -163,7 +163,7 @@ $data = [ ``` By default, the `newEntity()` method validates the data that gets passed to -it, as explained in the [Validating Request Data](../orm/validation#validating-request-data) section. If you wish to +it, as explained in the [Validating Request Data](../orm/validation#validating-data) section. If you wish to bypass data validation pass the `'validate' => false` option: ``` php @@ -226,7 +226,7 @@ $entity = $articles->newEntity($this->request->getData(), [ ]); ``` -The [Using Different Validators Per Association](../orm/validation#using-different-validators-per-association) chapter has more +The [Using Different Validators Per Association](../orm/validation#using-a-different-validation-set-for-associations) chapter has more information on how to use different validators for associated marshalling. The following diagram gives an overview of what happens inside the @@ -421,7 +421,7 @@ concerned entity. > If you are using newEntity() and the resulting entities are missing some or > all the data they were passed, double check that the columns you want to > set are listed in the `$_accessible` property of your entity. See -> [Entities Mass Assignment](../orm/entities#entities-mass-assignment). +> [Entities Mass Assignment](../orm/entities#mass-assignment). ### Merging Request Data Into Entities @@ -444,7 +444,7 @@ $articles->save($article); Similar to `newEntity()`, the `patchEntity` method will validate the data before it is copied to the entity. The mechanism is explained in the -[Validating Request Data](../orm/validation#validating-request-data) section. If you wish to disable validation while +[Validating Request Data](../orm/validation#validating-data) section. If you wish to disable validation while patching an entity, pass the `validate` option as follows: ``` php @@ -737,7 +737,7 @@ $this->save($entity); There are two ways of protecting you against this problem. The first one is by setting the default columns that can be safely set from a request using the -[Entities Mass Assignment](../orm/entities#entities-mass-assignment) feature in the entities. +[Entities Mass Assignment](../orm/entities#mass-assignment) feature in the entities. The second way is by using the `fields` option when creating or merging data into an entity: @@ -827,7 +827,7 @@ $article->title = 'My new title'; $articles->save($article); ``` -When saving, CakePHP will [apply your rules](../orm/validation#application-rules), and wrap +When saving, CakePHP will [apply your rules](../orm/validation#applying-application-rules), and wrap the save operation in a database transaction. It will also only update properties that have changed. The above `save()` call would generate SQL like: @@ -867,7 +867,7 @@ The following diagram illustrates the above process: Flow diagram showing the save process. -See the [Application Rules](../orm/validation#application-rules) section for more information on creating and +See the [Application Rules](../orm/validation#applying-application-rules) section for more information on creating and using rules. > [!WARNING] @@ -1011,7 +1011,7 @@ Any existing records that do not match the records provided will be deleted from the database. Only provided records will remain (or be inserted). By default, the `append` saving strategy is used. -See [Has Many Associations](../orm/associations#has-many-associations) for details on defining the `saveStrategy`. +See [Has Many Associations](../orm/associations#hasmany-associations) for details on defining the `saveStrategy`. Whenever you add new records to an existing association you should always mark the association property as 'dirty'. This lets the ORM know that the association @@ -1060,7 +1060,7 @@ When converting request data into entities, the `newEntity()` and `newEntities()` methods will handle both arrays of properties, as well as a list of ids at the `_ids` key. Using the `_ids` key makes it possible to building a select box or checkbox based form controls for belongs to many associations. See -the [Converting Request Data](#converting-request-data) section for more information. +the [Converting Request Data](#converting-request-data-into-entities) section for more information. When saving belongsToMany associations, you have the choice between two saving strategies: @@ -1076,7 +1076,7 @@ the junction table. If there are existing link in the database to some of the entities intended to be saved, those links will be updated, not deleted and then re-saved. -See [Belongs To Many Associations](../orm/associations#belongs-to-many-associations) for details on defining the `saveStrategy`. +See [Belongs To Many Associations](../orm/associations#belongstomany-associations) for details on defining the `saveStrategy`. By default, the `replace` strategy is used. Whenever you add new records into an existing association you should always mark the association property as @@ -1177,7 +1177,7 @@ $student = $this->Students->newEntity($data, [ ]); ``` -See the [Associated Form Inputs](../views/helpers/form#associated-form-inputs) documentation for how to build inputs with +See the [Associated Form Inputs](../views/helpers/form#creating-inputs-for-associated-data) documentation for how to build inputs with `FormHelper` correctly. As of 5.2.0, the `_joinData` property can be renamed with `setJunctionProperty()`: @@ -1202,7 +1202,7 @@ complex types such as arrays or objects and serialize this data into simpler types that can be saved in the database. This functionality is achieved by using the custom types system. See the -[Adding Custom Database Types](../orm/database-basics#adding-custom-database-types) section to find out how to build custom +[Adding Custom Database Types](../orm/database-basics#adding-custom-types) section to find out how to build custom column Types: ``` php @@ -1422,4 +1422,4 @@ function publishAllUnpublished() } ``` -Also see: [Query Builder Updating Data](../orm/query-builder#query-builder-updating-data). +Also see: [Query Builder Updating Data](../orm/query-builder#updating-data). diff --git a/docs/en/orm/schema-system.md b/docs/en/orm/schema-system.md index 8684a88f09..d1b0a649b1 100644 --- a/docs/en/orm/schema-system.md +++ b/docs/en/orm/schema-system.md @@ -8,7 +8,7 @@ The main pieces of the schema system are `Cake\Database\Schema\Collection` and `Cake\Database\Schema\TableSchema`. These classes give you access to database-wide and individual Table object features respectively. -The primary use of the schema system is for [Test Fixtures](../development/testing#test-fixtures). However, it +The primary use of the schema system is for [Test Fixtures](../development/testing#fixtures). However, it can also be used in your application if required. ## Schema\TableSchema Objects diff --git a/docs/en/orm/table-objects.md b/docs/en/orm/table-objects.md index fb4bd83a6f..7f6a873b27 100644 --- a/docs/en/orm/table-objects.md +++ b/docs/en/orm/table-objects.md @@ -104,7 +104,7 @@ $articles = $this->fetchTable('Articles'); `TableLocator` provides the various dependencies for constructing a table, and maintains a registry of all the constructed table instances making it easier to build relations and configure the ORM. See -[Table Locator Usage](#table-locator-usage) for more information. +[Table Locator Usage](#using-the-tablelocator) for more information. If your table class is in a plugin, be sure to use the correct name for your table class. Failing to do so can result in validation rules, or callbacks not @@ -217,7 +217,7 @@ This will call the `initializeEvent` when any `Table` class is constructed. `method` Cake\\ORM\\Table::**beforeMarshal**(EventInterface $event, ArrayObject $data, ArrayObject $options): void The `Model.beforeMarshal` event is fired before request data is converted -into entities. See the [Before Marshal](../orm/saving-data#before-marshal) documentation for more information. +into entities. See the [Before Marshal](../orm/saving-data#modifying-request-data-before-building-entities) documentation for more information. ### afterMarshal @@ -262,7 +262,7 @@ fields, conditions, joins or result formatters. These options/features will be copied onto the root query. In previous versions of CakePHP there was an `afterFind` callback, this has -been replaced with the [Map Reduce](../orm/retrieving-data-and-resultsets#map-reduce) features and entity constructors. +been replaced with the [Map Reduce](../orm/retrieving-data-and-resultsets#modifying-results-with-mapreduce) features and entity constructors. ### buildValidator diff --git a/docs/en/plugins.md b/docs/en/plugins.md index 90c8cdd675..27983a5053 100644 --- a/docs/en/plugins.md +++ b/docs/en/plugins.md @@ -474,7 +474,7 @@ also connect routes that use the following pattern: /{prefix}/{plugin}/{controller}/{action} ``` -See the section on [Plugin Configuration](#plugin-configuration) for information on how to load +See the section on [Plugin Configuration](#plugin-hook-configuration) for information on how to load plugin specific route files. ## Plugin Models @@ -608,7 +608,7 @@ echo $this->element('Contacts.sidebar/helpbox'); ``` > [!NOTE] -> See [View Elements](views#view-elements) for more information on rendering elements. +> See [View Elements](views#elements) for more information on rendering elements. ### Overriding Plugin Templates from Inside Your Application @@ -660,7 +660,7 @@ You may put any type of file in any directory, just like a regular webroot. > [!WARNING] > Handling static assets (such as images, JavaScript and CSS files) -> through the Dispatcher is very inefficient. See [Symlink Assets](deployment#symlink-assets) +> through the Dispatcher is very inefficient. See [Symlink Assets](deployment#moving-files) > for more information. ### Linking to Assets in Plugins @@ -681,7 +681,7 @@ echo $this->Html->image('ContactManager.logo'); Plugin assets are served using the `AssetMiddleware` middleware by default. This is only recommended for development. In production you should -[symlink plugin assets](deployment#symlink-assets) to improve performance. +[symlink plugin assets](deployment#moving-files) to improve performance. If you are not using the helpers, you can prepend /plugin-name/ to the beginning of the URL for an asset within that plugin to serve it. Linking to diff --git a/docs/en/topics.md b/docs/en/topics.md index 3d1b152554..41349b352c 100644 --- a/docs/en/topics.md +++ b/docs/en/topics.md @@ -24,7 +24,7 @@ Introduction to all the key parts of CakePHP: - [Sessions](development/sessions) - [REST](development/rest) - [Pagination](controllers/pagination) -- [Csrf Middleware](security/csrf#csrf-middleware) +- [Csrf Middleware](security/csrf#cross-site-request-forgery-csrf-middleware) - [Mailer](core-libraries/email) - [Form](views/helpers/form) - [Html](views/helpers/html) diff --git a/docs/en/tutorials-and-examples/cms/articles-controller.md b/docs/en/tutorials-and-examples/cms/articles-controller.md index a288000d20..8087cd708a 100644 --- a/docs/en/tutorials-and-examples/cms/articles-controller.md +++ b/docs/en/tutorials-and-examples/cms/articles-controller.md @@ -311,7 +311,7 @@ the following line: If we were to save an Article right now, saving would fail as we are not creating a slug attribute, and the column is `NOT NULL`. Slug values are typically a URL-safe version of an article's title. We can use the -[beforeSave() callback](../../orm/table-objects#table-callbacks) of the ORM to populate our slug: +[beforeSave() callback](../../orm/table-objects#lifecycle-callbacks) of the ORM to populate our slug: ``` php {3,7-9,13} @@ -142,7 +142,7 @@ Any variables you set in your controller with `set()` will be available in both the view and the layout your action renders. In addition, any set variables will also be available in any element. If you need to pass additional variables from the view to the layout you can either call `set()` in the view template, -or use [View Blocks](#view-blocks). +or use [View Blocks](#using-view-blocks). You should remember to **always** escape any user data before outputting it as CakePHP does not automatically escape output. You can escape user content with @@ -159,7 +159,7 @@ the `h()` function: Views have a `set()` method that is analogous to the `set()` found in Controller objects. Using set() from your view file will add the variables to the layout and elements that will be rendered later. See -[Setting View Variables](controllers#setting-view_variables) for more information on using `set()`. +[Setting View Variables](controllers#setting-view-variables) for more information on using `set()`. In your view file you can do: @@ -173,7 +173,7 @@ contain the value 'posts'. ### Extending Views View extending allows you to wrap one view in another. Combining this with -[view blocks](#view-blocks) gives you a powerful way to keep your views +[view blocks](#using-view-blocks) gives you a powerful way to keep your views `DRY`. For example, your application has a sidebar that needs to change depending on the specific view being rendered. By extending a common view file, you can avoid repeating the common markup for your sidebar, and only define the @@ -727,7 +727,7 @@ insert logic around the rendering life-cycle: - `View.afterLayout` You can attach application [event listeners](core-libraries/events) to -these events or use [Helper Callbacks](views/helpers#helper-api). +these events or use [Helper Callbacks](views/helpers#helper-class). ## Creating Your Own View Classes diff --git a/docs/en/views/helpers.md b/docs/en/views/helpers.md index a476139a9d..beb4a0d829 100644 --- a/docs/en/views/helpers.md +++ b/docs/en/views/helpers.md @@ -230,7 +230,7 @@ supports the registry API used elsewhere in CakePHP. ## Callback Methods Helpers feature several callbacks that allow you to augment the view rendering -process. See the [Helper Api](#helper-api) and the +process. See the [Helper Api](#helper-class) and the [Events System](../core-libraries/events) documentation for more information. ## Creating Helpers diff --git a/docs/en/views/helpers/breadcrumbs.md b/docs/en/views/helpers/breadcrumbs.md index 86a8ea3f45..b40108cbab 100644 --- a/docs/en/views/helpers/breadcrumbs.md +++ b/docs/en/views/helpers/breadcrumbs.md @@ -14,7 +14,7 @@ arguments: - **url** A string or an array of parameters that will be given to the [Url](../../views/helpers/url) - **options** An array of attributes for the `item` and `itemWithoutLink` - templates. See the section about [defining attributes for the item](#defining_attributes_item) for more information. + templates. See the section about [defining attributes for the item](#defining-attributes-for-the-item) for more information. In addition to adding to the end of the trail, you can do a variety of operations: diff --git a/docs/en/views/helpers/form.md b/docs/en/views/helpers/form.md index 0bd7ce794c..3486770402 100644 --- a/docs/en/views/helpers/form.md +++ b/docs/en/views/helpers/form.md @@ -354,7 +354,7 @@ return an object. If there is no match return null. - `$fieldName` - A field name in the form `'Modelname.fieldname'`. - `$options` - An optional array that can include both - [Control Specific Options](#control-specific-options), and options of the other methods (which + [Control Specific Options](#common-options-for-specific-controls), and options of the other methods (which `control()` employs internally to generate various HTML elements) as well as any valid HTML attributes. @@ -503,7 +503,7 @@ echo $this->Form->control('birth_date', [ ]); ``` -Besides the specific [Control Specific Options](#control-specific-options), +Besides the specific [Control Specific Options](#common-options-for-specific-controls), you also can specify any option accepted by corresponding specific method for the chosen (or inferred by CakePHP) control type and any HTML attribute (for instance `onfocus`). @@ -567,7 +567,7 @@ Any dots in your field names will be converted into nested request data. For example, if you created a field with a name `0.comments.body` you would get a name attribute that looks like `0[comments][body]`. This convention matches the conventions you use with the ORM. Details for the various association types -can be found in the [Associated Form Inputs](#associated-form-inputs) section. +can be found in the [Associated Form Inputs](#creating-inputs-for-associated-data) section. When creating datetime related controls, FormHelper will append a field-suffix. You may notice additional fields named `year`, `month`, `day`, `hour`, @@ -586,7 +586,7 @@ as well as HTML attributes. This subsection will cover the options specific to - `$options['type']` - A string that specifies the widget type to be generated. In addition to the field types found in the - [Automagic Form Elements](#automagic-form-elements), you can also create `'file'`, + [Automagic Form Elements](#field-naming-conventions), you can also create `'file'`, `'password'`, and any other type supported by HTML5. By specifying a `'type'` you will force the type of the generated control, overriding model introspection. Defaults to `null`. @@ -612,7 +612,7 @@ as well as HTML attributes. This subsection will cover the options specific to ``` - `$options['label']` - Either a string caption or an array of - [options for the label](#create-label). You can set this key to the + [options for the label](#creating-labels). You can set this key to the string you would like to be displayed within the label that usually accompanies the `input` HTML element. Defaults to `null`. @@ -680,7 +680,7 @@ as well as HTML attributes. This subsection will cover the options specific to - `$options['options']` - You can provide in here an array containing the elements to be generated for widgets such as `radio` or `select`, which require an array of items as an argument (see - [Create Radio Button](#create-radio-button) and [Create Select Picker](#create-select-picker) for more details). + [Create Radio Button](#creating-radio-buttons) and [Create Select Picker](#creating-select-pickers) for more details). Defaults to `null`. - `$options['error']` - Using this key allows you to override the default @@ -726,7 +726,7 @@ as well as HTML attributes. This subsection will cover the options specific to On the other hand you can set this to `true` for any control type to force the generated input element inside the label. If you change this for radio buttons - then you might want to also modify the default [radioWrapper](#create-radio-button) + then you might want to also modify the default [radioWrapper](#creating-radio-buttons) template to add a wrapping `div`. Depending on the generated control type it defaults to `true` or `false`. @@ -828,7 +828,7 @@ however, this parameter is used primarily to specify HTML tag attributes - `$name` - A field name in the form `'Modelname.fieldname'`. - `$options` - An optional array including any of the - [General Control Options](#general-control-options) as well as any valid HTML attributes. + [General Control Options](#common-options-for-specific-controls) as well as any valid HTML attributes. Creates a simple `input` HTML element of `text` type. @@ -850,7 +850,7 @@ Will output: - `$fieldName` - A field name in the form `'Modelname.fieldname'`. - `$options` - An optional array including any of the - [General Control Options](#general-control-options) as well as any valid HTML attributes. + [General Control Options](#common-options-for-specific-controls) as well as any valid HTML attributes. Creates a simple `input` element of `password` type. @@ -872,7 +872,7 @@ Will output: - `$fieldName` - A field name in the form `'Modelname.fieldname'`. - `$options` - An optional array including any of the - [General Control Options](#general-control-options) as well as any valid HTML attributes. + [General Control Options](#common-options-for-specific-controls) as well as any valid HTML attributes. Creates a hidden form input. @@ -894,7 +894,7 @@ Will output: - `$fieldName` - A field name in the form `'Modelname.fieldname'`. - `$options` - An optional array including any of the - [General Control Options](#general-control-options), of the specific textarea options (see below) + [General Control Options](#common-options-for-specific-controls), of the specific textarea options (see below) as well as any valid HTML attributes. Creates a textarea control field. The default widget template used is: @@ -930,7 +930,7 @@ Example: **Options for Textarea** -In addition to the [General Control Options](#general-control-options), `textarea()` supports a +In addition to the [General Control Options](#common-options-for-specific-controls), `textarea()` supports a couple of specific options: - `'escape'` - Determines whether or not the contents of the textarea should @@ -1152,7 +1152,7 @@ $options = $examples->map(function ($value, $key) { - `$fieldName` - A field name in the form `'Modelname.fieldname'`. - `$options` - An optional array including any of the - [General Control Options](#general-control-options), or of the [Checkbox Radio Select Options](#checkbox-radio-select-options) + [General Control Options](#common-options-for-specific-controls), or of the [Checkbox Radio Select Options](#options-for-select-checkbox-and-radio-controls) above, of the checkbox-specific options (see below), as well as any valid HTML attributes. @@ -1229,7 +1229,7 @@ Will output: the hidden input (if `'hiddenField'` is `true`) or no element at all (if `'hiddenField'` is `false`). - `$attributes` - An optional array including any of the - [General Control Options](#general-control-options), or of the [Checkbox Radio Select Options](#checkbox-radio-select-options), + [General Control Options](#common-options-for-specific-controls), or of the [Checkbox Radio Select Options](#options-for-select-checkbox-and-radio-controls), of the radio button specific attributes (see below), as well as any valid HTML attributes. @@ -1355,7 +1355,7 @@ If the `label` key is used on an option, the attributes in picker. When this array is missing, the method will generate only the empty `select` HTML element without any `option` elements inside it. - `$attributes` - An optional array including any of the - [General Control Options](#general-control-options), or of the [Checkbox Radio Select Options](#checkbox-radio-select-options), + [General Control Options](#common-options-for-specific-controls), or of the [Checkbox Radio Select Options](#options-for-select-checkbox-and-radio-controls), or of the select-specific attributes (see below), as well as any valid HTML attributes. @@ -1633,7 +1633,7 @@ certain behaviors of the `select()` method. - `$fieldName` - A field name in the form `'Modelname.fieldname'`. - `$options` - An optional array including any of the - [General Control Options](#general-control-options) as well as any valid HTML attributes. + [General Control Options](#common-options-for-specific-controls) as well as any valid HTML attributes. Creates a file upload field in the form. The widget template used by default is: @@ -1709,7 +1709,7 @@ $fileobject->moveTo($destination); - `$fieldName` - A string that will be used as a prefix for the HTML `name` attribute of the `select` elements. - `$options` - An optional array including any of the - [General Control Options](#general-control-options) as well as any valid HTML attributes. + [General Control Options](#common-options-for-specific-controls) as well as any valid HTML attributes. This method will generate an input tag with type "datetime-local". @@ -1746,7 +1746,7 @@ Output: - `$fieldName` - A field name that will be used as a prefix for the HTML `name` attribute of the `select` elements. - `$options` - An optional array including any of the - [General Control Options](#general-control-options) as well as any valid HTML attributes. + [General Control Options](#common-options-for-specific-controls) as well as any valid HTML attributes. This method will generate an input tag with type "date". @@ -1769,7 +1769,7 @@ Output: - `$fieldName` - A field name that will be used as a prefix for the HTML `name` attribute of the `select` elements. - `$options` - An optional array including any of the - [General Control Options](#general-control-options) as well as any valid HTML attributes. + [General Control Options](#common-options-for-specific-controls) as well as any valid HTML attributes. This method will generate an input tag with type "time". @@ -1792,7 +1792,7 @@ Output: - `$fieldName` - A field name that will be used as a prefix for the HTML `name` attribute of the `select` element. - `$options` - An optional array including any of the - [General Control Options](#general-control-options) as well as any valid HTML attributes. + [General Control Options](#common-options-for-specific-controls) as well as any valid HTML attributes. This method will generate an input tag with type "month". @@ -1815,7 +1815,7 @@ Will output: - `$fieldName` - A field name that will be used as a prefix for the HTML `name` attribute of the `select` element. - `$options` - An optional array including any of the - [General Control Options](#general-control-options) as well as any valid HTML attributes. + [General Control Options](#common-options-for-specific-controls) as well as any valid HTML attributes. Other valid options are: - `min`: The lowest value to use in the year select picker. - `max`: The maximum value to use in the year select picker. @@ -1865,7 +1865,7 @@ If it was 2009, you would get the following: - `$fieldName` - A field name in the form `'Modelname.fieldname'`. - `$text` - An optional string providing the label caption text. - `$options` - Optional. Array containing any of the - [General Control Options](#general-control-options) as well as any valid HTML attributes. + [General Control Options](#common-options-for-specific-controls) as well as any valid HTML attributes. Creates a `label` element. The argument `$fieldName` is used for generating the HTML `for` attribute of the element; if `$text` is undefined, @@ -2024,7 +2024,7 @@ You could then use JavaScript to set the `onvalid` and `oninvalid` events as you - `$caption` - An optional string providing the button's text caption or a path to an image. Defaults to `'Submit'`. - `$options` - An optional array including any of the - [General Control Options](#general-control-options), or of the specific submit options (see below) + [General Control Options](#common-options-for-specific-controls), or of the specific submit options (see below) as well as any valid HTML attributes. Creates an `input` element of `submit` type, with `$caption` as value. @@ -2084,7 +2084,7 @@ more complex button content you should use `button()`. - `$title` - Mandatory string providing the button's text caption. - `$options` - An optional array including any of the - [General Control Options](#general-control-options), or of the specific button options (see below) + [General Control Options](#common-options-for-specific-controls), or of the specific button options (see below) as well as any valid HTML attributes. Creates an HTML button with the specified title and a default type @@ -2190,7 +2190,7 @@ Will output: not HTML encoded. - `$url` - The URL of the form provided as a string or as array. - `$options` - An optional array including any of the - [General Control Options](#general-control-options), or of the specific options (see below) as well + [General Control Options](#common-options-for-specific-controls), or of the specific options (see below) as well as any valid HTML attributes. Creates a `