mirror of
https://github.com/getgrav/grav.git
synced 2026-03-02 02:21:29 +01:00
Twig url() takes now third parameter (true) to return URL on non-existing file instead of returning false
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
* Added `PermissionsRegisterEvent` which triggers when `$grav['permissions']` is being accessed the first time
|
||||
1. [](#improved)
|
||||
* Blueprint validation: Added `validate: value_type: bool|int|float|string|trim` to `array` to filter all the values inside the array
|
||||
* Twig `url()` takes now third parameter (`true`) to return URL on non-existing file instead of returning false
|
||||
1. [](#bugfix)
|
||||
* Grav 1.7: Fixed blueprint loading issues [#2782](https://github.com/getgrav/grav/issues/2782)
|
||||
* Fixed PHP 7.4 compatibility issue with `Stream`
|
||||
|
||||
@@ -848,12 +848,12 @@ class TwigExtension extends AbstractExtension implements GlobalsInterface
|
||||
*
|
||||
* @param string $input Resource to be located.
|
||||
* @param bool $domain True to include domain name.
|
||||
*
|
||||
* @return string|null Returns url to the resource or null if resource was not found.
|
||||
* @param bool $failGracefully If true, return URL even if the file does not exist.
|
||||
* @return string|false Returns url to the resource or null if resource was not found.
|
||||
*/
|
||||
public function urlFunc($input, $domain = false)
|
||||
public function urlFunc($input, $domain = false, $failGracefully = false)
|
||||
{
|
||||
return Utils::url($input, $domain);
|
||||
return Utils::url($input, $domain, $failGracefully);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ abstract class Utils
|
||||
* @param string|object $input
|
||||
* @param bool $domain
|
||||
* @param bool $fail_gracefully
|
||||
* @return bool|null|string
|
||||
* @return string|false
|
||||
*/
|
||||
public static function url($input, $domain = false, $fail_gracefully = false)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user