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;
38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?php
|
|
namespace Nibiru\Form;
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: mithril
|
|
* Date: 26.01.18
|
|
* Time: 20:59
|
|
*/
|
|
|
|
interface IForm
|
|
{
|
|
/**
|
|
* @desc Constant Form attributes
|
|
*/
|
|
const FORM_NAME = 'name';
|
|
const FORM_VALUE = 'value';
|
|
const FORM_METHOD = 'method';
|
|
const FORM_METHOD_TYPE = array('post', 'get');
|
|
const FORM_ACTION = 'action';
|
|
const FORM_TARGET = 'target';
|
|
const FORM_TARGET_TYPE = array('_blank', '_self', '_parent', '_top');
|
|
const FORM_TYPE_TEXT = 'text';
|
|
const FORM_TYPE_SUBMIT = 'submit';
|
|
const FORM_TYPE_BUTTON = 'button';
|
|
const FORM_ATTRIBUTE_ROWS = 'rows';
|
|
const FORM_ATTRIBUTE_COLS = 'cols';
|
|
const FORM_ATTRIBUTE_SPEECH = 'speech';
|
|
const FORM_ATTRIBUTE_SRC = 'src';
|
|
const FORM_ATTRIBUTE_ALT = 'alt';
|
|
const FORM_ATTRIBUTE_ID = 'id';
|
|
|
|
/**
|
|
* @desc loads the current Form element to the form
|
|
* @param $element
|
|
* @return mixed
|
|
*/
|
|
public function loadElement( $attributes );
|
|
} |