我正在使用Laravel 5.1来创建基于控制台的应用程序.在开发期间,我想在发生错误时显示异常跟踪.但是,即使我使用-v -vv或-vvv选项php artisan,我也不会获得自定义命令的异常跟踪.我设置APP_DEBUG=true了我的.env,仍然没有异常的痕迹.
输出php artisan some:unknowncommand是:
[InvalidArgumentException]
There are no commands defined in the "some" namespace.
Run Code Online (Sandbox Code Playgroud)
输出php artisan -v some:unknowncommand是:
[InvalidArgumentException]
There are no commands defined in the "some" namespace.
Exception trace:
() at /Users/dirkpostma/Dropbox/Domains/dpepp/vendor/symfony/console/Application.php:501
Symfony\Component\Console\Application->findNamespace() at /Users/dirkpostma/Dropbox/Domains/dpepp/vendor/symfony/console/Application.php:535
Symfony\Component\Console\Application->find() at /Users/dirkpostma/Dropbox/Domains/dpepp/vendor/symfony/console/Application.php:192
Symfony\Component\Console\Application->doRun() at /Users/dirkpostma/Dropbox/Domains/dpepp/vendor/symfony/console/Application.php:126
...
Run Code Online (Sandbox Code Playgroud)
现在,我创建了一个非常简单的控制台命令,名为dp:test,具有以下句柄功能:
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
generate error here
}
Run Code Online (Sandbox Code Playgroud)
输出php artisan dp:test …
有人可以解释Laravel 4 UrlGenerator类的语法吗?我在文档中找不到它.
我有以下路线:
Route::resource('users', 'UsersController');
Run Code Online (Sandbox Code Playgroud)
我花了很长时间才弄清楚这个:
{{ Url::action('UsersController@show', ['users' => '123']) }}
Run Code Online (Sandbox Code Playgroud)
生成所需的html:
http://localhost/l4/public/users/123
Run Code Online (Sandbox Code Playgroud)
我查看了UrlGenerator.php
/**
* Get the URL to a controller action.
*
* @param string $action
* @param mixed $parameters
* @param bool $absolute
* @return string
*/
public function action($action, $parameters = array(), $absolute = true)
Run Code Online (Sandbox Code Playgroud)
..但这并没有真正带给我更多.
我能通过$parameters什么?
我现在知道这['users' => '123']有效,但这背景是什么?还有其他传递数据的方法吗?
在Angularfire中存在$ destroy()的原因是什么?
angularfire sais的文档:
https://www.firebase.com/docs/web/libraries/angular/api.html#angularfire-firebasearray-destroy
停止侦听此阵列使用的事件和可用内存(清空本地副本).更改不再与Firebase同步或从Firebase同步.
sync = $firebase(ref).$asArray();
...
....
sync.$destroy()
Run Code Online (Sandbox Code Playgroud)
我不能这样做:
sync = null
Run Code Online (Sandbox Code Playgroud)
要么
delete sync
Run Code Online (Sandbox Code Playgroud)
或者我应该因为某种原因真的使用$ destroy()吗?
我正在尝试使用iOS 8,Swift和Xcode 6.3创建自动完成器
我有一个问题,我正在努力解决,但我放弃了...我希望有人可以在这里帮忙.问题是UITableViewCell当初始化dataSource为空时(自定义)不会显示.当添加数据datasource和重新加载时tableView,单元格应该显示,但它们不会......至少,它们第一次没有...第二次,它们会......当我用非初始化表格时 - 空数据,问题不会发生.我想有些事情出了问题dequeueReusableCellWithIdentifier.一开始,没有找到可重复使用的细胞,或者什么.但我不知道为什么......
ViewController.swift中的相关代码:
// filteredWords is a [String] with zero or more items
@IBAction func editingChanged(sender: UITextField) {
autocompleteTableView.hidden = sender.text.isEmpty
filteredWords = dataManager.getFilteredWords(sender.text)
refreshUI()
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell") as! AutocompleteTableViewCell
cell.title.text = filteredWords[indexPath.row]
return cell
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return filteredWords.count
}
func refreshUI() {
self.autocompleteTableView.reloadData()
}
Run Code Online (Sandbox Code Playgroud)
我在github上创建了一个示例项目:
angularfire ×1
console ×1
exception ×1
ios ×1
laravel ×1
laravel-4 ×1
laravel-5 ×1
php ×1
uitableview ×1