English 中文(简体)
为什么不工作
原标题:why does url_for ( module/action/id/3 ) not work
  • 时间:2011-07-06 23:08:29
  •  标签:
  • php
  • symfony1

I m 采用url_for(模块/myaction/id/3 ),在经过修改的行政发电机屏幕上建立联系。 每当我采取新行动并试图将其与<代码>url_for(模块/action/id/3 )时,我就得<代码>/module/myaction/action。

When I try url_for( module/3/myaction ) i get the same result.

However when I use url_for( module/myaction?id=3 ) I get the expected result: module/3/myaction

I have only the default admin generated routing rules in my routing file.

Is this behaviour expected?

最佳回答

Yes it is expected... In the sense that is expected that passing in an external URL will produce unexpected results.

页: 1 a 内部《国际仲裁裁决汇编》以下列形式撰写:

@route_name?param= Value

<代码>moduleName/actionName?param= Value

您也可以通过使用路线名称和物体(如果是物体路线或路线收集),在这些情况下代表内部航程的理由:

url_for(路程_name , params);

在<条码>第指路标(通常为理论或反悔模型)或一系列参数。

内部 之后,URIs被路由系统转换为外部尿。 你们正在取得不正确的结果,因为你正在试图通过外部的URL,因为如果你知道这l,就没有理由走下去了:

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签