Problem With Ajax Call

I have the following code…




$mun_url = Yii::$app->urlManager->createUrl('/localizacion/default/ajax-municipios');



then I execute this ajax function




$.ajax({

        type: "GET",

        url: "{$mun_url}",

        data: { estado: 21 },

        success: function(datos){

            alert( "Se guardaron los datos: " + datos);

        },

        error: function(){

            alert("error");

        }

    });



:::: controller




namespace app\modules\localizacion\controllers;


use yii\web\Controller;

use yii\helpers\ArrayHelper;

use app\models\LocalizacionMunicipio;




class DefaultController extends Controller

{


    public function actionAjaxMunicipios($estado)

    {   

        echo "<p>hola</p>";

        exit();

    }

}



and the browser show me a 500 Internal Error (If I type the url in the browser every works as expected, plz help me

Check runtime/app.log for details of the error.


$mnu_url

needs to be encoded before passed in Javascript so try


$mnu_url=Json::encode($mnu_url);

.

maybe you should check permission of this file : runtime/debug/index.data