Upgrade Guide

This guide will point out the key points to be aware of when upgrading to version 3.

All classes within the app directory have a new namespace of App, controllers and models/modules have the following namespaces for classes placed directly in those directories.

Controllers

namespace App\Controllers;

Models

namespace App\Models;

Modules

namespace App\Controllers\ModuleName;

Instantiating a model

Models are instantiated typically within a construct method, use the full namespace to call the class:

public function __construct()
{
parent::__construct();
$this->model = new \App\Models\ModelName();
}

Views

Views like classes should have filenames starting with a capital letter for both the directory and the file, for instance welcome/index.php becomes Welcome/Index.php.

View::render('Welcome/Index', $data);

Loading Images, css, js and assets

Nova has been designed to live above the document root as such images and other assets cannot be called directly instead they need to be routed from Nova, this is done by calling Url::resourcePath().

By default this will return the path to the assets folder, place general assets in there. For theme files place them inside the Theme/Assets directory and call them by using Url::templatePath() this loads the path to the default template.

Make use of the Assets helper to load the css files:

Assets::css([
'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css',
Url::templatePath().'css/style.css'
]);

An example of loading an image from Default/Assets/images.

<img src='<?=Url::templatePath();?>images/nova.png' alt='<?=SITETITLE;?>'>

 

Upgrade Guide的更多相关文章

  1. Oracle E-Business Suite R12.1.x Installation And Upgrade Guide Step by Step

    1.        Install Oracle E- Business Suite R12.1.1       2.        Upgrade E- Business Suite From 12 ...

  2. P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1

    P6 Professional Installation and Configuration Guide (Microsoft SQL Server Database) 16 R1       May ...

  3. Globalization Guide for Oracle Applications Release 12

    Section 1: Overview Section 2: Installing Section 3: Configuring Section 4: Maintaining Section 5: U ...

  4. Planning your upgrade with Upgrade Advisor

    Planning your upgrade with Upgrade Advisor You should use the Upgrade Advisor tool (if it is availab ...

  5. PHP资源列表

    一个PHP资源列表,内容包括:库.框架.模板.安全.代码分析.日志.第三方库.配置工具.Web 工具.书籍.电子书.经典博文等等. 初始翻译信息来自:<推荐!国外程序员整理的 PHP 资源大全& ...

  6. Oracle数据库异机升级

    环境: A机:RHEL5.5 + Oracle 10.2.0.4 B机:RHEL5.5 需求: A机10.2.0.4数据库,在B机升级到11.2.0.4,应用最新PSU补丁程序. 目录: 一. 确认是 ...

  7. Oracle 11.2.0.4 DataGuard 环境打PSU,OJVM PSU补丁快速参考

    环境:RHEL6.5 + Oracle 11.2.0.4 DataGuard physical standby 主库和备库都是单节点. 需求:主备库同时应用160719的PSU和OJVM PSU补丁. ...

  8. Oracle EBS R12 (12.1.3) Installation Linux(64 bit)

    Oracle EBS R12 (12.1.3) Installation Linux(64 bit) Contents Objective. 3 1 Download & Unzip. 3 D ...

  9. oracle官方文档12c对应关系

    ADDCI Oracle® Database Data Cartridge Developer's Guide 12c Release 1 (12.1) E15882-05 ADFNS Oracle® ...

随机推荐

  1. 安装VS2015出现的bug,各位安装请注意

    昨天微软发布了vs2015 迫不及待的下载下来安装体验了一把,但是机器上同时安装有vs2010.vs2012.vs2013 .安装完成后,因为公司项目需要开发,打开vs2012 ,有如下提示: 百度查 ...

  2. Jquery AutoComplete的使用方法实例

    jquery.autocomplete详解 语法: autocomplete(urlor data, [options] ) 参数: url or data:数组或者url [options]:可选项 ...

  3. show slave status中的log_file / log_pos

    在MySQL的master-slave或dual master的架构中,我们经常使用show slave status命令来查看复制状态. 这里涉及几个重要的日志文件和位置: Master_Log_F ...

  4. 怎么限制Google自动调整字体大小

    Google默认的字体大小是12px,当样式表中font-size<12px时,或者没有明确指定字体大小,则在chrome浏览器里字体显示是12px. 最近在写代码玩的时候,我也碰到了 在FF和 ...

  5. 2015北京网络赛A题The Cats' Feeding Spots

    题意:给你一百个点,找个以这些点为中心的最小的圆,使得这个圆恰好包含了n个点,而且这个圆的边界上并没有点 解题思路:暴力枚举每个点,求出每个点到其他点的距离,取第n大的点,判断一下. #include ...

  6. 【Hadoop学习】Apache Hadoop项目简介

    正在撰写,稍后来访……

  7. 电脑突然死机,系统日志记录事件ID=6008

    刚才正在写代码,在一次保存之后,正要刷新看下效果,电脑突然关机,没有任何提示或延迟.我的笔记本电池是一直插上的,也连接着电源. 重新开机之后,找到系统日志查看.只有这一条错误记录:非正常关机,事件60 ...

  8. AVR ATMEGA8 串口USART

    avr串口配置很简单,配置就几个寄存器就可以进收发: 但有几点要搞明白的是: 1.串口一但被配置成功IO功能自动被占用,这点与LPC或STM8/32不同(需要寄存配置): 2.没有专门的串口开起或闭关 ...

  9. weblogic11g 安装——linux 无图形界面

    weblogic11g 安装——linux下无weblogic安装图形界面 注意:此次安装,没做server.ip .系统规划 目的:学习weblogic11g 在linux下  无图形安装的过程 j ...

  10. [html][转]常用返回顶部代码

    转至:http://jingyan.baidu.com/article/7082dc1ca6b928e40a89bd1a.html 一.使用HTML的锚标记最简单了 但是唯一的缺点就是样式不怎么样,会 ...