Git Product home page Git Product logo

simpleframework's Introduction

簡易MVC-API-PHP框架


此框架為自己整理系統的練習作品,切勿將之應用在實務上,應用在實務上的框架上請選擇Laravel 5.1等框架。

所使用的package

  • Laravel - ORM("illuminate/database": "5.1.8")
  • Laravel - Pagination("illuminate/pagination": "5.1.8")
  • PHP單元測試("phpunit/phpunit" : "4.8.9")
  • 擬真假資料("fzaninotto/faker": "~1.4")

初始設定

1.安裝package

php composer install

2.修改db設定

修改config\db.example.php 修正為 db.php

3.新增資料表

php database\setTables.php

4.新增假資料

php database\setSeeds.php

5.修改伺服器之根目錄

如果伺服器為http://localhost/test,則修改config\app.php define(Server_Document,'/test')

6.執行測試程式

php tests\TestCase.php


檔案架構

此檔案架構為參考Laravel之架構,再進行修改。

1. app

Controller為放置Controller。 Kernel放置app一些核心套件。 Model放置package、enities、responsitory等檔案。 Request為放置請求的程式碼。 Response為放置回應的程式碼。

2. bootstrap

存放起始程式

3. config

app.php存放app一些初始設定,如根目錄、使用者檔案資料目錄、時區等設定。 bootstrap.php設定是否需要建立template或是log檔。 db.php設定database連線設定。

4.database

seeds 存放seeds檔案。 tables 存放資料表檔案。

5. helper

放置一些helper function等檔案

6. public

放置使用者可看到的檔案,如css、js及一些jpg檔

7. storage

放置需儲存的資料紀錄,如logs。

8. template

放置App的view

9. tests

放置寫單元測試的檔案。


作者 [@vasiliy_liao][3] 2015 年 09月 28日

simpleframework's People

Contributors

vasiliyliao avatar

Watchers

Yida Chen avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.