好吧,我正在尝试使用labrvel 4的Hybridauth.但是当我尝试使用facebook登录时,我似乎变得非常普遍:
验证失败!Facebook返回了无效的用户ID.
我已阅读所有其他帖子,并且没有运气,所以只是希望有人可以帮助我.
我遵循了这个教程:http://www.mrcasual.com/on/coding/laravel4-package-management-with-composer/
并尝试了其他几种配置,但没有成功.
这是我的config/hybridauth.php
<?php
return array(
"base_url" => "http://myapp.dev/social/auth/",
"providers" => array (
"Facebook" => array (
"enabled" => true,
"keys" => array ( "id" => "****", "secret" => "****" ),
),
),
);
Run Code Online (Sandbox Code Playgroud)
这是我的路线:
Route::get('social/{action?}', array("as" => "hybridauth", function($action = "")
{
// check URL segment
if ($action == "auth") {
// process authentication
try {
Hybrid_Endpoint::process();
}
catch (Exception $e) {
// redirect back to http://URL/social/
return Redirect::route('hybridauth');
}
return;
} …Run Code Online (Sandbox Code Playgroud) 在阅读文档后确定:http://four.laravel.com/docs/html#form-model-binding
我有一个看起来像这样的表单:
{{ Form::model($profile, array('action' => 'ProfilesController@edit', $profile->user_id, 'files' => true)) }}
{{ Form::select('gender', array('0' => 'What gender are you?', '1' => 'Male', '2' => 'Female'), array('class' => 'span12')) }}
{{ From::close() }}
Run Code Online (Sandbox Code Playgroud)
我的问题是:模型绑定不适用于Form :: select,适用于文本输入.我究竟做错了什么??
谢谢你的帮助.
好的,我正在制作一个简单的java swing国际象棋游戏.这个问题更多的是关于OOP设计然后是Java Swing.
我有以下内容:
在我的主要ChessGame类中:
所以,左上方(0,0)映射到myArray [0] [0]
我的问题是,要检查这个地方是空的还是有棋子,我必须使用:
if(panels[x][y] instanceof Piece){
((Piece)panels[x][y]).makeMove();
}
Run Code Online (Sandbox Code Playgroud)
我问的是这个可怕的设计?我知道我应该尝试远离实例.什么是更好的方法?
谢谢.
在谈到Git时,我有点像新秀.所以我决定阅读Scott Chacon的Pro Git.BTW好书,强烈推荐它.
无论如何得到了关于签名标签的部分.要使用GPG对标签进行签名,您必须设置私钥.但是,当我跑:
git tag -s v1.6 -m "my signed 1.6 tag"
Run Code Online (Sandbox Code Playgroud)
我得到以下内容:
C:\Users\Name\Desktop\git>git tag -s v1.6 -m "my signed 1.6 tag"
gpg: error loading `iconv.dll': The specified module could not be found.
gpg: please see http://www.gnupg.org/download/iconv.html for more information
gpg: skipped "Name <name@gmail.com>": secret key not available
gpg: signing failed: secret key not available
error: gpg failed to sign the data
error: unable to sign the tag
Run Code Online (Sandbox Code Playgroud)
所以,我完成了错误消息告诉我要做的事情,然后转到链接并按照说明进行操作.我将iconv.dll复制到包含gpg.exe(\ Git\bin)的文件夹中.再次执行命令并得到:
C:\Users\Name\Desktop\git>git tag -s v1.6 -m "my signed 1.6 tag" …Run Code Online (Sandbox Code Playgroud) 好的,所以当我想上传图片时.我经常这样做:
$file = Input::file('image');
$destinationPath = 'whereEver';
$filename = $file->getClientOriginalName();
$uploadSuccess = Input::file('image')->move($destinationPath, $filename);
if( $uploadSuccess ) {
// save the url
}
Run Code Online (Sandbox Code Playgroud)
这在用户上传图像时工作正常.但是如何从URL保存图像???
如果我尝试类似的东西:
$url = 'http://www.whereEver.com/some/image';
$file = file_get_contents($url);
Run Code Online (Sandbox Code Playgroud)
然后:
$filename = $file->getClientOriginalName();
$uploadSuccess = Input::file('image')->move($destinationPath, $filename);
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Call to a member function move() on a non-object
Run Code Online (Sandbox Code Playgroud)
那么,如何使用laravel 4从URL上传图像?
艾米非常感谢.