Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下网址
example.com/show.php?xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
我想将它重定向到控制器测试操作 redirs。我如何通过 cake php 路由或通过 htaccess 来实现这一点。
您可以在app/Config/routes.php文件中为此输入一个简单的路由:
app/Config/routes.php
Router::connect('/show.php', array('controller' => 'tests', 'action' => 'redirs'));
如果需要,您可以在您的操作中处理查询字符串中传递的任何内容。
我有一个应用程序,其中有一个用于表单输入的模板。
由于页面上将有相同输入/标签的多个版本,因此输入 ID 不能被硬编码。
相反,我构建了一个用于绑定 attr 的函数('id' 用于输入,'for' 用于标签)。
这在 Chrome 和 IE9 中效果很好,但在 IE8 和 IE7 中失败。
我有一个标签和输入:<