我正在尝试将多个Laravel 4项目上传到我的Web服务器,而不是我的开发服务器.每个laravel 4应用程序都位于自己的子目录中.我的文件结构应该如何?我一直在寻找一个htaccess来从网址中删除/ public,但我没有成功.此服务器仅用于测试目的,它允许其他人在构建项目时遵循.我知道将laravel基础结构留在这些目录中是主要的安全问题,但它们仅用于测试目的,当项目完成时,它们被移除并放置在自己的托管服务器上.这是我的文件结构:
-public_html/
main website html files
-Test Site Subdirectory Folder
-subdirectoryFolder
-Store/
-laravel app 1
-blog/
-laravel app 2
-newspaper
-laravel app 3
Run Code Online (Sandbox Code Playgroud)
如果我在每个子目录文件夹(www.testsite.com/Store,)中安装laravel应用程序www.testsite.com/blog,www.testsite.com/newspaper每个应用程序都可以工作,但是我试图删除网址末尾的公共,www.testsite.com/Store/public是浏览器中显示的内容.非常感谢任何有关此问题的帮助.谢谢.
我有一个form。这个动作是:
<form action="{{url('career/save/{id}')}}" method="POST" enctype="multipart/form-data">
Run Code Online (Sandbox Code Playgroud)
路线:
Route::group(['prefix' => 'career'], function () {
Route::get('apply', ['as' => 'addApplicant', 'uses' => 'ApplicantController@create']);
Route::post('save', ['as' => 'saveApplicant', 'uses' => 'ApplicantController@store']);
Route::get('confirmation/{id}', ['as' => 'confirmationMsg', 'uses' => 'ApplicantController@show']);
});
Run Code Online (Sandbox Code Playgroud)
控制器:
public function store(Request $request)
{
$applicant = new Applicant();
$applicant['name'] = $request->input('name');
$applicant['sex'] = $request->input('sex');
$applicant['marital_status'] = $request->input('marital_status');
$applicant['date_of_birth'] = $request->input('date_of_birth');
$applicant['email'] = $request->input('email');
$applicant->save();
\Session::flash('flash_message','Application has been successfully submitted.');
return redirect(route('confirmationMsg'));
}
public function show($id)
{
$applicantData = Applicant::whereId($id)->first();
return view('applicant.confirmation',compact("applicantData"));
} …Run Code Online (Sandbox Code Playgroud) 我遇到了Laravel 5.2登录和注册的问题.我在这里使用Laravel 5.2默认login.blade.php和register.blade.php.所有事情都很顺利但是当我试图注册任何用户并填写表单并提交然后它不会在数据库中插入任何数据而且相同页面显示在浏览器窗口中true.虽然我已经进行了调试,但浏览器没有显示任何错误.
这是我的routes.php:
<?php
use App\Member;
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
return view('welcome');
});
Route::get('/home', function () {
return view('home');
});
Route::get('/members', …Run Code Online (Sandbox Code Playgroud) 我有div固定的大小height:45px,并width:60px没有其他的CSS来div。这div用于显示客户上传的图像。我想给出图像的尺寸,以便上传的图像完美地适合给定的 div。我需要提供优化的尺寸,以便图像在 div 中看起来不错。第一个逻辑我试图给图像提供 45 x 60、90 x 120 的图像。解决此问题的正确方法是什么。请指导。提前致谢。
我正在尝试使用CSS移动前景图像,因此它与背景图像重叠一点.我似乎无法让前景图像移动到任何地方,我只是无法弄清楚我做错了什么.谁能指出我正确的方向?看我的小提琴.
HTML:
<img src="http://image.tmdb.org/t/p/w1000/aUYcExsGuRaw7PLGmAmXubt1dfG.jpg" style="-webkit-mask-image: -webkit-gradient(linear, left top, left bottom, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)))"
width="auto" height="400" class="backgroundImg">
<div class="frontImg">
<img src="http://image.tmdb.org/t/p/w150/2i0JH5WqYFqki7WDhUW56Sg0obh.jpg" class="" height="300" width="auto">
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
body{
background: black;
}
.background{
position: absolute;
left: 0px;
top: 0px;
z-index: -1;
}
.frontImg{
position: absolute;
left:200;
top:500;
z-index: 1;
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用图像将图像对齐到out div元素的底部vertical-align,但这vertical-align似乎不起作用,图像根本不移动.
<div class="row">
<div class="col-md-1">
<img src="../images/image.png" style="height: 20px; width: 20px;cursor:pointer"/>
</div>
<div class=col-md-11 >
<div style="overflow:auto;height:300px"></div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我正在使用bootstrap类进行对齐.有没有什么可以使图像div对齐到外的底部div?这是采取height的第二个div这是300px;.
我有一个N*N矩阵.现在我想知道这个矩阵的对角线差异.这个解决方案的最佳方法是什么?
我正在尝试给定的方法:
比如它是3*3矩阵说它是:
11 15 85
66 72 21
14 21 47
Run Code Online (Sandbox Code Playgroud)
对角简单公式将是:
firstD= (11+72+47) = 130
secondD = (85+72+14)= 171
diagonalDiff = |firstD - secondD| = |130-171| = 41
Run Code Online (Sandbox Code Playgroud)
如果我计算每一行如第一次找出firstD(第一行的第一个值+秒行的秒值+第三行的第三个值+ ..).这是我的想法.谁能告诉我最好的方法?
我将输入几个句子,输出将用方括号括起来.我到目前为止尝试过:
$('.addCharacter').click(function(event) {
var textareaInput=$('.textareaInput').val();
var myString = '[' + textareaInput + ']';
console.log(myString);
});
Run Code Online (Sandbox Code Playgroud)
输入:
demo text one
demo text two
demo text three
Run Code Online (Sandbox Code Playgroud)
输出:
[demo text one
demo text two
demo text three]
Run Code Online (Sandbox Code Playgroud)
但我希望输出应该是:
[demo text one]
[demo text two]
[demo text three]
Run Code Online (Sandbox Code Playgroud)
我认为可以用正则表达式完成.我在正则表达式方面不是很好.可以有人告诉我这个方法吗?
我想为我的Laravel 5.2应用程序生成QR代码.我搜索并找到了一个库.它简单的qr码.
我安装了它.并完美配置服务提供商文件(config/app.php).
<div class="visible-print text-center">
{{ QrCode::size(1)->generate(Request::url()) }}
<p>Scan me to return to the original page.</p>
</div>
Run Code Online (Sandbox Code Playgroud)
我看到了一些代码<div class="visible-print text-center"> </div>.这是blade观点.我的问题是如何打印qr代码的视图?它应该是这样的:
或者是否有任何好的laravel库来生成QR码?提前致谢.
这是我正在尝试的代码:标记:
<textarea class="form-control textareaInput" rows="12" id="textareaInput"></textarea>
<div class="row">
<div class="col-lg-2 text-center">
<div class="form-group">
<button class="form-control btn btn-primary reset" onclick="myFunction()">Reset</button>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我的功能:
function myFunction() {
//alert("ok");
document.getElementById("textareaInput").reset();
}
Run Code Online (Sandbox Code Playgroud)
单击reset按钮时出现错误。
错误:
未捕获的类型错误:document.getElementById(...).reset 不是函数
问题出在哪儿?注意:我没有使用form标签。
php ×5
html ×4
css ×3
laravel ×3
javascript ×2
laravel-5.2 ×2
.htaccess ×1
css3 ×1
forms ×1
jquery ×1
laravel-4 ×1
laravel-5 ×1
qr-code ×1
regex ×1
subdirectory ×1