English 中文(简体)
地名中的惯常例外(“/league/:id_league/ members/new”路线有一些缺失的强制性参数(:id_league”)
原标题:Routing exception in symfony ("The "/league/:id_league/members/new" route has some missing mandatory parameters (:id_league)")

Hi everyone english

I have a problem with the routing: in the members page to a league ("/league/ID_LEAGUE/members"), the link for the action "new" becomes "/league/members/news" (the league s id disappears). I would like to keep that ID and create a url like "/league/ID_LEAGUE/members/ new" so you can select in selectbox the current league...

我不想这样做:

members:
    class: sfDoctrineRouteCollection
    options: { model: Members, module: members, column: id_member, with_wildcard_routes: true }

# List to league (id) s members
memebers_league:
    url: /league/:id/members
    options: { model: Members, type: list }
    param: { module: members, action: index }

# New member
members_new:
    url: /league/:id_league/members/new
    class: sfDoctrineRoute
    options: { model: Members, type: object }
    param:   { module: members, action: new }

有了这些路线,我就有了这一例外:“/league/:id_league/ members/new”路线,有一些缺失的强制性参数(即:id_league)”(在“成员”中,“getIdLeague()”)。

谁能帮助我?

预先感谢

问题回答

增加违约值:

param:   { module: members, action: new, id_league: 0}




相关问题
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 ...

热门标签