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;
72 lines
1.4 KiB
PHP
72 lines
1.4 KiB
PHP
<?php
|
|
namespace Nibiru\Adapter;
|
|
use Nibiru\IDb;
|
|
use Nibiru\Pdo;
|
|
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: Stephan Kadsorf
|
|
* Date: 26.01.18
|
|
* Time: 17:24
|
|
*/
|
|
|
|
abstract class Db implements IDb
|
|
{
|
|
private static $table = array();
|
|
|
|
protected static function initTable( $table = array() )
|
|
{
|
|
self::setTable( $table );
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
protected static function getTable()
|
|
{
|
|
return self::$table;
|
|
}
|
|
|
|
/**
|
|
* @param array $table
|
|
*/
|
|
private static function setTable( $table = array() )
|
|
{
|
|
if( sizeof($table)>0 )
|
|
{
|
|
self::$table = $table;
|
|
}
|
|
}
|
|
|
|
public function loadTableAsArray()
|
|
{
|
|
$result = Pdo::fetchTableAsArray( self::getTable()['table'] );
|
|
return $result;
|
|
}
|
|
|
|
public function selectRowsetById($id = false)
|
|
{
|
|
// TODO: Implement selectRowsetById() method.
|
|
}
|
|
|
|
public function insertRowsetById($rowset = array(), $id = false)
|
|
{
|
|
// TODO: Implement insertRowsetById() method.
|
|
}
|
|
|
|
public function selectDatasetByMinMax($min = false, $max = false)
|
|
{
|
|
// TODO: Implement selectDatasetByMinMax() method.
|
|
}
|
|
|
|
public function insertArrayIntoTable($dataset = array())
|
|
{
|
|
// TODO: Implement insertArrayIntoTable() method.
|
|
}
|
|
|
|
public function nextInsertIndex()
|
|
{
|
|
// TODO: Implement nextInsertIndex() method.
|
|
}
|
|
|
|
} |