这是我的Route配置:
routes.MapRoute(
name: "AdsCategories",
url: "Ads/{key}",
defaults: new { controller = "Ads", action = "Index" },
//constraints: new { key = },
namespaces: new string[] { "Vprok.Controllers" }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
namespaces: new string[] { "Vprok.Controllers"}
);
Run Code Online (Sandbox Code Playgroud)
如何创建约束"AdsCategories"?我需要使用默认路由,如果控制器中的操作"Ads"== {key}.
我使用的是lightgallery插件,其中click事件定义为:
$(document).on('click', 'a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]', function(event) {
self.start($(event.currentTarget));
event.preventDefault();
});
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试像这样调用事件时:
$(".catalog-content a[data-lightbox='test']").first().trigger('click');
Run Code Online (Sandbox Code Playgroud)
......它似乎不起作用.我究竟做错了什么?我该如何触发此click事件?
示例jsFiddle
我有一个Perl脚本,我需要将其转换为PHP.什么是md5Perl中函数的PHP模拟?
Perl脚本:
$hash = md5($str1, $str2);
Run Code Online (Sandbox Code Playgroud)
PHP脚本:
$hash = md5($str1.$str2);
Run Code Online (Sandbox Code Playgroud)
我有不同的价值观$hash.我如何$hash在PHP中获得相同的价值?
谢谢.