Releases: nova-framework/framework
Update Persian language Make RTL Layouts Up-to-date
Merge pull request #950 from amiroperator/master Update Persian language Make RTL Layouts Up-to-date
Introduce a split the Application
This pull request introduce a split the Application finishing logic from Support\Facades\Session to Support\Facades\App.
To note that because the affected logic is a internal used API, there are no public API changes or breaks.
Fire the Event 'nova.framework.booting' before starting the Routing
Added a Cache demo to the Demo Controller.
Add the VERSION definition, reading the root file VERSION.txt
Improve the flash Messages management and fixes on Users module
Merge pull request #940 from LuckyCyborg/master Improve the flash Messages management and fixes on Users module
introduce a series of optimizations on Routing
This pull request introduce a series of optimizations on Routing, and some improvements which enhance the abilities of the end-user to control the Routing behavior.
The notable improvements are the ability to pass custom data to a Route and the Route Filters definition also as a array, i.e.
Router::post('login', array(
'filters' => array('guest', 'csrf'),
'uses' => 'App\Modules\Users\Controllers\Authorize@postLogin'
));
As example for passing custom data to a Route could be, in future:
Route::get('admin/shiny-things/(:any)', array(
'filters' => array('auth', 'roles'), // A 'roles' Filter must be specified
'uses' => 'App\Controllers\Admin\ShinyThings@index',
'roles' => array('administrator', 'manager') // Only an administrator, or a manager can access this route
));
This route could be used together with a (theoretical now) Route Filter like:
// Roles-based Authorization Filter.
Route::filter('roles', function($route) {
$action = $route->getAction();
$roles = array_get($action, 'roles');
if (! is_null($roles) && ! Auth::user()->hasRole($roles)) {
$status = __('You are not authorized to access this resource.');
return Redirect::to('admin/dashboard')->withStatus($status, 'warning');
}
});
Finally, to note that this pull request doesn't introduce any API breaks.
implementation of a **Administration Area** and **CRUD** for Users management
This pull request introduce the implementation of a Administration Area and CRUD for Users management on the Users Module and a new simple Module, called Dashboard, being the Users Dashboard, and which demonstrate the Modules interaction.
To note that for properly work of the improved Users Module, the SQL scripts are updated, being introduced timestamps on the users table.
Now, the Dashboard and Users Modules demonstrate a functional Backend on top of the Nova Framework.
Finally, to note that this pull request move the Default Template on loading the Bootstrap 3 files from Vendor, similar with the AdminLTE one.
This pull request make the Nova's **Routing** configurable via the file **app/Config/Routing.php**
This pull request make the Nova's Routing configurable via the file app/Config/Routing.php, which usually contains:
/**
* Routing configuration
*/
Config::set('routing', array(
'patterns' => array(
//':hex' => '[[:xdigit:]]+',
//':uuidV4' => '\w{8}-\w{4}-\w{4}-\w{4}-\w{12}'
),
'default' => array(
'controller' => DEFAULT_CONTROLLER,
'method' => DEFAULT_METHOD
)
));
In the "patterns" array entries could be added additional Routing Patterns used by the both Routers, while the "default" entry is for the ClassicRouter.
Finally, this pull request introduce a small optional feature: the Named Patterns which are practically aliases to (:any) and (:num), but permitting a more fluent definition, for example:
// Using a :ANY based Named Pattern
Router::any('blog/categories/{category}', 'App\Modules\Blog\Controllers\Blog@category');
// Using a :NUM base Named Pattern
Router::any('admin/blog/categories/{:id}', 'App\Modules\Blog\Controllers\Admin\Blog@category');
CLI addition & Added clear commands to Cli
This pull request introduce diverse improvements, small updates on Users module another optimizations.
First of all, a utility method called withStatus() is introduced on Http\RedirectResponse, which simplify the work with the passing message on new pages, generating a correct New Style Message for \Support\Facades\Session@message. Usage is simplified:
public function store()
{
// Validate the Input data.
$input = Input::only('name', 'category', 'hours', 'cfu');
$validator = $this->validate($input);
if($validator->passes()) {
// Process the Input data there.
...
// Prepare the flash message.
$status = __('The Course <b>{0}</b> was successfully created.', $course->name);
return Redirect::to('admin/courses')->withStatus($status);
}
// Errors occurred on Validation.
$status = $validator->errors();
return Redirect::back()->withInput()->withStatus($status, 'danger');
}
Counterpart is:
<?= Session::message('status'); ?>
The hard-coded variable for that type of message is "status".
In other hand, \Support\Facades\Session@message is improved, making possible to receive also Support\MessageBag instances or arrays of multiple line message, useful for displaying the Validation Errors in a simple way.
Finally, in the Users Module is introduced the ability of the integrated Google ReCaptcha to follow the Site Language and other optimizations.
Added clear commands to Cli
Improve the Routing of Vendor based Assets and rename the "Custom" Layout as "Backend" on AdminLte Template
Merge pull request #914 from LuckyCyborg/master Improve the Routing of Vendor based Assets and rename the "Custom" Layout as "Backend" on AdminLte Template, being a more appropriate name
Implementation of Templates support for Vendor based Assets and adding the AdminLTE Template
This pull request add a new Template, called AdminLte, based on AdminLTE and add support on Routing to serve Template Asset Files from associated Vendor paths.