REFACTORING: updated the base template with some examples, also added annotations for autocomplete in the core view and controller core.
This commit is contained in:
23
application/controller/controllerController.php
Normal file
23
application/controller/controllerController.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace Nibiru;
|
||||
|
||||
use Nibiru\Adapter\Controller;
|
||||
|
||||
class controllerController extends Controller
|
||||
{
|
||||
public function pageAction()
|
||||
{
|
||||
View::assign([
|
||||
'name' => 'rapid prototyping framework',
|
||||
'title' => 'Nibiru Controller Example',
|
||||
'css' => Config::getInstance()->getConfig()[View::NIBIRU_SETTINGS]["smarty.css"],
|
||||
'js' => Config::getInstance()->getConfig()[View::NIBIRU_SETTINGS]["smarty.js"]
|
||||
]);
|
||||
}
|
||||
|
||||
public function navigationAction()
|
||||
{
|
||||
JsonNavigation::getInstance()->loadJsonNavigationArray();
|
||||
}
|
||||
|
||||
}
|
||||
88
application/controller/formsController.php
Normal file
88
application/controller/formsController.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
namespace Nibiru;
|
||||
|
||||
use Nibiru\Adapter\Controller;
|
||||
use Nibiru\Factory\Form;
|
||||
|
||||
class formsController extends Controller
|
||||
{
|
||||
private $form;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
Form::create();
|
||||
|
||||
Form::addTypeLabel(
|
||||
array(
|
||||
'value' => 'Full Name',
|
||||
'for' => 'full-name',
|
||||
'class' => 'contacts-label'
|
||||
)
|
||||
);
|
||||
|
||||
Form::addInputTypeText(
|
||||
array(
|
||||
'name' => 'full-name',
|
||||
'required' => 'required',
|
||||
'id' => 'full-name',
|
||||
'class' => 'contacts-input form-control'
|
||||
),
|
||||
array(
|
||||
'class' => 'input-text'
|
||||
)
|
||||
);
|
||||
|
||||
Form::addTypeLabel(
|
||||
array(
|
||||
'value' => 'Email',
|
||||
'for' => 'email',
|
||||
'class' => 'contacts-label'
|
||||
)
|
||||
);
|
||||
|
||||
Form::addInputTypeText(
|
||||
array(
|
||||
'name' => 'email',
|
||||
'required' => 'required',
|
||||
'id' => 'email',
|
||||
'class' => 'contacts-input form-control'
|
||||
),
|
||||
array(
|
||||
'class' => 'input-email'
|
||||
)
|
||||
);
|
||||
|
||||
Form::addTypeButton(
|
||||
array(
|
||||
'class' => 'btn-block btn-info',
|
||||
'name' => 'Send Message'
|
||||
)
|
||||
);
|
||||
|
||||
$this->form = Form::addForm(
|
||||
array(
|
||||
'name' => 'newregister',
|
||||
'method' => 'post',
|
||||
'action' => 'YOURPOSTURL',
|
||||
'target' => '_self'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function pageAction()
|
||||
{
|
||||
View::assign([
|
||||
'name' => 'rapid prototyping framework',
|
||||
'title' => 'Nibiru Forms Example',
|
||||
'formdata' => $this->form,
|
||||
'css' => Config::getInstance()->getConfig()[View::NIBIRU_SETTINGS]["smarty.css"],
|
||||
'js' => Config::getInstance()->getConfig()[View::NIBIRU_SETTINGS]["smarty.js"]
|
||||
]);
|
||||
}
|
||||
|
||||
public function navigationAction()
|
||||
{
|
||||
JsonNavigation::getInstance()->loadJsonNavigationArray();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -12,21 +12,15 @@ use Nibiru\Adapter\Controller;
|
||||
|
||||
class indexController extends Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function pageAction()
|
||||
{
|
||||
View::getInstance()->assign(
|
||||
array(
|
||||
'name' => 'Beispielseite',
|
||||
'title' => 'Stephan Kasdorf - Nibiru Example',
|
||||
View::assign([
|
||||
'name' => 'rapid prototyping framework',
|
||||
'title' => 'Nibiru Example Startpage',
|
||||
'css' => Config::getInstance()->getConfig()[View::NIBIRU_SETTINGS]["smarty.css"],
|
||||
'js' => Config::getInstance()->getConfig()[View::NIBIRU_SETTINGS]["smarty.js"]
|
||||
)
|
||||
);
|
||||
]);
|
||||
}
|
||||
|
||||
public function navigationAction()
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"navigation" :
|
||||
{
|
||||
"Home": { "link": "/", "tooltip": "Home", "icon": "icon icon-home", "footer": "false" }
|
||||
"Home": { "link": "/", "tooltip": "Home", "icon": "icon icon-home", "footer": "false" },
|
||||
"Controller": { "link": "/controller", "tooltip": "Controller", "icon": "icon icon-pencil", "footer": "false" },
|
||||
"Forms": { "link": "/forms", "tooltip": "Forms", "icon": "icon icon-clipboard", "footer": "false" }
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ smarty.css[] = "public/css/v3/toolkit-inverse.css"
|
||||
smarty.css[] = "public/css/v3/application.css"
|
||||
smarty.css[] = "public/css/v3/jquery-ui.css"
|
||||
smarty.css[] = "public/css/v3/nibiru-debug.css"
|
||||
smarty.css[] = "public/css/v3/tiamat-form.css"
|
||||
;;smarty.css[] = "public/css/v3/tiamat-form.css"
|
||||
smarty.js[] = "public/js/v3/jquery.min.js"
|
||||
smarty.js[] = "public/js/v3/tether.min.js"
|
||||
smarty.js[] = "public/js/v3/jquery-ui.js"
|
||||
@@ -48,7 +48,8 @@ smarty.js[] = "public/js/v3/nibiru-debug.js"
|
||||
|
||||
[ROUTING]
|
||||
route[index] = "/"
|
||||
route[example] = "/example"
|
||||
route[controller] = "/controller"
|
||||
route[forms] = "/forms"
|
||||
|
||||
[DATABASE]
|
||||
username = "YOURUSER"
|
||||
|
||||
31
application/view/templates/controller.tpl
Normal file
31
application/view/templates/controller.tpl
Normal file
@@ -0,0 +1,31 @@
|
||||
{include 'shared/header.tpl'}
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="with-iconav">
|
||||
{include file="navigation.tpl"}
|
||||
</div>
|
||||
<div class="col-sm-12 content">
|
||||
<div class="dashhead">
|
||||
<div class="dashhead-titles">
|
||||
<h6 class="dashhead-subtitle">{$name}</h6>
|
||||
<h2 class="dashhead-title">{$title}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="col-lg-12">
|
||||
<div class="col-md-12 text-center"><img src="public/img/logos/MediumSquareLogo.png"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="col-md-12 text-center">This is just a basic example for a controller, for more details read this section: <a href="https://www.nibiru-framework.com/documentation/controller">Controllers</a>. </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include 'shared/footer.tpl'}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
34
application/view/templates/forms.tpl
Normal file
34
application/view/templates/forms.tpl
Normal file
@@ -0,0 +1,34 @@
|
||||
{include 'shared/header.tpl'}
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="with-iconav">
|
||||
{include file="navigation.tpl"}
|
||||
</div>
|
||||
<div class="col-sm-12 content">
|
||||
<div class="dashhead">
|
||||
<div class="dashhead-titles">
|
||||
<h6 class="dashhead-subtitle">Rapid Prototyping Framework</h6>
|
||||
<h2 class="dashhead-title">{$title}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="col-md-12 text-center"><img src="public/img/logos/MediumSquareLogo.png"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{$formdata}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="col-md-12 text-center">This is just a basic example for a form, for more details read this section: <a href="https://www.nibiru-framework.com/documentation/forms">Forms</a>. </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include 'shared/footer.tpl'}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -7,39 +7,25 @@
|
||||
<div class="col-sm-12 content">
|
||||
<div class="dashhead">
|
||||
<div class="dashhead-titles">
|
||||
<h6 class="dashhead-subtitle">Rapid Prototyping Framework</h6>
|
||||
<h2 class="dashhead-title">Nibiru</h2>
|
||||
<h6 class="dashhead-subtitle">{$name}</h6>
|
||||
<h2 class="dashhead-title">{$title}</h2>
|
||||
</div>
|
||||
<div class="btn-toolbar dashhead-toolbar">
|
||||
<div class="btn-toolbar-item input-with-icon">
|
||||
<input type="text" value="01/01/15 - 01/08/15" class="form-control" data-provide="datepicker">
|
||||
<span class="icon icon-calendar"></span>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="col-lg-12">
|
||||
<div class="col-md-12 text-center"><img src="public/img/logos/MediumSquareLogo.png"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="col-md-12 text-center">This is just a basic example, for more details read this section: <a href="https://www.nibiru-framework.com/">Nibiru Framework</a>. </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="docsModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">Example modal</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p>You're looking at an example modal in the dashboard theme.</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-dismiss="modal">Cool, got it!</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include 'shared/footer.tpl'}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user