我正在尝试发送电子邮件,并在需要时显示任何错误.以下代码正在发送电子邮件,我收到它就好了.但问题是,当我对$ sent var进行检查时,它会为我返回false.
我在这里错过了一些东西吗?可能是因为它已经晚了.谁知道...
$sent = Mail::send('emails.users.reset', compact('user', 'code'), function($m) use ($user)
{
$m->to($user->email)->subject('Activate Your Account');
});
if( ! $sent)
{
$errors = 'Failed to send password reset email, please try again.';
}
Run Code Online (Sandbox Code Playgroud) 我使用Jasmine框架将AngularJS与karma一起使用.我有其他几个测试运行和工作.我的问题是当我试图运行这个:
spyOn(window, 'confirm').and.returnValue(true);
Run Code Online (Sandbox Code Playgroud)
我收到此错误:
ReferenceError: spyOn is not defined
Run Code Online (Sandbox Code Playgroud)
这是我的配置:
module.exports = function() {
return {
basePath: '../',
frameworks: ['jasmine'],
reporters: ['progress'],
browsers: ['Chrome_without_security'],
autoWatch: true,
// these are default values anyway
singleRun: false,
colors: true,
plugins : [
'karma-chrome-launcher',
'karma-jasmine',
'karma-ng-scenario'
],
customLaunchers: {
Chrome_without_security: {
base: 'Chrome',
flags: ['--disable-web-security']
}
},
files : [
'static/js/bower_components/angular/angular.js',
'static/js/app.js',
'static/js/controllers.js'
]
}
};
var sharedConfig = require('./karma-shared.conf');
module.exports = function(config) {
var conf = sharedConfig();
conf.files = conf.files.concat([
//test files
'./tests/e2e/account/sign-up.js', …Run Code Online (Sandbox Code Playgroud) 所以我试图通过两种方式获取动作ID:
$ACT_ID = $this->EE->functions->fetch_action_id("classname", "function");
$ACT_ID = $FNS->fetch_action_id("classname", "function");
Run Code Online (Sandbox Code Playgroud)
但是,它仍然以此为输出:
{AID:classname:function}
Run Code Online (Sandbox Code Playgroud)
当它输出到视图中时它不会解析它.我还需要做些什么吗?