![](/img/trans.png)
[英]I wrote a Wordpress Plugin Shortcode and it gives me a Header Allready sent error when i try to update a page with that shortcode
[英]Although I created the route correctly But when I try to show the page It gives me an error page not found
這是我在 MemberController 中的 function
public function text(){
return "hello";
}
這是我的路線
Route::get('/text',[MemberController::class,'text']);
所以,基本上它無法讀取我創建的新路線。 提前致謝
希望您使用 laravel 8 及以上版本應該是您的 controller 代碼(MemberController.php)
<?php
namespace App\Http\Controllers;
class MemberController extends Controller{
public function text(){
return "hello";
}
}
這應該是您的路線代碼(web.php)
<?php
use App\Http\Controllers\MemberController;
Route::get('/text',[MemberController::class,'text']);
您提供的代碼是不夠的,但您可以檢查以下內容。
php artisan route:clear
以清除緩存的路由。web.php
file then, your actual url should be: http://localhost:8000/text.api.php
file then, your url should be: http://localhost:8000/api/text.
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.