English 中文(简体)
B. 改变CakePHP中标明参数的路线
原标题:Changing the routes for named parameters in CakePHP
  • 时间:2012-05-04 08:53:39
  •  标签:
  • php
  • cakephp

我有以下两条路线,使导游/密码/密码>。 • 显示最近对我员额控制员指数方法的过滤器第1页,并允许像:/posts/recent/page:2。 采用下一路线的*。 你可以看到,我把第1页放在第1页,这样我就不必重复第1页。

Router::connect( /posts/recent , array( controller => posts , action => index , filter => recent ,  page  => 1), array( pass =>array( filter )));


Router::connect( /posts/recent/* , array(
   controller  =>  posts ,  action  =>  index ,  filter => recent ), array(
     named  =>array( page  =>  [d]+ ),
      pass =>array( filter )
  )
);

但 我要这样说,点名的准成员这样做:

但我如何这样做?

我看一看docs,但似乎看不出做什么。

还有,可以将指定参数移出,以取代问题说明?

如果有的话,使用CakePHP 2.1。

问题回答




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

热门标签