PHP Classes

Nano PHP Framework: Build applications with the minimum amount of code

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 40 All time: 10,896 This week: 45Up
Version License PHP version Categories
nanophp 1.0MIT/X Consortium ...5PHP 5, Libraries, Design Patterns
Description 

Author

This package provides a framework to build applications with the minimum amount of code.

It provides several classes that implement common features that PHP applications need, so developers need to develop applications.

Currently, it provides classes to:

- Controller classes to implement a user authentication system and processing strings

- Model class to store and retrieve user data

- View scripts to display the output of applications to Web pages

- Configuration classes to load the values of application details

Picture of Juan Camacho
  Performance   Level  
Name: Juan Camacho <contact>
Classes: 5 packages by
Country: Spain Spain
Age: 45
All time rank: 4039108 in Spain Spain
Week rank: 273 Up7 in Spain Spain Up
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

Example

<?php

require_once 'src/Config/Database.php';
require_once
'src/Controllers/AuthController.php';

use
src\Controllers\AuthController;


// Handle login form submission
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['username'], $_POST['password'])) {
   
$authController = new AuthController();

   
$username = $_POST['username'];
   
$password = $_POST['password'];

   
$user = $authController->login($username, $password);

    if (
$user) {
       
print_r($user);
       
// Successful login, token and cookie are generated.
        // Redirect to the protected page or handle the result accordingly
       
header('Location: protected_page.php');
        exit();
    } else {
       
// Handle login failure, show error message
       
$errorMessage = 'Invalid username or password';
    }
}

// Render the login form
include 'src/views/login.php';

?>


Details

NanoPhp

NanoPhp is an attemp to minimalist PHP framework designed to provide a lightweight and flexible foundation for web application development.

Features

  • Basic MVC (Model, View, Controller) structure.
  • Stateless auth approach.
  • Minimalistic configuration setup.

Requirements

  • PHP 7.4 or higher

Documentation

  • Auth ? Authentication Class.
  • Str ? Strings helper Class _(string manipulation, parse, comprobation...)_

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.


  Files folder image Files (22)  
File Role Description
Files folder imageDocs (2 files)
Files folder imagesrc (4 directories)
Accessible without login Plain text file .htaccess Data Auxiliary data
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file middleware.php Example Example script
Accessible without login Plain text file protected_page.php Example Example script
Accessible without login Plain text file Readme.md Doc. Documentation
Accessible without login Plain text file register.php Example Example script

  Files folder image Files (22)  /  Docs  
File Role Description
  Accessible without login Plain text file Authentication.md Data Auxiliary data
  Accessible without login Plain text file Str.md Data Auxiliary data

  Files folder image Files (22)  /  src  
File Role Description
Files folder imageConfig (2 files)
Files folder imagecontrollers (2 files, 1 directory)
Files folder imageModels (1 file)
Files folder imageviews (2 files)

  Files folder image Files (22)  /  src  /  Config  
File Role Description
  Plain text file Database.php Class Class source
  Plain text file Login.php Class Class source

  Files folder image Files (22)  /  src  /  controllers  
File Role Description
Files folder imageStringControler (7 files)
  Plain text file AuthController.php Class Class source
  Plain text file StringControler.php Class Class source

  Files folder image Files (22)  /  src  /  controllers  /  StringControler  
File Role Description
  Plain text file CaseTrait.php Class Class source
  Plain text file CheckersTrait.php Class Class source
  Plain text file CountTraits.php Class Class source
  Plain text file ExtractTrait.php Class Class source
  Plain text file ManipulationTraits.php Class Class source
  Plain text file ParsingTrait.php Class Class source
  Plain text file ReplaceTrait.php Class Class source

  Files folder image Files (22)  /  src  /  Models  
File Role Description
  Plain text file User.php Class Class source

  Files folder image Files (22)  /  src  /  views  
File Role Description
  Accessible without login Plain text file login.php Aux. Auxiliary script
  Accessible without login Plain text file register.php Aux. Auxiliary script

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:40
This week:0
All time:10,896
This week:45Up