Version 0.3 beta 04.02.2018
Improved: The Router now accepts actions, either trough the _action as parameter, or on the URL pattern after the controller name Example: http://youdomain/[controllername]/[actionname]/ It is now possible to load as many navigations on the page as wanted by passing the name to the JsonNavigation::getInstance()->loadJsonNavigationArray('[NAME]'); call in the navigationAction of the Controller Building forms by simple adding the namespace use Nibiru\Factory\Form; and calling Example: Form::addInputTypeText( array( 'name' => 'lastname', 'value' => 'placeholder' ) ); To finalize the form the last call should be something like this: Form::addForm( array('name' => 'testform', 'method' => 'post', 'action' => '/' . Router::getInstance()->currentPage(), 'target' => '_self') ); The Database design has fully been refactored, now it contains an autoloading mechanism which can be triggert by createing a database folder in the application folder, a Example file is in the folder applicatoin/database The Database access can now be implemented anywhere in your application by adding the namespace to your database accessing Logic: use Nibiru\Factory\Db;
This commit is contained in:
@@ -12,9 +12,10 @@ class View extends Controller implements IView
|
||||
{
|
||||
private static $_instance;
|
||||
|
||||
const ATM_SETTINGS = "SETTINGS";
|
||||
const ATM_ROUTING = "ROUTING";
|
||||
const ATM_FILE_END = ".tpl";
|
||||
const NIBIRU_SETTINGS = "SETTINGS";
|
||||
const NIBIRU_SECURITY = "SECURITY";
|
||||
const NIBIRU_ROUTING = "ROUTING";
|
||||
const NIBIRU_FILE_END = ".tpl";
|
||||
|
||||
private static $smarty = array();
|
||||
private static $engine = array();
|
||||
@@ -99,10 +100,10 @@ class View extends Controller implements IView
|
||||
|
||||
public function display( $page )
|
||||
{
|
||||
preg_match_all("/".self::ATM_FILE_END."/", $page, $matches);
|
||||
if(!array_key_exists(self::ATM_FILE_END, array_flip(array_shift($matches))))
|
||||
preg_match_all("/".self::NIBIRU_FILE_END."/", $page, $matches);
|
||||
if(!array_key_exists(self::NIBIRU_FILE_END, array_flip(array_shift($matches))))
|
||||
{
|
||||
$page = str_replace("/", "", $page) . self::ATM_FILE_END;
|
||||
$page = str_replace("/", "", $page) . self::NIBIRU_FILE_END;
|
||||
}
|
||||
Controller::getInstance()->action( $this->getEngine(), $page );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user