Compare commits
	
		
			No commits in common. "10632e9f673fbc4e47aa0ca6379f8172ef3bca3d" and "cfc2f5d9af167165fe37285f8e0203c73b531e8b" have entirely different histories.
		
	
	
		
			10632e9f67
			...
			cfc2f5d9af
		
	
		
@ -39,12 +39,12 @@ class LanguageExtension implements Extension {
 | 
			
		||||
        $context->pushFunction("lang", [ $this, 'absoluteLang' ]);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    public function relativeLang(string $key, array $variables = []) #: array|string
 | 
			
		||||
    public function relativeLang(string $key, array $variables = []) : string
 | 
			
		||||
    {
 | 
			
		||||
        return $this->languageHandler->languageFromKey("{$this->currentLanguage}.{$key}", $variables);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function absoluteLang(string $key, array $variables = []) #: array|string
 | 
			
		||||
    public function absoluteLang(string $key, array $variables = []) : string
 | 
			
		||||
    {
 | 
			
		||||
        return $this->languageHandler->languageFromKey($key, $variables);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -4,5 +4,5 @@ namespace Picea\Extension;
 | 
			
		||||
 | 
			
		||||
interface LanguageHandler 
 | 
			
		||||
{    
 | 
			
		||||
    public function languageFromKey(string $key, array $variables = []); #: array|string;
 | 
			
		||||
    public function languageFromKey(string $key, array $variables = []) : string;   
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -173,14 +173,23 @@ class UrlExtension implements Extension {
 | 
			
		||||
                    $value = $arguments[ $item[1] ];
 | 
			
		||||
                }
 | 
			
		||||
                else if ( isset($default) ) {
 | 
			
		||||
                    $value = ""; # $default;
 | 
			
		||||
                    $value = $default;
 | 
			
		||||
                }
 | 
			
		||||
                else {
 | 
			
		||||
                    $variable = $item[1];
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                $search[ $item[0] ] = $value;
 | 
			
		||||
#                if ( array_key_exists($variable, $arguments) ) {
 | 
			
		||||
#                    $value = $arguments[ $item[1] ];
 | 
			
		||||
#                }
 | 
			
		||||
#                else if ( isset($default) ) {
 | 
			
		||||
#                    $value = $default;
 | 
			
		||||
#                }
 | 
			
		||||
#                else {
 | 
			
		||||
#                    throw new \InvalidArgumentException("Argument `$variable` is missing within required route parameter(s)");                    
 | 
			
		||||
#                }
 | 
			
		||||
 | 
			
		||||
                $search[ $item[0] ] = $value;
 | 
			
		||||
                unset($arguments[ $item[1] ]);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user