小编Wal*_*mar的帖子

什么是HTML"是"属性?

我已经在这里和那里看到了很多,但我可以找到任何关于它的描述或文档!

例:

<paper-input-decorator label="Your Name">
    <input is="core-input">
</paper-input-decorator>
Run Code Online (Sandbox Code Playgroud)

html html5 dom

21
推荐指数
3
解决办法
6872
查看次数

Laravel Session Flash持续2个请求

最近我从Codeigniter换了Laravel,一切都很顺利,除了我遇到了问题Session::flash.

当我创建新用户时,我获得成功消息,但它将持续2个请求,即使我没有通过验证器: 在此输入图像描述

我的代码UsersController:

function getCreateUser(){
    $config = array(
        'pageName' => 'createUser',
        'pageTitle' => 'Create User',
        'formUrl'   => action('UsersController@postCreateUser'),
        'modelFields'   => array(
            array('db_name' => 'employee_id', 'text' => 'Employee Id', 'mandatory' => TRUE),
            array('db_name' => 'full_name', 'text' => 'Full Name', 'mandatory' => TRUE),
            array('db_name' => 'email', 'text' => 'Email', 'mandatory' => FALSE),
            array('db_name' => 'password', 'text' => 'Password','value' => '12345', 'mandatory' => TRUE)
            ),
        'submit_text' => 'Create'
        );
    return View::make('layouts.form', $config);
}

