1
我正在開發一個插件的後端,我有一些問題需要解決。我創建了所有插件所需的文件,模型,註冊內容等,但是隨時嘗試訪問後端URL,例如http://alomicuba.dev/backend/alomicuba/balancerecharge
我收到404錯誤,我不知道我做錯了什麼。這是/plugins/alomicuba/balancerecharge/controllers/balancerecharge/BalanceRecharge.php
文件中的代碼:「找不到頁面」第一個插件爲OctoberCMS
<?php namespace Alomicuba\BalanceRecharge\Controllers;
use Flash;
use BackendMenu;
use Backend\Classes\Controller;
use System\Classes\SettingsManager;
use Alomicuba\RechargeBalance\Models\Settings as BalanceRechargeSettings;
class BalanceRecharge extends Controller
{
public $implement = [
'Backend.Behaviors.FormController',
'Backend.Behaviors.ListController'
];
public $formConfig = 'config_form.yaml';
public $listConfig = 'config_list.yaml';
public $requiredPermissions = ['balancerecharge.*'];
public $bodyClass = 'compact-container';
public function __construct()
{
parent::__construct();
BackendMenu::setContext('Alomicuba.BalanceRecharge', 'balancerecharge');
SettingsManager::setContext('Alomicuba.BalanceRecharge', 'settings');
}
}
這是Plugin.php
代碼:
class Plugin extends PluginBase {
/**
* Returns information about this plugin.
*
* @return array
*/
public function pluginDetails()
{
return [
'name' => 'Balance Recharge',
'description' => 'Plugin that allows users to recharge theirs balance through the PayPal payment gateway',
'author' => 'Dynamo Technology Solutions',
'icon' => 'icon-credit-card'
];
}
public function registerNavigation()
{
return [
'bradmin' => [
'label' => 'Balance Recharge',
'url' => Backend::url('alomicuba/balancerecharge/balancerecharge'),
'icon' => 'icon-credit-card',
'permissions' => ['brecharge.*'],
'order' => 500,
'sideMenu' => [
'brecharge' => [
'label' => 'Balance Recharge',
'icon' => 'icon-credit-card',
'url' => Backend::url('alomicuba/balancerecharge/balancerecharge'),
'permissions' => ['brecharge.*'],
],
]
]
];
}
public function registerSettings()
{
return [
'settings' => [
'label' => 'Balance Recharge PayPal Configuration',
'description' => 'Manage the settings for Balance Recharge.',
'category' => 'AloMiCuba',
'icon' => 'icon-cog',
'class' => 'Alomicuba\BalanceRecharge\Models\Settings',
'order' => 100
]
];
}
public function boot()
{
\App::register('Barryvdh\Omnipay\ServiceProvider');
\Illuminate\Foundation\AliasLoader::getInstance()->alias('Omnipay', 'Barryvdh\Omnipay\Facade');
UserModel::extend(function($model){
$model->hasMany['payment'] = ['Alomicuba\BalanceRecharge\Models\Payment'];
});
}
public function registerComponents()
{
return [
'Alomicuba\BalanceRecharge\Components\Payment' => 'Payment'
];
}
}
我在這裏失去了一些東西?
你能過去plugin.php代碼 – 2014-11-04 05:38:05
@anandpatel做,我加入到主哨,你也可以看看[這個](http://stackoverflow.com/questions/26722454/set-value-for-amounttorelad-var-so-it-can-be-accessed-on-any-method-在課堂上)的職位?也許你可以給我一個比我在那裏更好的答案,因爲你已經開發了10月插件已經 – ReynierPM 2014-11-04 12:36:42
試試這個http://alomicuba.dev/backend/alomicuba/balancerecharge/balancerecharge – 2014-11-04 12:42:44