我正在尝试为Laravel 4中的表单设置提交按钮的样式.但是,当我尝试以下操作时,我会得到相同的旧无聊默认按钮:
{{Form::submit('Submit', null, array(
'type' => 'button',
'class' => 'btn btn-large btn-primary openbutton',
));}}
Run Code Online (Sandbox Code Playgroud)
有没有一种特殊的方法来在表单上下文中设置这种类型的按钮?谢谢.
我最近尝试使用composer更新我的laravel项目,在需求部分使用它:
"require": {
"laravel/framework": "4.0.*",
"way/generators": "dev-master",
"taylorotwell/laravel-oauth2": "0.2.*",
"juy/profiler" : "dev-master",
"cviebrock/eloquent-sluggable": "1.0.*"
},
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: remove laravel/framework 4.0.x-dev
- Conclusion: don't install laravel/framework 4.0.x-dev
- Conclusion: don't install laravel/framework v4.0.10
- Conclusion: don't install laravel/framework v4.0.9
- Conclusion: don't install laravel/framework v4.0.8
- Conclusion: don't install laravel/framework v4.0.7
- Conclusion: don't install laravel/framework …Run Code Online (Sandbox Code Playgroud) 我试图在按钮单击为用户显示FB.ui对话框.现在,我可以让对话框显示为弹出窗口,但我不希望这样.我希望对话框显示为模式,以便弹出窗口阻止程序不会阻止它.我尝试过使用"display:'iframe'"参数,但在使用时我得到错误:
"对话框"模式只能在用户连接时使用.
我已经读过,也许我需要使用访问令牌来使其显示为模态并使用display iframe参数.请记住这是一个网站.
我已经在服务器端(PHP)的Laravel中有一个OAuth2包,负责验证Facebook用户,并提取访问令牌.我的问题是,如何提取此令牌并将其应用于Javascript SDK,以便我可以将FB.ui对话框显示为模态?我甚至需要这样做吗?这是我正在使用的JavaScript:
window.fbAsyncInit = function () {
FB.init({ appId: '************', cookie: true, status: true, xfbml: true, oauth: true });
if (typeof facebookInit == 'function') {
facebookInit();
}
};
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
function facebookInit() {
FB.ui({
url : 'http://url.com',
method: 'feed',
name: 'Url',
link: url,
display: 'iframe',
picture: 'http://thisimage.png',
caption: fb_description,
}, function (response) {
if (response …Run Code Online (Sandbox Code Playgroud) javascript php facebook facebook-graph-api facebook-javascript-sdk
现在我正在开发一个小部件,我希望某些人将其放在他们的网站上,该小部件将向他们发送信息并获取一些信息。现在,我让他们在代码中使用以下内容:
<script src="http://myurl.com/widget/widgetscript.js" type="text/javascript"></script>
<div id="example-widget-container"></div>
Run Code Online (Sandbox Code Playgroud)
在 widgetscript.js 中,我有以下内容:
var jsonp_url = "http://myurl.com/widget/external_widget?callback=?";
$.getJSON(jsonp_url, function(data) {
$('#example-widget-container').html("This data comes from another server: " + data.msg);
});
Run Code Online (Sandbox Code Playgroud)
这里调用的路由调用我的 WidgetController.php 中的一个函数:
public function external_widget($id) {
$array = Fan::likes_by_city($id);
$data = "{msg:'Hello World!'}";
if(array_key_exists('callback', $_GET)){
header('Content-Type: text/javascript; charset=utf8');
header('Access-Control-Allow-Origin: http://www.example.com/');
header('Access-Control-Max-Age: 3628800');
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE');
$callback = $_GET['callback'];
echo $callback.'('.$data.');';
} else {
// normal JSON string
header('Content-Type: application/json; charset=utf8');
echo $data;
}
Run Code Online (Sandbox Code Playgroud)
我希望这个函数是动态的,这样我就可以为每个使用该小部件的用户定制该函数中的数据(将 $id 作为参数)。我知道我可以用我的路线来做到这一点,如下所示:
Route::get('/widget/external_widget/{id?}', array('uses' => 'WidgetController@external_widget'));
Run Code Online (Sandbox Code Playgroud)
只需将 …
我有一个用于 Stripe 结账的按钮(它会弹出 Stripe 表单)。我想要做的是使用 Ajax 将输入发送到我的后端(使用路由),然后存储该信息。我该怎么做?
当前代码如下:
<div class="button_row">
{{ Form::button('Pay $1', array(
'id' => 'customButton',
'class' => 'button',
)); }}
</div>
<script src="https://checkout.stripe.com/checkout.js"></script>
<script>
var handler = StripeCheckout.configure({
key: '*****************',
image: '/assets/images/1024icon.png',
token: function(token) {
// Use the token to create the charge with a server-side script.
// You can access the token ID with `token.id`
}
});
$('#customButton').on('click', function(e) {
// Open Checkout with further options
handler.open({
name: 'Test',
description: 'Test',
amount: 100
});
e.preventDefault();
});
// …Run Code Online (Sandbox Code Playgroud) def remove_char(text):
for letter in text[1]:
text[0] = text[0].replace(letter," ")
return text[0]
Run Code Online (Sandbox Code Playgroud)
这是返回:
'str' object does not support item assignment
Run Code Online (Sandbox Code Playgroud)
为什么?我该如何做呢?
我正在尝试让FB SDK与iOS上的React-Native应用程序一起使用,但遇到了以下错误:
React-Native-无法读取未定义的属性'logInWithReadPermissions'
在按钮上单击。
我已经按照以下说明进行操作:
1. npm install rnpm -g
2. rnpm link react-native-fbsdk
3. remove the following lines from subspecs in ios/PodFile
'Core',
'Login',
'Share',
4. pod install
5. go to https://developers.facebook.com/docs/ios/getting-started, download FB ios SDK, and unzip to ~/Documents/FacebookSDK
6. open F8v2.xcworkspac with xcode, and drag Bolts.framework,FBSDKCoreKit.framework, FBSDKLoginKit.framework, FBSDKShareKit.framework in ~/Documents/FacebookSDK to Frameworks under F8V2 project.
7. run react-native run-ios .It should work now. If have build issue, drag the three FB...Kit.framework to RCTFBSDK.xcodeproj too.
Run Code Online (Sandbox Code Playgroud)
没运气。
组件流如下所示:
(按钮) …
我正在尝试使用yarn运行Spark,并且遇到了以下错误:
线程“主”中的异常java.lang.Exception:使用主线程“ yarn”运行时,HADOOP_CONF_DIR或者YARN_CONF_DIR必须在环境中进行设置。
我不确定“环境”在哪里(哪个特定文件?)。我尝试使用:
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export YARN_CONF_DIR=$HADOOP_HOME/etc/hadoop
Run Code Online (Sandbox Code Playgroud)
在bash_profile中,但这似乎无济于事。
我要打印:
嗨,我们这样做:
问题是,由于撇号,它不适用于"let's".如果我在这个("")周围使用引号,它也会在视图中打印引号,这是我不想要的.
我如何在React Native中执行此操作?
我正在使用Ruby on Rails中的邮件程序运行测试,我收到以下错误:
*********-C02MGBVJFD57:myapp ************$ bundle exec rake test:mailers
# Running:
EE
Finished in 0.110500s, 18.0995 runs/s, 0.0000 assertions/s.
1) Error:
UserMailerTest#test_account_activation:
ActiveRecord::StatementInvalid: Mysql2::Error: Incorrect datetime value: '2014-12-18 01:07:49 UTC' for column 'activated_at' at row 1: INSERT INTO `users` (`name`, `email`, `password_digest`, `admin`, `activated`, `activated_at`, `created_at`, `updated_at`, `id`) VALUES ('Michael Example', 'michael@example.com', '$2a$04$hz6pvZctid6gZEuv0.qAe.0mEfbEjxso9GrXwC3yHRhIThIJ7Vx5m', 1, 1, '2014-12-18 01:07:49 UTC', '2014-12-18 01:07:49', '2014-12-18 01:07:49', 762146111)
2) Error:
UserMailerTest#test_password_reset:
ActiveRecord::StatementInvalid: Mysql2::Error: Incorrect datetime value: '2014-12-18 01:07:49 UTC' for column 'activated_at' at row 1: …Run Code Online (Sandbox Code Playgroud) laravel-4 ×3
javascript ×2
jquery ×2
laravel ×2
php ×2
react-native ×2
ajax ×1
apache-spark ×1
callback ×1
composer-php ×1
css ×1
facebook ×1
forms ×1
hadoop ×1
python ×1
text ×1