我是10月CMS的新手,正在学习创建Form Widget。但是我收到以下错误:
The partial '_field_actorbox.htm' is not found.
/opt/lampp/htdocs/octobermovies/modules/system/traits/ViewMaker.php line 65
Run Code Online (Sandbox Code Playgroud)
我的小部件文件夹名称是“ formwidgets”我的partials文件夹中的零件文件名称是“ _widget.htm”我的formwidgets的内容> Actorbox.php
namespace Watchlearn\Movies\FormWidgets;
use Backend\Classes\FormWidgetBase;
use Config;
class ActorBox extends FormWidgetBase
{
public function widgetDetails()
{
return [
'name' => 'Actorbox',
'description' => 'Field for adding actors'
];
}
public function render(){
return $this->makePartial('widget');
}
public function loadAssets()
{
$this->addCss('css/select2.css');
$this->addJs('js/select2.js');
}
}
Run Code Online (Sandbox Code Playgroud)
我在plugin.php中注册小部件的代码
public function registerFormWidgets()
{
return [
'Watchlearn\Movies\FormWidgets\ActorBox' => [
'label' => 'ActorBox Field',
'code' => 'actorbox'
]
];
}
Run Code Online (Sandbox Code Playgroud)
我也尝试查找并查看了文档,但是找不到任何解决方案。
我正在尝试将 Laravel Breeze 转换为使用 Livewire。注册完成后,我尝试将其重定向到仪表板,但它抛出以下错误
livewire.js?id=11c49d7e:6889 Uncaught (in promise) TypeError: Alpine.navigate is not a function
我检查了源代码,可以看到 Alpine 已正确加载,但仍然出现此错误。
我的代码:
布局:app.blade.php
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'Laravel') }}</title>
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
<!-- Scripts -->
@vite(['resources/css/app.css', 'resources/js/app.js'])
@livewireStyles
</head>
<body class="font-sans antialiased @auth @else text-gray-900 @endauth">
@auth
<div class="min-h-screen bg-gray-100">
@include('layouts.navigation')
<!-- Page Heading -->
@if (isset($header))
<header …Run Code Online (Sandbox Code Playgroud)