Upgrade Guide

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;?>‘>

 

时间: 2024-08-28 15:59:53

Upgrade Guide的相关文章

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 2016 Contents About This Guide...................................................................................... 11 Shared Topics in This Guide .

Globalization Guide for Oracle Applications Release 12

Section 1: Overview Section 2: Installing Section 3: Configuring Section 4: Maintaining Section 5: Using Section 6: Customizing Section 7: Translating Section 8: Troubleshooting Appendix A: Migrating to Unicode Appendix B: Locale Data Section 1. Over

ORACLE 11.2.0.1升级到11.2.0.3

ORACLE 11.2.0.1升级到11.2.0.3 最近听了李光老师的关于oracle的升级公开课,深有感悟,之前一直想自己测试的,没有下定决心,这几天自己在虚拟机上测试了一下,测试的过程如下,当然这个只是一些基本的步骤,实际的生产环境我想比这个复杂的多了,但是不用急,慢慢来,循序渐进吧... 1. 数据库情况 单实例非ASM存储 ORACLE_SID : orcl ORACLE_HOME: /u01/app/oracle/product/11.2.0/dbhome_1 1. 数据库原始状态

Unity GameObject.activeSelf, GameObject.activeInHierarchy,GameObject.SetActive和SetActiveRecursively

activeSelf(read only只读):物体本身的active状态,对应于其在inspector中的checkbox是否被勾选activeInHierarchy(read only只读):物体在层次中是否是active的.也就是说要使这个值为true,这个物体及其所有父物体(及祖先物体)的activeself状态都为true. 一个物体要在场景中是可见的(不是隐藏的),那么不仅仅其本身的activeSelf要为true,其所有父物体(及祖先物体)的activeself状态都要为true.

Data Types

原地址: Home / Database / Oracle Database Online Documentation 11g Release 2 (11.2) / Database Administration Data Types Each value manipulated by Oracle Database has a data type. The data type of a value associates a fixed set of properties with the va

Jira安装-windows7

安装软件: JDK:jdk-7u40-windows-x64.exe Mysql:mysql-5.5.38-winx64.msi Jira:atlassian-jira-6.2.7-x64.exeJDBC:mysql-connector-java-5.1.31.zip 安装步骤: 1.安装jdk,并设置JAVA_HOME: 2.安装Mysql: 3.创建mysql用户和database: create user jira identified by 'jira'; create database

awesome-php中英文资源整理(同步更新)

中文版 收集整理一些常用的PHP类库, 资源以及技巧. 以便在工作中迅速的查找所需… 这个列表中的内容有来自 awesome-php 的翻译, 有来自开发者周刊以及个人的积累等. 一个前端组件的列表 awesome-frontend 推荐 学习资源 PHP相关的有参考价值的社区,博客,网站,文章,书籍,视频等资源 PHP网站(PHP Websites) PHP The Right Way – 一个PHP实践的快速参考指导 PHP Best Practices – 一个PHP最佳实践 PHP We

教你如何阅读Oracle数据库官方文档

< Ask Oracle官方原创 > Oracle 官方文档 数量庞大,而且往往没有侧重点,让oracle新手看起来很费力.但是,仍有很多Oracle使用者认为任何oracle学习资料都比不上Oracle官方文档的权威和扼要,且兼具基础与全面.这种差异可能与个人的阅读方法有很大关系, <Ask Oracle官方原创> Oracle官方文档数量庞大,而且往往没有侧重点,让oracle新手看起来很费力.但是,仍有很多Oracle使用者认为任何oracle学习资料都比不上Oracle官方

Installation and Upgrading

Cumulative Feature Overview Identifies product features available to you when upgrading. This tool requires Microsoft Excel. Any user should consult this document, as needed. Note: Make sure to enable macros when prompted to do so. Otherwise, the Mic