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\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:
- $custom - default to TEMPLATE which is the template being used
- $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的更多相关文章
- 删除DSO Change Log表数据
声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...
- Commit message 和 Change log 编写指南
来源:http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html Git 每次提交代码,都要写 Commit messa ...
- Git_学习_09_Commit message 和 Change log 编写指南
一.前言 二.Commit message编写 1.规范 2.用空行分开主题和正文 提交时只执行 git commit,这时就会跳出文本编辑器,让你写多行. git commit 主题和正文分开 每次 ...
- 【转】获取Jenkins构建时Git Change Log
原文:https://www.jianshu.com/p/513ab6915dbd 在基于Jenkins进行CI持续集成的工作,在构建后上传蒲公英时想将本次版本的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 ...
- Jenkins 获取 Git 的提交记录(Change Log)
工作中用 Jenkins 做 iOS 和 Android 的持续集成,之前实现的是当 git 有新代码提交的时候,就会自动编译并上传安装包到蒲公英,然后自动发送QQ群通知或者讨论组通知给相关小伙伴,方 ...
- Managing IIS Log File Storage
Managing IIS Log File Storage You can manage the amount of server disk space that Internet Informa ...
- 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 ...
- Understanding postgresql.conf : log*
After loooong pause, adding next (well, second) post to the “series“. This time, I'd like to describ ...
随机推荐
- expunge
expunge 擦掉: 除去: 删去: 消除 1. The experience was something he had tried to expunge from his memory. 他曾努力 ...
- 工作流设计 zt
工作流设计 业务流程管理模块是本平台的重要组成部分,要实现将已经发布的标准中规范化的流程转化为具体计算机中的流程从而实现流程的自动运转,将标准化成果与员工的日常工作紧密结合起来,具有重要意义. 业务流 ...
- LoadRunner常见问题整理(转)
首先要感谢群友的无私分享,才能得到这篇好的学习资料,整理得太好了,所以收藏保存,方便以后学习. 一:LoadRunner常见问题整理 1.LR 脚本为空的解决方法: 1.去掉ie设置中的第三方支持取消 ...
- Base-Android快速开发框架(四)--网络操作之FastJson以及AsyncHttpClient
Android的展示数据,除了上章所讲的本地存储外,大部分数据都来自于网络.首先介绍一下Android APP开发常见的网络操作方式.从网络层面上有底层的tcp/ip,也就是我们常见的socket套接 ...
- warden 的设计与实现 总结
--------------------------------------------------------参考资料---------------------------------------- ...
- sql-逻辑循环while if
--计算1-100的和 declare @int int=1; declare @total int=0; while(@int<=100) begin set @total=@total+@i ...
- 使用Intent在活动之间穿梭(《第一行代码》读书笔记)
以下全是个人理解//瞎扯 其实活动理解理解起来就像一个个函数 那么Intent就是调用函数和参数传递 可以有无参,仅仅是调用 Intent intent = new Intent(A.this, B. ...
- 单点登录与消息队列以及在J2EE中的实现方案
前言 这次为大家简单介绍两个在WEB开发中经常使用的概念——单点登录和消息队列以及具体到J2EE中的一些实现方案.本文原创性的工作比较少,主要是一些总结概括和自己的理解. 单点登录SSO SSO的业务 ...
- 宿舍局域网与Internet连接
写在前面的话 一般情况下,大多数组建了校园网的学校都为学生宿舍提供了连接Internet接口,所以只需要通过网线将宿舍网的集线器与校园网提供的接口进行连接即可接入Internet.宿舍网接入Inter ...
- 教程-经典Delphi教程网
有理想+志同道合的人+取长补短去协同工作=完美团队一流的项目 + 三流的执行者 = 垃圾项目三流的项目 + 一流的执行者 = 完美项目 自己公司网址:http://www.kaideruixin.ic ...