Code Monkey home page Code Monkey logo

lanativeroute's Introduction

LaNativeRoute

LaNativeRoute 說明

自行組裝的輕量框架。

捨棄路由檔案,由檔案系統的決定路由。

保留在Laravel中,我喜歡的特點,像是Model及Blade等。

沒有太多限制,極度客制化。

INSTALL

composer install

變數資料夾

LaNativeRoute 使用獨創的_變數資料夾_(_var_)將變數傳入controller。

例如:
網址: /content/1
資料夾為:
/controllers/content/_id_/index.php
/views/content/_id_/index.blade.php
(views非必要,如果controllers的index.php只是想吐json,可直接回傳array即可,同Laravel)

於index.php中,我們可以透過
$id = input("id"); 
取得資料夾的變數名稱

MVC

URL: /demo
程式:
controllers/demo.php: 邏輯放置於此,return view()即可載入同名的view。
views/demo.blade.php: 採用Laravel blade樣版引擎規則

dotenv

 DB_CONNECTION=mysql
 DB_HOST=db
 DB_PORT=3306
 DB_DATABASE=
 DB_USERNAME=
 DB_PASSWORD= 

lanativeroute's People

Contributors

deviny avatar

Watchers

James Cloos avatar  avatar

Forkers

joyce001121

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.