Drupal API
Displaying 1 - 4 of 4How to Redirect A Page
Redirect needs were always important when developing with C, we remember how we use the Goto() command, and with Drupal 7 we had the Drupalgoto() command, but these options were deprecated within Drupal9 which become a fully object-oriented and object-derived system.
so how do we create Redirection commands?
There are a few options to do so, I will try to overview them all.
entityQuery simple and standard like a dynamic query
entityQuery allows developers to query Drupal entities and fields in a SQL-like way.
A Drupal site's tables and fields are never a 1-to-1 match for the site's entities and fields - entityQuery allows us to query the database as if they were 1-to-1.
Much like you could write some SQL that returns all rows of table1 where field1 is 14, using entityQuery you can ask Drupal to return all entities of type "basic page" where the value of field_some_field is 14.