Overview & Change Log

Overview & Change Log

Nova Framework is a PHP 5.5+ MVC Framework. It‘s designed to be lightweight and modular, allowing developers to build better and easy to maintain code with PHP.

To this end Nova does not come with lots of built in libraries / helpers or modules instead, it‘s left to the user to decide what they want to implement, this allows freedom to design and build how you see fit.

The base framework however does come with a range of helper classes. New classes can easily be added at any stage of development.

This has been tested with php 5.6 and php 7 please report any bugs.

Routing images / js / css files

From within Templates your css/js and images must be in a Assets folder to be routed correctly. This applies to Modules as well, to have a css file from a Module the css file would be placed inside nova/app/Modules/ModuleName/Assets/css/file.css. Additionally there is an Assets folder in the root of nova this is for storing resources outside of templates that can still be routed from above the document root.

Router

Optional Parameters

New to 3.0 is allowing filters to be optional

Filters written like (:any) are required to match the route but writing a filter as (/(:any)) makes it optional.

This route supplied with Nova has one filter that is required then a further 3 optional filters. Multiple filters should be inside the first parenthesis.

Router::any(‘admin/(:any)(/(:any)(/(:any)(/(:any))))‘, ‘App\Controllers\[email protected]‘);

Groups

New to 3.0 is groups routes can now placed in a group, this allows all routes within the group to inherit the group name.

Router::group(‘admin‘, function() {
    Router::any(‘add‘, ‘App\Controllers\[email protected]‘);
    Router::any(‘settings‘, ‘App\Controllers\[email protected]‘);
});

Is the equivalent to

Router::any(‘admin/add‘, ‘App\Controllers\[email protected]‘);
Router::any(‘admin/settings‘, ‘App\Controllers\[email protected]‘);

Error Log

The error log is no longer a .html file but rather a log file. On a production server it should be outside the document root, in order to see the any errors there are a few options:

  • Open app/logs/error.log
  • OR open system/Core/Logger.php set $display to true to print errors to the screen
  • set $emailError to true and setup the siteEmail const in app/Config.php this relies on an email server (not provided by the framework)

Namespace change

classes in app/Controller app/Model and app/Modules now have a namespace starting with App.

  • App\Controllers
  • App\Models
  • App\Modules

That is only for classes within app, this is not needed for classes within system.

Aliases for helpers within views

Helpers can now be used without using a use statement, inside system/Core/Alias contains an array of helpers with their alias allowing helpers to be used directly.

Instead of doing:

use Helpers\Session;

Session::set(‘item‘, ‘value‘);

it can become:

Session::set(‘item‘, ‘value‘);

New / Updated Helpers / Methods

Url

resourcePath() The basic idea is to provide a lowercase version of the resource path for the resources located in Modules and the base assets folder. Then the following call:

$path = Url::resourcePath(‘FileManager‘);

will result into:

/modules/file_manager/assets/

With no parameters will return:

/assets/

Which correspond with the generic Assets directory.

detectUri()

Returns the current url.

templatePath() and relativeTemplatePath()

Now accepts 2 parameters:

  1. $custom - default to TEMPLATE which is the template being used
  2. $folder - folder to return from within the template defaults to Assets

Assets

The assets helper loads css and js files both methods have the following parameters:

  • $files - a single file or array of file paths
  • $cache - cache the output default to false, a minified file will be generated in the theme css/js folder.
  • $refresh - update the cache default to false
  • $cachedMins - time in seconds to keep the cache for defaults to 14400

Csrf

Updated makeToken() and isTokenValid() to require a name parameter, this allows using multiple times on a single page with unique names.

Data

create_key() has been renamed to createKey()

Form

Form::open by default created a hidden input with a token to be used for cross site request forgery checks (CSRF) if a name is passed to Form::open it‘s used as part of the token name.

Inflector

Inflector is a doctrine class to allow transforming file paths used within the Url helper.

JsMin

Minifies supplied js code

Request

get() method added.

ReservedWords

This class has a method getList which returns an array of reserved words include PHP 7‘s reserved words.

Response

This helper is primary used for routing, see the Response page for more details.

时间: 2024-10-01 03:50:22

Overview & Change Log的相关文章

删除DSO Change Log表数据

声明:原创作品,转载时请注明文章来自SAP师太技术博客:www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将追究法律责任!原文链接:http://www.cnblogs.com/jiangzhengjun/p/4296224.html 尽管上层的数据目标做Detal更新时,是从Change Log表里抽数的,数据删除也不会造成后继新增的到其他数据目标的抽数问题,因为初始化是从Active表里抽数,而只有增量的数据是从Change Log表里取,但删除

Commit message 和 Change log 编写指南

来源:http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html Git 每次提交代码,都要写 Commit message(提交说明),否则就不允许提交. $ git commit -m "hello world" 上面代码的-m参数,就是用来指定 commit mesage 的. 如果一行不够,可以只执行git commit,就会跳出文本编辑器,让你写多行. $ git commit 基本上,你写什么都

How To Change Log Rate Limiting In Linux

By default in Linux there are a few different mechanisms in place that may rate limit logging. These are primarily the systemd journal and rsyslog rate limits that are in place by default. Here we cover modifying or removing rate limiting for logging

Understanding postgresql.conf : log*

After loooong pause, adding next (well, second) post to the “series“. This time, I'd like to describe how logging works. And I don't mean binary logging (WAL), but the log for us, humans, to read. Before I will go to the postgresql.conf options, let

coffeescript 1.8.0 documents

CoffeeScript is a little language that compiles into JavaScript. Underneath that awkward Java-esque patina, JavaScript has always had a gorgeous heart. CoffeeScript is an attempt to expose the good parts of JavaScript in a simple way. The golden rule

Deploying JRE (Native Plug-in) for Windows Clients in Oracle E-Business Suite Release 12 (文档 ID 393931.1)

In This Document Section 1: Overview Section 2: Pre-Upgrade Steps Section 3: Upgrade and Configuration Section 4: Post-installation Steps Section 5: Known Issues Section 6: Appendices This document covers the procedure to upgrade the version of the J

Project Management Process

Project Management ProcessDescription .......................................................................................................................................................................................1STAGE/STEP/TASK SUMMARY LIST

Migrating Oracle on UNIX to SQL Server on Windows

Appendices Published: April 27, 2005 On This Page Appendix A: SQL Server for Oracle Professionals Appendix B: Getting the Best Out of SQL Server 2000 and Windows Appendix C: Baselining Appendix D: Installing Common Drivers and Applications Installing

The Independent JPEG Group's JPEG software Android源码中 JPEG的ReadMe文件

The Independent JPEG Group's JPEG software========================================== README for release 6b of 27-Mar-1998==================================== This distribution contains the sixth public release of the Independent JPEGGroup's free JPEG