进入laravel,我尝试使用刀片模板,但未进行渲染。我所有的示例都将用于laravel文档。
更新
所以这是我的master.blade.php文件,位于资源>视图> master.blade.php中
<!DOCTYPE html>
<html>
<head>
@yield('layouts.header')
</head>
<body>
<div class="container">
<div class="content">
<div class="title">Test to Laravel 5</div>
</div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
这是我的header.blade.php文件,位于view / layouts /
@section('header')
<title>cookie monster</title>
<link href="https://fonts.googleapis.com/css?family=Lato:100" rel="stylesheet" type="text/css">
<style>
html, body {
height: 100%;
}
body {
margin: 0;
padding: 0;
width: 100%;
display: table;
font-weight: 100;
font-family: 'Lato';
}
.container {
text-align: center;
display: table-cell;
vertical-align: middle;
}
.content {
text-align: center;
display: inline-block;
}
.title {
font-size: …Run Code Online (Sandbox Code Playgroud) 嘿家伙我试图添加验证规则只接受字母.我使用regex规则,但它仍然无法正常工作.这是我的代码如下
/**
* Validate request/input
**/
$this->validate($request, [
'name' => 'required|regex:/^[\pL\s\-]+$/u|max:255|unique:users,name,'.$user->id,
'email' => 'required|email|max:255|unique:users,email,'.$user->id,
]);
Run Code Online (Sandbox Code Playgroud)
每当我输入一个名字,就像Foo Foo它在注册时仍然成功一样.
知道我做错了什么吗?
每当用户访问mywebsite.com/profile时,我都希望表单预先填充他们在注册/注册流程中输入的值。
我可以用我的表格做到这一点
<h1><b>Your Profile</b></h1>
<form method="POST" action="/profile/update">
<div class="form-group hidden">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<input type="hidden" name="_method" value="PATCH">
</div>
<div class="form-group {{ $errors->has('name') ? ' has-error' : '' }}">
<label for="email" class="control-label"><b>Name:</b></label>
<input type="text" name="name" placeholder="Please enter your email here" class="form-control" value="{{ $user->name }}"/>
<?php if ($errors->has('name')) :?>
<span class="help-block">
<strong>{{$errors->first('name')}}</strong>
</span>
<?php endif;?>
</div>
<div class="form-group {{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="control-label"><b>Email:</b></label>
<input type="text" name="email" placeholder="Please enter your email here" class="form-control" value="{{ …Run Code Online (Sandbox Code Playgroud) 嘿伙计们,新来的反应试图实现一些简单的验证但正在努力。我想要
我想即时完成所有这些,但一直在努力/找不到任何可靠的参考资料。这是我的代码
import React from 'react';
//import ReactDOM from 'react-dom';
import { Button, Form, FormGroup, Label, Input } from 'reactstrap';
export default class Forms extends React.Component {
constructor() {
super();
this.state = {
fname: '',
lname: '',
email: '',
password: '',
confirmPassword: '',
formSuccess: false
}
this.handleSubmit = this.handleSubmit.bind(this);
}
handleUserInput(e) {
const name = e.target.name;
const value = e.target.value;
this.setState({ [name]: value });
}
handleSubmit(e) {
e.preventDefault();
}
render() {
return (
<Form onSubmit={this.handleSubmit}>
<FormGroup>
<Label for="fname">First …Run Code Online (Sandbox Code Playgroud) 嘿伙计们,我正在尝试学习PHP框架以及OOP,我正在使用Laravel 5.1 LTS.
我的代码中包含以下代码 AuthController
<?php
namespace App\Http\Controllers\Auth;
use App\Verification;
use Mail;
use App\User;
use Validator;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ThrottlesLogins;
use Illuminate\Foundation\Auth\AuthenticatesAndRegistersUsers;
class AuthController extends Controller
{
use AuthenticatesAndRegistersUsers, ThrottlesLogins;
private $redirectTo = '/home';
public function __construct()
{
$this->middleware('guest', ['except' => 'getLogout']);
}
protected function validator(array $data)
{
return Validator::make($data, [
'name' => 'required|max:255',
'email' => 'required|email|max:255|unique:users',
'password' => 'required|confirmed|min:6',
]);
}
protected function create(array $data){
$user = User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
// …Run Code Online (Sandbox Code Playgroud) 你好,我试图用云功能更新firestore中的文档,但是我对云功能如何知道要更新哪个文档感到困惑,这是我的代码
云功能代码
exports.newsletterGreetConfirm = functions.firestore
.document('newsletter/{newsletterId}')
.onUpdate((change, context) => {
const newValue = change.after.data();
console.log(newValue);
return 0;
});
Run Code Online (Sandbox Code Playgroud)
在我的云函数外壳中,我将以下对象传递给了我的newsletterGreetConfirm函数
{email:"test@gmail.com",id:"LgNqtD6Ih7SYPEEz8jJl",subscribedToNewsletterList:true,timestamp:12321312}
Run Code Online (Sandbox Code Playgroud)
我的输出是undefined
我的目标是在用户单击确认电子邮件中的按钮或链接时确认电子邮件地址。仅在构建此功能的第一阶段,感谢您的所有帮助!我也在用react
node.js firebase reactjs google-cloud-functions google-cloud-firestore
我试图在用户点击提交按钮时隐藏元素.
<div class="form-group submit">
<input type="submit" value="Submit Answers" class="button">
<br>
<a href="#" data-dismiss="modal" >No Thanks</a>
<?php endif; ?>
</div>
</form>
<div class="no-thanks" style="padding-top:0;">
<a href="#"><h3>No Thanks</h3></a>
</div>
Run Code Online (Sandbox Code Playgroud)
$().ready(function() {
$('submit').click(function() {
$('no-thanks').hide(); //or i would like to do this $('no-thanks').addClass('hidden') im using bootstrap
});
});
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?