Hubleto Framework
Hubleto Framework is a foundation for the further development of the Hubleto ERP.
Hubleto ERP uses the Hubleto Framework and extends its functionality. We recommend you to learn Hubleto Framework first.
Highlights
Hubleto Framework follows standard MVC architecture and implements fundamental features to develop any application, not only ERP.
- secure and flexible routing patterns
- user management and ACL permissions
- elementary controllers and views for rendering the app's UI
- database access using Laravel's Eloquent ORM
- HTML rendering using Twig
- app management for easy customizations
- full-featured CRUD endpoints and UI components
It also supports hybrid HTML-React architecture for creating nice looking and full-featured user interface.
Code examples
Browse through the code examples below to get the feeling of how it all works.
$this->router()->get([
'/^accounting\/api\/add-entry-line?$/' => Controllers\Api\AddEntryLine::class,
'/^accounting\/api\/post-invoice?$/' => Controllers\Api\PostInvoice::class,
'/^accounting\/books(\/(?<recordId>\d+))?\/?$/' => Controllers\Books::class,
'/^accounting\/books\/add\/?$/' => [
'controller' => Controllers\Books::class,
'vars' => ['recordId' => -1]
],
]);
Adding custom routes for the controller
class Books extends \Hubleto\Erp\Controller {
public function prepareView(): void {
parent::prepareView();
$this->setView('@Hubleto:App:Enterprise:Accounting/Books.twig');
}
}
Simple controller to render the list of books
<hblreact-accounting-tree-books
int:record-id=""
string:fulltext-search=''
json:filters='null'
></hblreact-accounting-tree-books>
Rendering a table in the view - list of books
export default class TableBooks extends TableExtended {
static defaultProps = {
...TableExtended.defaultProps,
model: 'Hubleto/App/Enterprise/Accounting/Models/Book',
}
constructor(props: TableBooksProps) {
super(props);
this.state = this.getStateFromProps(props);
}
renderForm(): JSX.Element {
return <FormBook {...this.getFormProps()}/>;
}
}
React component for the list of books
export default class FormBook<P, S> extends FormExtended {
static defaultProps: any = {
...FormExtended.defaultProps,
model: 'Hubleto/App/Enterprise/Accounting/Models/Book'
};
props: FormBookProp;
state: FormBookState;
constructor(props: FormBookProp) {
super(props);
this.state = this.getStateFromProps(props),
}
renderTitle(): JSX.Element {
return this.state.record.name ?? '-';
}
renderContent(): JSX.Element {
return <>
{this.inputWrapper('name')}
{this.inputWrapper('notes')}
<TableAccounts
uid='book_table_accounts'
idBook={this.state.record.id}
/>
</>;
}
}
React component for the book detail
Documentation
Ready to learn Hubleto Framework? Good choice. Go through these pages and become a CRM/ERP developer.
Views
Controllers
Extendibles
Testing
