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\Demo@test');

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\Demo@cool');
Router::any('settings', 'App\Controllers\Demo@nice');
});

Is the equivalent to

Router::any('admin/add', 'App\Controllers\Admin@add');
Router::any('admin/settings', 'App\Controllers\Admin@settings');

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.

Overview & Change Log的更多相关文章

  1. 删除DSO Change Log表数据

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  2. Commit message 和 Change log 编写指南

    来源:http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html Git 每次提交代码,都要写 Commit messa ...

  3. Git_学习_09_Commit message 和 Change log 编写指南

    一.前言 二.Commit message编写 1.规范 2.用空行分开主题和正文 提交时只执行 git commit,这时就会跳出文本编辑器,让你写多行. git commit 主题和正文分开 每次 ...

  4. 【转】获取Jenkins构建时Git Change Log

    原文:https://www.jianshu.com/p/513ab6915dbd 在基于Jenkins进行CI持续集成的工作,在构建后上传蒲公英时想将本次版本的git commit信息同步到蒲公英的 ...

  5. 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 ...

  6. Jenkins 获取 Git 的提交记录(Change Log)

    工作中用 Jenkins 做 iOS 和 Android 的持续集成,之前实现的是当 git 有新代码提交的时候,就会自动编译并上传安装包到蒲公英,然后自动发送QQ群通知或者讨论组通知给相关小伙伴,方 ...

  7. Managing IIS Log File Storage

    Managing IIS Log File Storage   You can manage the amount of server disk space that Internet Informa ...

  8. RAC Wait Event: gcs log flush sync 等待事件 转

    RAC Wait Event: gcs log flush sync https://www.hhutzler.de/blog/rac-wait-event_gcs_log_flush_sync/#o ...

  9. Understanding postgresql.conf : log*

    After loooong pause, adding next (well, second) post to the “series“. This time, I'd like to describ ...

随机推荐

  1. log4net 将日志写入数据库

    asp.net利用log4net写入日志到SqlServer数据库,Log4net是一个开源的错误日志记录项目,易用性强,源自log4j,品质值得信赖. 下面就我的安装部署log4net到MS sql ...

  2. 在PowerDesigner中设计物理模型2——约束

    唯一约束 唯一约束与创建唯一索引基本上是一回事,因为在创建唯一约束的时候,系统会创建对应的一个唯一索引,通过唯一索引来实现约束.不过唯一约束更直观的表达了对应列的唯一性,使得对应索引的目的更加清晰,所 ...

  3. 静态Web开发 JQuery

    伍章 JQuery 1节介绍JQuery和顶级对象 <<锋利的JQuery>>JQuery官网: http://jquery.com (下载jquery工具)JQuery在线A ...

  4. Oracle 给表添加主键和使ID自增、触发器、创建结构一样的表

    1.关于主键:在建表时指定primary key字句即可:create table test( id number(6) primary key, name varchar2(30));如果是对于已经 ...

  5. docker专题(2):docker常用管理命令(上)

    http://segmentfault.com/a/1190000000751601 本文只记录docker命令在大部分情境下的使用,如果想了解每一个选项的细节,请参考官方文档,这里只作为自己以后的备 ...

  6. Vijos1404 遭遇战 最短路,dijkstra,堆

    P1404遭遇战 标签:[显示标签]     背景 你知道吗,SQ Class的人都很喜欢打CS.(不知道CS是什么的人不用参加这次比赛). 描述 今天,他们在打一张叫DUSTII的地图,万恶的恐怖分 ...

  7. Win7 U盘安装Ubuntu16.04 双系统

    Win7系统下安装Ubuntu系统,主要分为三步: 第1步:制作U盘启动盘 第2步:安装Ubuntu系统 第3步:创建启动系统引导 第1步:制作U盘启动盘 1.下载Ubuntu16.04安装镜像,官网 ...

  8. DotNET 开发常用工具汇集

    开发用专业软件已经很多了,来说说开发用的辅助软件把--分享我常使用的辅助软件 个人工具清单 .NET 程序员十种必备工具 新.net开发十大必备工具 .NET开发不可错过的25款必备工具 我的生活必备 ...

  9. C/C++中的变量作用域

    #include <iostream> using namespace std; int i = 1;int j = 2; int main(){     int i = 9;  //C/ ...

  10. 解决ecshop在线客户点击无法唤醒QQ问题

    找到default/library/page_footer.lbi中找到QQ代码的相应位置,然后你会发现之前模板里面为什么QQ点击不能对话,是因为QQ客服安装包中的JS代码有的可能是比较旧的代码了. ...