小编use*_*167的帖子

在TWIG中查找字符串中的子字符串

我想找到字符串的子字符串或使用Twig检查是否没有这样的子字符串.换句话说,我需要在php中使用'strstr'或'strpos'的模拟.我用Google搜索并在stackoverflow中搜索了这个问题,但没有找到.有人知道如何解决这个问题吗?

php substring comparison-operators twig

124
推荐指数
1
解决办法
12万
查看次数

在KOHANA框架中检索GET参数

我的网址如http://MYDOMAIN.com/cron/reports/test?code=f463529c1b75f4d868.我需要检索代码(f463529c1b75f4d868).我该怎么办?(我在Kohana工作)我有这样的路线:

Route::set('cron_defaults', 'cron/<controller>(/<action>(?code=<code>))')
        ->defaults(array(
    'directory' => 'cron',
    'controller' => 'reports',
    'action' => 'test',
));
Run Code Online (Sandbox Code Playgroud)

在我写的控制器报告中:

var_dump(Request::instance()->param('code'));
Run Code Online (Sandbox Code Playgroud)

我的结果是NULL.怎么了?

php routes get kohana

1
推荐指数
1
解决办法
5735
查看次数

标签 统计

php ×2

comparison-operators ×1

get ×1

kohana ×1

routes ×1

substring ×1

twig ×1