PHPackages                             parsgit/night - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. parsgit/night

ActiveProject[Framework](/categories/framework)

parsgit/night
=============

Night Framework.

1.2.12(6y ago)035MITPHPPHP ^7.0.0

Since Oct 13Pushed 6y agoCompare

[ Source](https://github.com/benkhalife/night)[ Packagist](https://packagist.org/packages/parsgit/night)[ RSS](/packages/parsgit-night/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (6)DependenciesVersions (11)Used By (0)

[![PHP Composer](https://github.com/parsgit/night/workflows/PHP%20Composer/badge.svg?branch=master)](https://github.com/parsgit/night/workflows/PHP%20Composer/badge.svg?branch=master)

Night Framework
===============

[](#night-framework)

A simple and lightweight framework that gives you more speed .

Install
-------

[](#install)

```
composer create-project parsgit/night blog

```

The Basics
----------

[](#the-basics)

### Input Value

[](#input-value)

```
// input all params
$all = input();

// sample
$name = input('name');

$name = input('name','default_value_if_not_exists');
```

```
// get Requests
$name = get('name','Default value');

// post Requests
$name = post('name');
$age = post('age',18);
```

### Path Helper

[](#path-helper)

```
root_path();   // root project directory path
public_path(); // public directory path
app_path();    // app directory path
storage_path(); // storage directory path
views_path();   // views directory path
```

night framework sample usage in path helper

```
$app_path=app_path('Storage/text.txt');

echo $app_path;
//output sample : var/www/site/html/app/Storage/text.txt
```

### Url Helper

[](#url-helper)

#### url

[](#url)

To get and use the url address

```
url();// yoursite.com
url('account/login'); // yoursite.com/account/login
```

#### route\_url / params\_url

[](#route_url--params_url)

Get route address For example we enter the `http://yoursite.com/account/login` address in the browser The output will be as follows

```
$route=route_url();
//output: account/login

$route=params_url();
// output array:['account','login']
```

### method / isGet / isPost

[](#method--isget--ispost)

```
//Returns the REQUEST METHOD type
$request = method();  // POST or GET

//If the REQUEST METHOD of the get type returns true
if(isGet()){
  // code
}

//If the REQUEST METHOD of the post type returns true
if(isPost()){
  // post
}
```

Basic Controllers
-----------------

[](#basic-controllers)

pageController.php

```
