Bonjour,
Voic mon code.
namespace App\View\Helper;
use Cake\View\Helper;
class MyUrlHelper extends Helper\UrlHelper
{
public function build($url = null, $full = false) {
if(is_array($url)){
if(!isset($url['language']) && isset($this->request->params['language'])) {
if($url == '#')
{
$url = array();
}
$url['language'] = $this->request->params['language'];
}
}
return parent::build($url, $full);
}
}