function postCreateUser(){
    $config = array(
        'pageName' …
Run Code Online (Sandbox Code Playgroud)

php session laravel laravel-4

20
推荐指数
3
解决办法
2万
查看次数

Laravel Passport通过访问令牌获取客户端ID

我正在编写一个小sms网关,供几个项目使用,

我实施了laravel passport身份验证(客户端凭据授权令牌)

然后我添加CheckClientCredentials到api中间件组:

protected $middlewareGroups = [
    'web' => [
       ...
    ],

    'api' => [
        'throttle:60,1',
        'bindings',
        \Laravel\Passport\Http\Middleware\CheckClientCredentials::class
    ],
];
Run Code Online (Sandbox Code Playgroud)

逻辑工作正常,现在在我的控制器中我需要让客户端与有效令牌相关联.

routes.php文件

Route::post('/sms', function(Request $request) {
    // save the sms along with the client id and send it

    $client_id = ''; // get the client id somehow

    sendSms($request->text, $request->to, $client_id);
});
Run Code Online (Sandbox Code Playgroud)

出于明显的安全原因,我永远不能发送带有消费者请求的客户端ID,例如$client_id = $request->client_id;.

php laravel laravel-5 laravel-passport

11
推荐指数
5
解决办法
1万
查看次数

WindowEnterTransition 不影响活动过渡

虽然windowExitTransition按预期工作,但我无法windowEnterTransition上班:

主题文件

 <item name="android:windowEnterTransition">@android:transition/explode</item>
 <item name="android:windowExitTransition">@android:transition/explode</item>
Run Code Online (Sandbox Code Playgroud)

主活动.java

Intent intent = new Intent(MainActivity.this, SubjectActivity.class);
startActivity(intent, ActivityOptionsCompat.makeSceneTransitionAnimation(MainActivity.this).toBundle());
Run Code Online (Sandbox Code Playgroud)

演示

android android-5.0-lollipop

5
推荐指数
1
解决办法
3799
查看次数

编辑器或编辑器扩展中的未详细错误

所以....我花了一整天努力让vs工作!

每当我尝试创建新项目或保存任何文件时,我都会得到无法解释的错误消息,告诉我查找详细信息

C:\Users\<User>\AppData\Roaming\Microsoft\VisualStudio\12.0\ActivityLog.xml

这就是我到达那里:

在此输入图像描述

我使用vs社区版,我尝试了以下内容:

  • 修理视觉工作室...... [没有运气]
  • 卸载社区版和安装Express版.... [没有运气]
  • 卸载快递,然后再次安装社区版.... [没有运气]

并且上述所有尝试都存在错误......

任何想法将不胜感激..

更新:

当我尝试保存任何文件时,我在该xml文件中也得到以下错误:

"de7b1121-99a4-4708-aedf-15f40c9b332f"类别中的颜色"Popup"不存在.

visual-studio-2013

5
推荐指数
0
解决办法
682
查看次数

是否可以从具有跨源数据的元素中捕获?

我有这个简单的脚本,我在 webRTC 文档中找到了我尝试运行它,但似乎我错过了一些东西

const leftVideo = document.getElementById('leftVideo');
const rightVideo = document.getElementById('rightVideo');

leftVideo.addEventListener('canplay', () => {
const stream = leftVideo.captureStream();
rightVideo.srcObject = stream;
});
Run Code Online (Sandbox Code Playgroud)

我在检查流捕获时收到此错误 Uncaught DOMException: Failed to execute 'captureStream' on 'HTMLMediaElement': 无法从 HTMLVideoElement.leftVideo.addEventListener 处的跨源数据元素捕获这是我的 index.html

<video id="leftVideo" playsinline controls loop muted>
    <source src="test1.webm" type="video/webm"/>
    <p>This browser does not support the video element.</p>
</video>

<video id="rightVideo" playsinline autoplay></video>
Run Code Online (Sandbox Code Playgroud)

javascript webrtc

4
推荐指数
1
解决办法
3051
查看次数

播放位置服务getLastLocation返回null

我正在尝试收听位置更改,但有时onLocationChanged回调永远不会被调用并getLastLocation返回null,而Google地图始终完美运行.

注意

如果我重新启动设备,位置服务将仅工作约2天; 之后,Google地图仍在运行时,我的应用和SDK示例都无效.

这是我的服务代码:

public class VisitService extends Service implements
        GooglePlayServicesClient.ConnectionCallbacks,
        GooglePlayServicesClient.OnConnectionFailedListener, 
        LocationListener {

    private final IBinder mBinder = new VisitBinder();


    // A request to connect to Location Services
    private LocationRequest mLocationRequest;

    // Stores the current instantiation of the location client in this object
    private LocationClient mLocationClient;


    private boolean mLocationServiceConnected = false;

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        initLocation();
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public IBinder …
Run Code Online (Sandbox Code Playgroud)

java android google-play-services

3
推荐指数
1
解决办法
7905
查看次数

PHP非法字符串偏移错误

我有这个代码,我不知道为什么我会从中得到错误.

if( ! in_array($repeatType, ['monthly', 'weekly', 'daily'])){
    // do somehting
}
$monthly = ['two_years' => 26, 'offset_const' => 4, 'add_unite' => 'weeks'];
$weekly = ['two_years' => 52*2, 'offset_const' => 1, 'add_unite' => 'weeks'];
$daily = array('two_years' => 365*2, 'offset_const' => 1, 'add_unite' => 'days');

for ($i=0; $i < $$repeatType['two_years']; $i++) { #<--- here I get the error

    // ..... // rest of the code
Run Code Online (Sandbox Code Playgroud)

这是如此奇怪,因为我检查var_dump($$repeatType)输出,它似乎很好:

array(3){["two_years"]=>int(730)["offset_const"]=>int(1)["add_unite"]=>string(4)"days"}
Run Code Online (Sandbox Code Playgroud)

php

2
推荐指数
1
解决办法
412
查看次数

基于属性的聚合物RTL文本

在我的项目中,我需要支持阿拉伯语和英语,为此我要做以下事情:

<div class="{{ {'align-right': currentLanguageCode == 'ar'} | tokenList }}">{{languages[currentLanguageCode].supervisorName}}</div>
Run Code Online (Sandbox Code Playgroud)

对于每个文本渲染,将重复上述行.

所以我觉得如果能做到这样的话会更好:

双语-text.html

<polymer-element name="bilingual-text" attributes="languageCode">
    <template>
       <content></content>
    </template>
    <script>
        Polymer({
            languageCodeChanged: function() {
                if (this.languageCode == 'ar') {
                    // add .align-right class.
                } else {
                    // remove .align-right class.
                }               
            }
        })
    </script>
</polymer-element>
Run Code Online (Sandbox Code Playgroud)

然后

<bilingual-text languageCode="ar">{{languages['ar'].supervisorName}}</bilingual-text>
Run Code Online (Sandbox Code Playgroud)

有没有办法实现这样的东西?

polymer

2
推荐指数
1
解决办法
540
查看次数

Bootstrap修复了左侧的列

演示:整页编辑.

目前.col-sm-6 .tasks-panel位于右侧时,前一个.col-sm-6不太长,当前一个足够长时向左侧移动(点击Add Visit演示使前一个更长).

我想把它固定在左侧.

.pull-left不幸的是我尝试过没用.

提前致谢.

html css twitter-bootstrap twitter-bootstrap-3

0
推荐指数
1
解决办法
52
查看次数