我xampp在网络上安装了一个comupter(例如A),我设置了IP,apache因此网络中的用户都可以访问localhost 机器A.我在htdocs目录中安装了一个web项目,这样用户就可以看到该页面使用了IP_OF_MACHINE/project.问题是他们可以看到IP_OF_MACHINE/xampp或IP_OF_MACHINE/phpmyadmin页面,而我希望他们只能看到project其他页面.我怎样才能做到这一点?
我需要0,1,2,...,9用\xD9\xA0,\xD9\xA1,\xD9\xA2,...,\xD9\xA9字符串替换字符。该字符串来自CKEditor,因此它可能包含html标记。使用以下代码
$body = str_replace("1", "\xD9\xA1", $body);
Run Code Online (Sandbox Code Playgroud)
它用替换所有内容1,\xD9\xA1从而影响标签<h1>,<table border="1">同时我只需要替换正文中的数字而不是标签。
包含数字的标签是表标签的<h0><h1><h2><h3><h4><h5><h6>和cellspacing和cellpadding和border。
在不影响<h0><h1><h2><h3><h4><h5><h6>and cellspacing和cellpaddingand的情况下,border如何用上述符号替换数字?
这是我的代码,您也可以从http://cpp.sh/5lsds运行它
#include "iostream"
using namespace std;
class X{
private:
int c;
public:
X(){}
X(int b){
c = 11;
}
int getC();
};
class Z:public X{
public:
Z(int n){
X(23);
}
};
int main()
{
Z z(1);
cout<<z.getC()<<endl;
return 0;
}
int X::getC(){
return c;
}
Run Code Online (Sandbox Code Playgroud)
我需要有X(){}行,因为子构造函数需要调用父默认构造函数.
如果从http://cpp.sh/5lsds运行该程序,您可以看到输出是0我期望的那样11.由于Z构造X函数使用int参数调用构造函数,并将c值设置为11但输出为0.
这是web.php
Route::group(['middleware' => 'auth'],
function () {
Route::get('letters/getRows', 'LetterController@getRows')->name('letters.getRows');
Route::get('letters/{letter}/A4', 'LetterController@A4')->name('letters.A4');
Route::get('letters/{letter}/A5', 'LetterController@A5')->name('letters.A5');
Route::resource('letters', 'LetterController');
}
);
Run Code Online (Sandbox Code Playgroud)
我创建了一个链接如下
"<a class='mx-2 h5' href='".route('letters.destroy', $entity->id)."'><i class='icon-remove-circle'></i></a>".
Run Code Online (Sandbox Code Playgroud)
其中 the$entity->id是id字母的。问题是,它链接到show方法而不是destroy方法。我能做些什么?
使用这样的表格
{{ Form::open(array('route' => array('letters.destroy', $entity->id), 'method' => 'delete')) }}
<button type="submit" >Delete Account</button>
{{ Form::close() }}
Run Code Online (Sandbox Code Playgroud)
可能会解决问题,但我想使用a标签而不是表单。
其中php artisan route:list,destroy 和 show 的 url 是相同的
谢谢
这是我第一次在 Laravel 5.8 中使用 Api Resource 将数据返回到应用程序。有一个User模型包含有关用户的一些公共和私人信息。用户可以查看他/她的所有信息(如姓名、电话号码、电子邮件等),但其他人只能查看姓名和用户名。我该如何在 Api 资源中处理这个问题?
提前致谢。
我们机构有大约28000篇文章,其编码不是utf-8.我被要求找到一种方法将其编码更改为utf-8.是否有任何linux或Windows命令更改文件的编码而不打开文件?显然,打开28000个文件并逐个更改它们并不是一个好主意!
我正在使用一个支付包,它返回 RedirecResponse 类的实例,然后用户被重定向到支付页面。
我需要在移动应用程序中使用它。我不知道如何告诉应用程序打开该付费页面。我无法将 RedirecResponse 实例返回给应用程序,因此我必须从 RedirecResponse 实例中获取支付页面的 url,然后将其返回给应用程序,然后应用程序必须打开浏览器。
该TargetUrl属性包含 url,但 Laravel 在访问此属性时返回以下错误:
无法访问受保护的属性 Illuminate\Http\RedirectResponse::$targetUrl
如何从 RedirectResponse 获取 url?
谢谢
laravel-5 ×3
laravel ×2
php ×2
apache ×1
c++ ×1
constructor ×1
crud ×1
encoding ×1
htdocs ×1
html-parsing ×1
inheritance ×1
laravel-5.8 ×1
oop ×1
phpmyadmin ×1
regex ×1
replace ×1
string ×1
utf-8 ×1
xampp ×1