我需要问一些愚蠢的问题,但我的问题是访问它内部的.env变量而不是来自php:
如果我有.env
larvel5.4的文件,我APP_URL
喜欢这个:
APP_ENV=local
APP_KEY=base64:7qLJMqTxrAPk+tLJscVlmrzf2H16tAfbSoCZuleCkxQ=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
Run Code Online (Sandbox Code Playgroud)
我有多配置变量使用域链接,如下所示:
#Facebook
FACEBOOK_LOGIN_URL=http://localhost:8000/en/portal/facebook_login
FACEBOOK_CALLBACK_URL=http://localhost:8000/en/portal/facebook_callback
#Twitter
TWITTER_LOGIN_URL=http://localhost:8000/en/portal/twitter_login
TWITTER_CALLBACK_URL=http://localhost:8000/en/portal/twitter_callback
#Google
GOOGLE_LOGIN_URL=http://localhost:8000/en/portal/google_login
GOOGLE_CALLBACK_URL=http://localhost:8000/en/portal/google_callback
Run Code Online (Sandbox Code Playgroud)
有没有办法在同一个文件中访问APP_URL,如下所示:
FACEBOOK_LOGIN_URL= APP_URL /en/portal/facebook_login
Run Code Online (Sandbox Code Playgroud)
请我是新成员,请不要给我这个问题.
谢谢你们
我有一个多复选框以相同的ATTR name
一样"Check"
,但每个复选框有不同的价值
所以我必须创建一个jQuery代码,如果我按下复选框将在PHP中做一些像这样的代码
$(document).ready(function(){
var NewsPaperId;
var UserId;
var CategoryId;
$("input[type='checkbox']").click(function() {
if ($(this).is(':checked')) {
NewsPaperId= $('input[name="Check"]:checked').val();
UserId= $(".userId").val();
CategoryId= $(".CategoryId").val();
alert(NewsPaperId);
$.post("AddAndDelete.php",
{
Add:1,
UserId: UserId,
NewsPaperId: NewsPaperId,
CategoryId:CategoryId
},
function(data, status){
alert("Data: " + data + "\nStatus: " + status);
});
} else {
NewsPaperId= $('input[name="Check"]:checked').val();
UserId= $(".userId").val();
CategoryId= $(".CategoryId").val();
alert(NewsPaperId);
$.post("AddAndDelete.php",
{
Delete:1,
UserId: UserId,
NewsPaperId: NewsPaperId,
CategoryId:CategoryId
},
function(data, status){
alert("Data: " + data + "\nStatus: " + status);
});
}
});
}); …
Run Code Online (Sandbox Code Playgroud)