phphtmlcakephpweb-development-serverhtml-entities

Html entities converrsion in onchange function in php


When I try to pass variables to check_holiday_dates_on_application I want them to be surrounded by ' in the site html. This is what my code looks like:

'onchange' => 'return check_holiday_dates_on_application(\'' . $this->Url->webroot('') . '\', \'' . $token . '\',' . json_encode($abstractionDayList) . '\');']); ?>

What I want is

onchange="return check_holiday_dates_on_application('webroot',token','abstractionDayList');"

What I get is

onchange="return check_holiday_dates_on_application('webroot', 'token',abstractionDayList');"

Can anyone help me out?


Solution

  • Worked with setting the parameter

    'escape' => false
    

    Thanks for the answer @Greg Schmidt in the comments.