bt-trader init
This commit is contained in:
parent
0a67d96784
commit
4e5c743db2
@ -18,10 +18,11 @@ $routes->group('cli', ['namespace' => 'App\Controllers\CLI'], function ($routes)
|
||||
});
|
||||
|
||||
$routes->group('', ['namespace' => 'App\Controllers\Front'], function ($routes) {
|
||||
$routes->get('/', 'WelcomeController::index');
|
||||
$routes->group('inquiry', function ($routes) {
|
||||
$routes->post('create', 'InquiryController::create');
|
||||
});
|
||||
$routes->get('/', 'PageController::index');
|
||||
$routes->get('about-us', 'PageController::about-us');
|
||||
$routes->get('products', 'PageController::products');
|
||||
$routes->get('logistics-services', 'PageController::logistics_services');
|
||||
$routes->get('contact', 'PageController::contact');
|
||||
});
|
||||
$routes->group('auth', ['namespace' => 'App\Controllers\Auth'], function ($routes) {
|
||||
$routes->get('login', 'LocalController::login_form');
|
||||
|
||||
@ -79,7 +79,15 @@ class Services extends BaseService
|
||||
new \App\Models\UserModel()
|
||||
);
|
||||
}
|
||||
|
||||
public static function pageservice($getShared = true): BoardService
|
||||
{
|
||||
if ($getShared) {
|
||||
return static::getSharedInstance(__FUNCTION__);
|
||||
}
|
||||
return new BoardService(
|
||||
new \App\Models\BoardModel(),
|
||||
);
|
||||
}
|
||||
public static function boardservice($getShared = true): BoardService
|
||||
{
|
||||
if ($getShared) {
|
||||
|
||||
@ -6,13 +6,13 @@ use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class WelcomeController extends FrontController
|
||||
class PageController extends FrontController
|
||||
{
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
parent::initController($request, $response, $logger);
|
||||
if ($this->service === null) {
|
||||
$this->service = service('userservice');
|
||||
$this->service = service('pageservice');
|
||||
}
|
||||
}
|
||||
protected function action_init_process(string $action, array $formDatas = []): void
|
||||
@ -32,6 +32,30 @@ class WelcomeController extends FrontController
|
||||
{
|
||||
$action = __FUNCTION__;
|
||||
$this->action_init_process($action);
|
||||
return $this->action_render_process($action, $this->getViewDatas(), $this->request->getVar('ActionTemplate') ?? "welcome");
|
||||
return $this->action_render_process('welcome', $this->getViewDatas(), $this->request->getVar('ActionTemplate') ?? "page");
|
||||
}
|
||||
public function about_us(): string
|
||||
{
|
||||
$action = __FUNCTION__;
|
||||
$this->action_init_process($action);
|
||||
return $this->action_render_process($action, $this->getViewDatas(), $this->request->getVar('ActionTemplate') ?? "page");
|
||||
}
|
||||
public function products(): string
|
||||
{
|
||||
$action = __FUNCTION__;
|
||||
$this->action_init_process($action);
|
||||
return $this->action_render_process($action, $this->getViewDatas(), $this->request->getVar('ActionTemplate') ?? "page");
|
||||
}
|
||||
public function logistics_services(): string
|
||||
{
|
||||
$action = __FUNCTION__;
|
||||
$this->action_init_process($action);
|
||||
return $this->action_render_process($action, $this->getViewDatas(), $this->request->getVar('ActionTemplate') ?? "page");
|
||||
}
|
||||
public function contact(): string
|
||||
{
|
||||
$action = __FUNCTION__;
|
||||
$this->action_init_process($action);
|
||||
return $this->action_render_process($action, $this->getViewDatas(), $this->request->getVar('ActionTemplate') ?? "page");
|
||||
}
|
||||
}
|
||||
@ -12,6 +12,7 @@ class GoogleForm extends CommonForm
|
||||
}
|
||||
public function action_init_process(string $action, array &$formDatas = []): void
|
||||
{
|
||||
parent::action_init_process($action, $formDatas);
|
||||
$fields = ['access_code'];
|
||||
$filters = [];
|
||||
switch ($action) {
|
||||
|
||||
@ -12,6 +12,7 @@ class LocalForm extends CommonForm
|
||||
}
|
||||
public function action_init_process(string $action, array &$formDatas = []): void
|
||||
{
|
||||
parent::action_init_process($action, $formDatas);
|
||||
$fields = ['id', 'passwd'];
|
||||
$filters = [];
|
||||
switch ($action) {
|
||||
|
||||
@ -12,6 +12,7 @@ class BoardForm extends CommonForm
|
||||
}
|
||||
public function action_init_process(string $action, array &$formDatas = []): void
|
||||
{
|
||||
parent::action_init_process($action, $formDatas);
|
||||
$fields = [
|
||||
'category',
|
||||
'worker_uid',
|
||||
|
||||
@ -13,6 +13,7 @@ class InquiryForm extends CommonForm
|
||||
}
|
||||
public function action_init_process(string $action, array &$formDatas = []): void
|
||||
{
|
||||
parent::action_init_process($action, $formDatas);
|
||||
$fields = [
|
||||
'title',
|
||||
'email',
|
||||
|
||||
@ -12,6 +12,7 @@ class UserForm extends CommonForm
|
||||
}
|
||||
public function action_init_process(string $action, array &$formDatas = []): void
|
||||
{
|
||||
parent::action_init_process($action, $formDatas);
|
||||
$fields = [
|
||||
'id',
|
||||
'passwd',
|
||||
|
||||
@ -126,11 +126,11 @@
|
||||
<!-- Menu -->
|
||||
<div class="collapse navbar-collapse justify-content-center" id="btNav">
|
||||
<ul class="navbar-nav align-items-center">
|
||||
<li class="nav-item"><a class="nav-link" href="#home">Home</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#about">About Us</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#products">Products</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#logistics">Logistics & Services</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#contact">Contact</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/">Home</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/about-us">About Us</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/products">Products</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/logistics-services">Logistics & Services</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/contact">Contact</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user