|
@@ -568,11 +568,21 @@ class GenController {
|
|
unlink(resource_path("views/{$controller->root}/{$controller->parentControllerName}/actions.blade.php"));
|
|
unlink(resource_path("views/{$controller->root}/{$controller->parentControllerName}/actions.blade.php"));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // write info view
|
|
|
|
+ $text = file_get_contents(base_path('generatecv/tree-templates/info.template.blade.php'));
|
|
|
|
+ $text = str_replace("_NAME_", $this->snakeToTitleCase($controller->name), $text);
|
|
|
|
+ $text = str_replace("_UID_", '<?= $record->uid ?>', $text);
|
|
|
|
+ $text = str_replace("_INDEX_ROUTE_", $controller->name . '-index', $text);
|
|
|
|
+ $this->file_force_contents(resource_path("views/{$controller->root}/{$controller->name}/info.blade.php"), $text);
|
|
|
|
+ echo "Generated " . resource_path("views/{$controller->root}/{$controller->name}/info.blade.php") . "\n";
|
|
|
|
+
|
|
|
|
+ // write main view
|
|
$text = file_get_contents(base_path('generatecv/tree-templates/show.template.blade.php'));
|
|
$text = file_get_contents(base_path('generatecv/tree-templates/show.template.blade.php'));
|
|
$text = str_replace("_NAME_", $this->snakeToTitleCase($controller->name), $text);
|
|
$text = str_replace("_NAME_", $this->snakeToTitleCase($controller->name), $text);
|
|
$text = str_replace("_UID_", '<?= $record->uid ?>', $text);
|
|
$text = str_replace("_UID_", '<?= $record->uid ?>', $text);
|
|
$text = str_replace("_INDEX_ROUTE_", $controller->name . '-index', $text);
|
|
$text = str_replace("_INDEX_ROUTE_", $controller->name . '-index', $text);
|
|
$text = str_replace("_SUB_LINKS_VIEW_", "{$controller->root}/{$controller->name}/subs", $text);
|
|
$text = str_replace("_SUB_LINKS_VIEW_", "{$controller->root}/{$controller->name}/subs", $text);
|
|
|
|
+ $text = str_replace("_INFO_VIEW_", "{$controller->root}/{$controller->name}/info", $text);
|
|
$this->file_force_contents(resource_path("views/{$controller->root}/{$controller->name}/{$method->name}.blade.php"), $text);
|
|
$this->file_force_contents(resource_path("views/{$controller->root}/{$controller->name}/{$method->name}.blade.php"), $text);
|
|
echo "Generated " . resource_path("views/{$controller->root}/{$controller->name}/{$method->name}.blade.php") . "\n";
|
|
echo "Generated " . resource_path("views/{$controller->root}/{$controller->name}/{$method->name}.blade.php") . "\n";
|
|
}
|
|
}
|
|
@@ -813,11 +823,11 @@ class GenController {
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
$text = str_replace("_SUB_VIEW_",
|
|
$text = str_replace("_SUB_VIEW_",
|
|
- "<h4 class='py-3 border-bottom'>" .
|
|
|
|
- $this->camelToTitleCase($this->snakeToTitleCase($method->name)) . "</h4>" .
|
|
|
|
|
|
+ "<h5 class='py-3 border-bottom'>" .
|
|
|
|
+ $this->camelToTitleCase($this->snakeToTitleCase($method->name)) . "</h5>" .
|
|
"Controller: <b>{$controller->name}</b><br>" .
|
|
"Controller: <b>{$controller->name}</b><br>" .
|
|
"Action: <b>{$method->name}()</b><br>" .
|
|
"Action: <b>{$method->name}()</b><br>" .
|
|
- "View: <b>{$controller->root}/{$controller->name}/{$method->name}.blade.php</b><br>",
|
|
|
|
|
|
+ "View: <b>{$controller->root}/{$controller->name}/{$method->name}.blade.php</b><br><br>",
|
|
$text);
|
|
$text);
|
|
}
|
|
}
|
|
return $text;
|
|
return $text;
|