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. 在 ASP.NET MVC4 中使用 NInject

    Ninject是一个快如闪电.超轻量级的基于.Net平台的依赖注入框架.它能够帮助你把应用程序分离成一个个松耦合.高内聚的模块,然后用一种灵活的方式组装起来.通过使用Ninject配套你的软件架构,那 ...

  2. NopCommerce架构分析之参考资料

    http://www.cnblogs.com/RobbinHan/archive/2011/11/30/2269537.html 依赖注入框架Autofac的简单使用 http://www.cnblo ...

  3. IoSkipCurrentIrpStackLocation .(转)

    原文链接:http://m.blog.csdn.net/blog/ruanben/19758769# 当驱动被分层以后,他们被注册到一个chain中,IRP会在这个chain中传递,从最上面,到最下面 ...

  4. 怎么解决div覆盖内容却没覆盖的问题?

    一.在上下结构的div布局中,可能出现div覆盖div,但是内容却没有出现覆盖的现象.看看一个示例 1: <!DOCTYPE html> 2: <html> 3: <he ...

  5. sys.stdout 重定向

    通俗的来说,sys.stdout的功能类似与C++里面的文件输出功能fprintf. 接下来直接入正题,让我们来看代码: >>> import sys >>> te ...

  6. oracle spfile和pfile文件

    pfile(Parameter File)从oracle8i开始使用,在oracle9i中也可以用.它以文本文件的形式存在,可以用vi等编辑器对 其中数据库参数进行修改.文件格式为initSID.or ...

  7. Hubot Slack CoffeeScript

    公司买了一台Mac Pro,为了物尽其用,研究了半天把hubot-slack装好了,然后又花了点时间学习CoffeeScript(照着例子写也足够了).用slack来发版本还是很爽的.

  8. POJ3922 A simple stone game

    网上有很多解题报告,我的理解就是可以用类似数学归纳的方法证明,就是取一个数,让对手进入必败态. 详细见论文.

  9. android 链接蓝牙不稳定的解决建议

    My workaround I scan BLE for a short period of time 3-4 seconds then I turn scan OFF for 3-4 seconds ...

  10. iOS中几种定时器 - 控制了时间,就控制了一切

    在软件开发过程中,我们常常需要在某个时间后执行某个方法,或者是按照某个周期一直执行某个方法.在这个时候,我们就需要用到定时器. 然而,在iOS中有很多方法完成以上的任务,到底有多少种方法呢?经过查阅资 ...