Link to the form must be with a absolute path
This commit is contained in:
@@ -15,6 +15,7 @@ class GeneratorController {
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Schema\Wrapper as Wrapper;
|
use Schema\Wrapper as Wrapper;
|
||||||
|
use App\Core\Sanity\MigratorController as Migrator;
|
||||||
|
|
||||||
function {{PLUGIN_NAME}}_upgrade(\$pluginversion) {
|
function {{PLUGIN_NAME}}_upgrade(\$pluginversion) {
|
||||||
if (\$pluginversion < "0.0.1") {
|
if (\$pluginversion < "0.0.1") {
|
||||||
@@ -188,8 +189,14 @@ class GeneratorController {
|
|||||||
<<<EOL
|
<<<EOL
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Core\Template\Output as Output;
|
||||||
use Routes\RouteCollection as RouteCollection;
|
use Routes\RouteCollection as RouteCollection;
|
||||||
|
|
||||||
|
//Menu itens
|
||||||
|
RouteCollection::get('*', function() {
|
||||||
|
Output::addMenu('/{{PLUGIN_NAME}}', '{{PLUGIN_NAME}}', "<i class='fa fa-fa-cubes'></i>", ['class' => 'nav-link']);
|
||||||
|
}, -10)->doIgnore();
|
||||||
|
|
||||||
RouteCollection::group("/{{PLUGIN_NAME}}", function(){
|
RouteCollection::group("/{{PLUGIN_NAME}}", function(){
|
||||||
RouteCollection::get ("/", "\{{NAMESPACE}}\{{CONTROLLER}}@index");
|
RouteCollection::get ("/", "\{{NAMESPACE}}\{{CONTROLLER}}@index");
|
||||||
RouteCollection::get ("/form", "\{{NAMESPACE}}\{{CONTROLLER}}@create");
|
RouteCollection::get ("/form", "\{{NAMESPACE}}\{{CONTROLLER}}@create");
|
||||||
@@ -203,7 +210,7 @@ class GeneratorController {
|
|||||||
|
|
||||||
private $indexTemplate =
|
private $indexTemplate =
|
||||||
<<<EOL
|
<<<EOL
|
||||||
<a href='{{ENDPOINT}}/form' >Adicionar </a>
|
<a href='/{{ENDPOINT}}/form' >Adicionar </a>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class='table'>
|
<table class='table'>
|
||||||
|
|
||||||
@@ -284,7 +291,7 @@ class GeneratorController {
|
|||||||
file_put_contents(DIR_APP.$subname . "/" . $name . "/lang/en.php", $this->langBase);
|
file_put_contents(DIR_APP.$subname . "/" . $name . "/lang/en.php", $this->langBase);
|
||||||
file_put_contents(DIR_APP.$subname . "/" . $name . "/lang/".APP_LANG.".php", $this->langBase);
|
file_put_contents(DIR_APP.$subname . "/" . $name . "/lang/".APP_LANG.".php", $this->langBase);
|
||||||
|
|
||||||
$this->migrationBase = str_replace("{{PLUGIN_NAME}}", $plugin_name, $this->migrationBase);
|
$this->migrationBase = str_replace("{{PLUGIN_NAME}}", $subname."_".$plugin_name, $this->migrationBase);
|
||||||
file_put_contents(DIR_APP.$subname . "/" . $name . "/db/Migrate.php", $this->migrationBase);
|
file_put_contents(DIR_APP.$subname . "/" . $name . "/db/Migrate.php", $this->migrationBase);
|
||||||
|
|
||||||
$this->routeBase = str_replace("{{NAMESPACE}}", $namespace, $this->routeBase);
|
$this->routeBase = str_replace("{{NAMESPACE}}", $namespace, $this->routeBase);
|
||||||
|
|||||||
Reference in New Issue
Block a user