
풍부한 가벼운 PHP MVC 프레임 워크 :
FOOTUP MVC Framework
├── app
│ ├── Config
│ │ ├── Autoload.php
│ │ ├── Config.php
│ │ ├── Constants.php
│ │ ├── Email.php
│ │ ├── Form.php
│ │ ├── Fuel.php
│ │ ├── Paginator.php
│ │ └── Routes.php
│ ├── Controller
│ │ ├── BaseController.php
│ │ └── Home.php
│ ├── Functions.php
│ ├── Lang
│ ├── Libs
│ ├── Middle
│ │ └── Maintenance.php
│ ├── Migration
│ ├── Model
│ │ └── Contact.php
│ ├── Seed
│ └── View
│ └── home.php
├── composer.json
├── core
│ ├── Boot.php
│ ├── Cli
│ │ ├── Commands
│ │ │ ├── Assets.php
│ │ │ ├── Controller.php
│ │ │ ├── Middle.php
│ │ │ ├── Migfree.php
│ │ │ ├── Migrate.php
│ │ │ ├── MigrateTrait.php
│ │ │ ├── Migrown.php
│ │ │ ├── Migrup.php
│ │ │ ├── Model.php
│ │ │ ├── Multiple.php
│ │ │ ├── Scaffold.php
│ │ │ ├── Seeder.php
│ │ │ ├── Seed.php
│ │ │ ├── Serve.php
│ │ │ └── View.php
│ │ ├── Exception
│ │ │ ├── Exception.php
│ │ │ ├── InvalidArgumentException.php
│ │ │ ├── InvalidParameterException.php
│ │ │ └── RuntimeException.php
│ │ ├── Helper
│ │ │ ├── InflectsString.php
│ │ │ ├── Normalizer.php
│ │ │ ├── OutputHelper.php
│ │ │ └── Shell.php
│ │ ├── Input
│ │ │ ├── Argument.php
│ │ │ ├── Command.php
│ │ │ ├── Groupable.php
│ │ │ ├── Option.php
│ │ │ ├── Parameter.php
│ │ │ ├── Parser.php
│ │ │ └── Reader.php
│ │ ├── IO
│ │ │ └── Interactor.php
│ │ ├── Konsole.php
│ │ ├── logo
│ │ ├── logo_txt
│ │ ├── Output
│ │ │ ├── Color.php
│ │ │ ├── Cursor.php
│ │ │ ├── Table.php
│ │ │ └── Writer.php
│ │ └── Tpl
│ │ ├── Controller.tpl
│ │ ├── Middle.tpl
│ │ ├── Migrate.tpl
│ │ ├── Model.tpl
│ │ ├── Seed.tpl
│ │ └── View.tpl
│ ├── Config
│ │ ├── Autoload.php
│ │ ├── Config.php
│ │ ├── DotEnv
│ │ │ ├── DotEnv.php
│ │ │ └── Exception
│ │ │ ├── Exception.php
│ │ │ └── InvalidPathException.php
│ │ ├── Email.php
│ │ └── Mime.php
│ ├── Controller.php
│ ├── Database
│ │ ├── DbConnection.php
│ │ ├── Migration
│ │ │ └── Migration.php
│ │ ├── Migration.php
│ │ ├── QueryBuilder.php
│ │ ├── Schema
│ │ │ ├── Column.php
│ │ │ ├── ForeignKey.php
│ │ │ ├── IndexColumn.php
│ │ │ ├── Index.php
│ │ │ ├── Schema.php
│ │ │ └── Table.php
│ │ ├── Seeder
│ │ │ └── Seeder.php
│ │ └── Seeder.php
│ ├── Debug
│ │ ├── Contracts
│ │ │ └── HandlersInterface.php
│ │ ├── Exceptions
│ │ │ ├── CompileErrorException.php
│ │ │ ├── CompileWarningException.php
│ │ │ ├── CoreErrorException.php
│ │ │ ├── CoreWarningException.php
│ │ │ ├── DepricatedException.php
│ │ │ ├── NoticeException.php
│ │ │ ├── ParseErrorException.php
│ │ │ ├── RecoverableErrorException.php
│ │ │ ├── StrictErrorException.php
│ │ │ ├── UserDeprecatedException.php
│ │ │ ├── UserErrorException.php
│ │ │ ├── UserNoticeException.php
│ │ │ ├── UserWarningException.php
│ │ │ └── WarningException.php
│ │ ├── Handlers.php
│ │ ├── HandlersSetter.php
│ │ ├── Reporter.php
│ │ ├── resources
│ │ │ ├── assets
│ │ │ │ ├── css
│ │ │ │ │ ├── custom.min.css
│ │ │ │ │ ├── enlighterjs.min.css
│ │ │ │ │ └── spectre.min.css
│ │ │ │ └── js
│ │ │ │ ├── custom.min.js
│ │ │ │ └── enlighterjs.min.js
│ │ │ └── views
│ │ │ └── 500.php
│ │ ├── Support
│ │ │ └── functions.php
│ │ └── View.php
│ ├── Files
│ │ ├── File.php
│ │ └── FileSystem.php
│ ├── footup-ascii-art.png
│ ├── Footup.php
│ ├── Functions.php
│ ├── Html
│ │ ├── Form.php
│ │ └── Html.php
│ ├── Http
│ │ ├── Request.php
│ │ ├── Response.php
│ │ └── Session.php
│ ├── I18n
│ │ ├── Exceptions
│ │ │ └── I18nException.php
│ │ ├── TimeDifference.php
│ │ └── Time.php
│ ├── Lang
│ │ ├── fr
│ │ │ ├── core.json
│ │ │ ├── date.json
│ │ │ ├── db.json
│ │ │ ├── email.json
│ │ │ ├── file.json
│ │ │ ├── http.json
│ │ │ ├── paginator.json
│ │ │ ├── validator.json
│ │ │ └── view.json
│ │ └── Lang.php
│ ├── Model.php
│ ├── Orm
│ │ ├── BaseModel.php
│ │ └── ModelQueryBuilder.php
│ ├── Paginator
│ │ ├── AbstractPaginator.php
│ │ ├── Page.php
│ │ ├── PaginatorException.php
│ │ ├── PaginatorInterface.php
│ │ ├── Paginator.php
│ │ └── View
│ │ └── default.php
│ ├── Routing
│ │ ├── Middle.php
│ │ ├── Route.php
│ │ └── Router.php
│ └── Utils
│ ├── Arrays
│ │ ├── Arrayable.php
│ │ ├── ArrDots.php
│ │ ├── Arr.php
│ │ ├── Collection.php
│ │ └── Dots.php
│ ├── ClassLocator.php
│ ├── Shared.php
│ ├── Str.php
│ └── Validator
│ ├── Validate.php
│ └── Validator.php
├── env
├── footup
├── LICENSE
├── public
│ ├── assets
│ │ ├── avatar.jpg
│ │ ├── css
│ │ │ └── style.css
│ │ └── js
│ │ └── script.js
│ ├── error
│ │ ├── 404.html
│ │ └── 500.html
│ ├── favicon.svg
│ ├── index.php
│ └── uploads
├── README.md
└── server.php
Footup MVC 프레임 워크는 주로 속도와 미니멀리즘에 중점을 둡니다. 250kb Zip , 148kb xz 입니다. 0.001 초 를 렌더링합니다 (PHP 8.0.7 환경을 사용하여 작성하고 테스트했습니다).
내 목표는 내가 그것을 쉽게 사용하는 첫 번째 사람이라는 일을하는 것입니다. 나는 하루 종일 일을 더 빨리 작업하는 데 도움이되는 몇 가지 기능을 추가했습니다.
요! 외부 종속성 없이이 작업을 직접 다운로드하여 사용할 수 있습니다. 작곡가 라이브러리를 지원하지만 아직 발자국을 Packagist에 게시하지 않았습니다.
그래서 당신은 필요합니다 :
지금은 Generators 명령 만 추가했습니다
도움을 보여주기 위해 :
nuka@hacker_pc: ~ $ php footup 컨트롤러를 생성하려면 :
nuka@hacker_pc: ~ $ php footup controller controllerName너무 부끄러워하지 말고 스스로 시도하십시오
요청과 라우터 클래스는 많은 것을 사용하는 BMW 모터 입니다. 여기서 요청을 사용하는 방법 :
// using get function to get the page=3 present in the url
$ this -> request -> get ( " page " );
// you can use like this to get the page
$ this -> request -> page ;
// What ? you typing enough ? and that ?
request ()-> page ;
// And What ? how to get file with name: image ?
// You can use as below
$ this -> request -> image ; // or $this->request->file('image')
// And What if image[] as multiple files ?
// You can use as below
$ this -> request -> files ( ' image ' );
# Yes you can access the request using the global function request() // using get function to validate the page=3 present in the url
$ this -> request -> withGetInput ()-> validate ([ " page " => " is:int " ]);
// What ? you typing enough ? and that ?
request ()-> withGetInput ()-> validate ([ " page " => " is:int " ]);
# Yes you can access the request using the global function request() // using get function to validate the page=3 present in the url
$ this -> response -> json ([ " page " => 2 ]); // second parameter to echo directly
# Yes you can access the response using the global function response()이것은 공유 클래스이므로 데이터와 함께 데이터가 동일하게 유지됩니다. 예는 다음과 같습니다.
// using set function to set session value
$ this -> session -> set ([ " page " => 2 ]); // or $this->session->page = 2
// What ? you typing enough ? and that ?
session ( " page " , 2 ); // session()->set("page", 2); or session()->page = 2;
// What ? i want to get the page ?
// So
session ( " page " ); // session()->get("page"); or session()->page;
# Yes you can access the session using the global function session() as shown유효성 검사기를 사용하여 데이터를 유효성 있으면 모든 전달 된 경우 검증 기능이 TRUE를 반환하고 그렇지 않으면 false
// Via request
// with post data
$ this -> request -> withPostInput ()-> validate ([ " page " => " is:int " ]);
// With post and get data
request ()-> withInput ()-> validate ([ " page " => " is:int " ]);
// With other data
request ()-> with ([ " page " => 2 ])-> validate ([ " page " => " is:int " ]);
// So how to get Error ?
// Simple
validator ()-> getError ( " page " ); // request()->getValidator()->getErrors(); to grab all
# Yes you can access the validator using the global function validator()
# You can validate using the global function validate() too <?php
namespace App Model ;
use Footup Model ;
class Contact extends Model{
// If not defined, the name of this class is used
protected $ table = ' contact ' ;
/**
* PrimaryKey
*
* @var string
*/
protected $ primaryKey = ' idcont ' ;
protected $ beforeInsert = [];
protected $ beforeFind = [];
protected $ beforeDelete = [];
protected $ beforeUpdate = [];
protected $ afterInsert = [];
protected $ afterFind = [];
protected $ afterDelete = [];
protected $ afterUpdate = [];
}
// Using the model Contact
. . . . .
use App Model Contact ;
. . . .
// Retrouve tout | retrieve all
$ contacts = Contact:: all ();
------------ others methods --------------
$ c = new Contact();
$ contacts = $ c -> get ();
foreach ( $ contacts as $ contact )
echo $ contact -> email ;
# you can also use
$ contact -> setEmail ( " [email protected] " );
// Generating form ******
$ contact -> getForm ();
var_dump ( $ c -> firstByEmail ( ' [email protected] ' ));
. . . . . . . . . . . . . . . . . . . . . . . . . .
요청 ($ index = null, $ arg = null)
/**
* Une fonction pour exposer l'objet Request
*
* @param mixed $index
* @param mixed $arg
* @return FootupHttpRequest|mixed
*/
request ( $ index = null , $ arg = null )callcontroller ($ withnamespace = true)
/**
* Retrouve le controlleur en cours d'utilisation
*
* @param boolean $withNamespace
* @return string
*/
calledController ( $ withNamespace = true )method ()
/**
* Retrouve la méthode couremment utilisée
*
* method of the current called controller
*
* @return string
*/
calledMethod ()그리고 많은 사람들이 다른 글로벌 기능을 맡습니다
#eg. file field = image
# @uses one below
request ( ' image ' ) or request ()-> image or request ()-> file ( ' image ' )
# remember that request is available directly in the controller so :
$ this -> request ->image
# et pour enregistrer le fichier | and for saving :
request ( ' image ' )-> save (?string $ destinationName = null , bool $ replace = true ) or request ()-> image -> save (?string $ destinationName = null , bool $ replace = true ) or request ()-> file ( ' image ' )-> save (?string $ destinationName = null , bool $ replace = true )
# remember that request is available directly in the controller so :
$ this -> request -> image $ contact = new ContactModel ();
$ contact -> getForm ( " # " , [], true /* true to print */ )
# or use
echo $ contact -> getForm ();$ reset = false si vous ne souhaiter pas festionencer une requête를 사용하십시오. $ Table Pour Changer de Table 사용 (Cette Méthode vous l 'utiliserez Rarement)
- $ type doit être un dans [ '내부', '왼쪽 바깥', '오른쪽 바깥', '전체 외부']]]]]
- $ Fields String | 배열 예 : "user.id = article.id_user"| [ "user.id"=> "article.id_user"]
- $ Fields String | 배열 예 : "user.id = article.id_user"| [ "user.id"=> "article.id_user"]
- $ Fields String | 배열 예 : "user.id = article.id_user"| [ "user.id"=> "article.id_user"]
- $ key string | 배열 예 : "id = 1"| [ "ID"=> 1]
- $ 링크 문자열 여기서 $ 링크와 | 또는 | 이다
- $ Fields String | 배열 EX : "arnauld"| [2, 3, 5] | 안에
/**
* @param string|array $key
* @param null $operator
* @param null $val
* @return $this
*/
public function whereOr( $ key , $ val = null , $ operator = null , $ escape = true ) /**
* @param $key
* @param array $val
* @return $this
*/
public function whereIn( $ key , array $ val , $ escape = true ) /**
* @param string $str
* @return $this
*/
public function whereRaw( $ str ) /**
* @param $key
* @param array $val
* @return $this
*/
public function whereNotIn( $ key , array $ val , $ escape = true ) /**
* @param string $key
* @return $this
*/
public function whereNotNull( $ key ) /**
* @param string $key
* @return $this
*/
public function whereNull( $ key ) /**
* Adds an ascending sort for a field.
*
* @param string $field Field name
* @return object Self reference
*/
public function asc( $ field ) /**
* Adds an descending sort for a field.
*
* @param string $field Field name
* @return object Self reference
*/
public function desc( $ field ) /**
* Adds fields to order by.
*
* @param string $field Field name
* @param string $direction Sort direction
* @return object Self reference
*/
public function orderBy( $ field , $ direction = ' ASC ' ) /**
* Builds an insert query.
*
* @param array $data Array of key and values to insert
* @return bool
*/
public function insert( array $ data = [])Cette méthode doit être utilisée après une 조항
/**
* Builds an update query.
*
* @param array $data Array of keys and values, or string literal
* @return bool
*/
public function update( $ data ) /**
* Builds a delete query.
*
* @param string|int|array $where Where conditions
* @return bool
*/
public function delete( $ where = null )si $ raw_sql est null, la méthode retourne une chaine de caractères, Retourne $이 Sinon.
/**
* Gets or sets the SQL statement.
*
* @param string|array SQL statement
* @return self|string SQL statement
*/
public function sql( $ sql = null ) /**
* Saves an object to the database.
*
* @param object $objet Class instance
* @param array $db_fields Select database fields to save (insert or update)
* @return boolean
*/
public function save( $ objet = null , array $ db_fields = null ) /**
* Removes an object from the database.
*
* @param object
* @return boolean
*/
public function remove( $ objet = null )참고 : si tu as déjà utilisé un framework comme codeigniter 4 tu maitriseras vite autres méthodes groupby, 제한, 오프셋, 뚜렷한, select, last, find, min, count, avg, One, First et des méthodes dynamiques comme firstby {field}, findby {field}, findby {field}, field} 귀속 드 라 테이블.
/**
* Gets the database connection instance PDO.
*
* @return object Database connection
*/
public function getDb() /**
* Executes a sql statement.
*
* @return object Query results object
* @throws Exception When database is not defined
*/
public function execute( array $ params = []) /**
* Perform a query
*
* @param string $select
* @param array|string $where
* @param int $limit
* @param int $offset
* @return array - of object class
*/
public function get( $ select = " * " , $ where = null , $ limit = null , $ offset = null ) # Autres Méthodes
==================
/**
* Get the table name for this ER class.
*
* @access public
* @return string
*/
getTable ()
/**
* Get the primaryKey
*
* @access public
* @return string
*/
getPrimaryKey()
/**
* Get model property fields by data table.
*
* @access public
* @return array of available columns
*/
getFields ()
/**
* Create new data row.
*
* @access public
* @param array $properties
* @return object Model instance
* @return bool
*/
create (Array $ properties )
/**
* Find one model in the database.
* or create if not exists.
*
* @access public
* @param array $properties
* @return object Model instance
* @return array|bool if error occured
*/
findOrCreate (Array $ properties = null )
/**
* Find all model in the database.
*
* @access public
* @param mixed $where
* @return array|object
*/
public static function all( $ where = null ) <?php
namespace App Controller ;
use App Model Contact ;
class Home extends BaseController{
public function index (){
// Retrouve la méthod utilisée | HTTP Verb
if ( $ this -> request -> method () === ' post ' ){
// retrouve un fichier | retrouve uploaded file
$ image = $ this -> request -> file ( ' image ' );
// save
$ image -> save ();
// get the name of the moved file
echo $ image -> name ;
}
// Using model Contact
// all() est la seule méthode statique | all() is the only static method
$ contacts = Contact:: all ();
$ contacts = ( new Contact ())-> get ());
// Afficher la vue | display the vue
return $ this -> view ( " accueil " , [
" titre " => " Accueil "
]);
}
}
이란 푸프 /그레이터
Form Validator PDSCOPES/PHP- 형식 검증기
PHP 배열 pdscopes/php-array
Adhocore Adhocore/PHP-CLI의 PHP CLI
Copyright (C) 2021, faustfizz [email protected] 모든 권리 보유.
수정 유무에 관계없이 소스 및 이진 형태의 재분배 및 사용은 다음과 같은 조건이 충족되면 허용됩니다.
소스 코드의 재분배는 위의 저작권 통지,이 조건 목록 및 다음 면책 조항을 유지해야합니다.
이진 형식의 재분배는 위의 저작권 통지,이 조건 목록 및 문서의 다음 면책 조항 및 배포와 함께 제공되는 기타 자료를 재현해야합니다.
저작권 보유자의 이름이나 기고자의 이름은 사전 서면 허가 없이이 소프트웨어에서 파생 된 제품을 보증하거나 홍보하는 데 사용될 수 없습니다.
이 소프트웨어는 저작권 보유자 및 기고자 "와"그대로 "및 상업성에 대한 묵시적 보증 및 특정 목적에 대한 적합성을 포함하되 이에 국한되지 않는 명시 적 또는 묵시적 보증에 의해 제공됩니다. 어떠한 경우에도 저작권 보유자 또는 기고자는 직접, 간접적, 부수적, 특수, 모범적 또는 결과적 손해 (대체 상품 또는 서비스 조달, 사용 손실, 데이터 또는 이익; 또는 사업 중단)에 대해 책임을지지 않으면 서, 부정적인 책임 또는 불법 행위에 관계없이 어떤 책임이든, 불법 행위를 포함하는지에 대한 책임은 어떠한 경우에도 책임을지지 않습니다. 그러한 손상의 가능성에 대해 조언한다면.