wdb/tutorial-oop

本教程包括项目,用于展示MVC模式(模型、视图、控制器)以及面向对象编程(OOP)以及作为模板引擎的`smarty`的使用。

0.6.1 2018-09-13 13:19 UTC

This package is auto-updated.

Last update: 2024-09-15 05:49:48 UTC


README

要求:PHP 5.2+,smarty(PHP模板引擎)

描述

本教程包括项目,用于展示MVC模式(模型、视图、控制器)以及面向对象编程(OOP)。
大部分逻辑程序逻辑简单,以保持对结构编程和一般方面的关注。

目前使用"smarty"作为模板引擎,而转向更现代的引擎可能可预期。"smarty"遗憾地影响到了程序逻辑,因为数据使用数组而不是对象。
尽管如此,为面向对象模板引擎准备了一般方法的部分。

安装

  1. 通过composer

使用composer加载包括smarty的项目,请使用以下命令:

composer create-project wdb/tutorial-oop

如果您想安装master分支而不是最新版本,请使用以下命令:

composer create-project -s dev wdb/tutorial-oop
  1. 通过git

git clone https://github.com/DavidBruchmann/tutorial_oop.git
然后参考以下内容:在手动安装中包含smarty

  1. 通过压缩版本

从本页面下载最新版本
https://github.com/DavidBruchmann/tutorial_oop/releases
然后参考以下内容:在手动安装中包含smarty

在手动安装中包含smarty

在下载的项目文件夹中必须有一个包含模板引擎的文件夹vendor/smarty/smarty。如果不使用composer,下载和结构布局必须手动完成。

即使在手动下载的情况下,您也可以使用composer install来仅通过composer安装smarty。

教程和研讨会的支持

PayPal: ch19barlian@gmail.com