Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么需要使用substr php函数转义:Slim index.php路由参数中的冒号_Php_Angularjs_Rest_Slim - Fatal编程技术网

为什么需要使用substr php函数转义:Slim index.php路由参数中的冒号

为什么需要使用substr php函数转义:Slim index.php路由参数中的冒号,php,angularjs,rest,slim,Php,Angularjs,Rest,Slim,当我使用php函数substr($id,1)转义参数冒号(:id)时,我的细长路径(index.php)只将数据返回到angular(app.js) 当我注释substr函数时,返回值为false,因为冒号在参数id之前 为什么会这样 app.js(角度) index.php(slim) 我在html href上发现了问题: 以前 <a class="text-link" href="#/product/:{{vinho.id}}" ><h4>{{vinho.userna

当我使用php函数substr($id,1)转义参数冒号(:id)时,我的细长路径(index.php)只将数据返回到angular(app.js)

当我注释substr函数时,返回值为false,因为冒号在参数id之前

为什么会这样

app.js(角度)

index.php(slim)


我在html href上发现了问题:

以前

<a class="text-link" href="#/product/:{{vinho.id}}" ><h4>{{vinho.username}}</h4></a>

在我使用带冒号的ng href之后

<a class="text-link" ng-href="#/product/{{vinho.id}}" ><h4>{{vinho.username}}</h4></a>

<a class="text-link" href="#/product/:{{vinho.id}}" ><h4>{{vinho.username}}</h4></a>
<a class="text-link" ng-href="#/product/{{vinho.id}}" ><h4>{{vinho.username}}</h4></a>