Giter Site home page Giter Site logo

mefroenropa / jsonize Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alirezajavadigit/jsonize

0.0 0.0 0.0 19 KB

JSONize: Standardize JSON responses effortlessly! Ensure consistency in your applications with our streamlined library. Simplify data formatting, enhance readability, and save time. JSONize empowers developers to generate clean, organized JSON outputs, perfect for APIs, web, and mobile apps. Revolutionize your workflow today!

License: MIT License

PHP 100.00%

jsonize's Introduction

JSONize

JSONize: Standardize JSON responses effortlessly!

Ensure consistency in your applications with our streamlined library. Simplify data formatting, enhance readability, and save time. JSONize empowers developers to generate clean, organized JSON outputs, perfect for APIs, web, and mobile apps. Revolutionize your workflow today!

Installation

You can install JSONize via Composer:

composer require alirezajavadi/jsonize

Usage

Once JSONize is installed, you can start using it in your projects. Here's a basic example of how to use JSONize:

<?php
//init
use JSONize\App\Response;

$response = Response::getInstance();
//

// Examples:

// 1. Success Example
$response->message("Deleted SuccessFully")->end();
/*
result
    {
        "success": true,
        "message": "Deleted SuccessFully",
        "data": null,
        "status": [
            200,
            "ok"
        ]
    }
*/

// 2. Error Example
$response->message("User Not Found")->status(404)->end();
/*
result
    {
        "success": false,
        "message": "User Not Found",
        "data": null,
        "status": [
            404,
            "Not Found"
        ]
    }

*/

// 3. Other Example
$response->status(204)->end();
/*
result
    {
        "success": true,
        "message": null,
        "data": null,
        "status": [
            204,
            "No Content"
        ]
    }
*/
/*
note the end() is important to use;
*/

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue if you encounter any problems or have suggestions for improvements.

License

JSONize is open-source software licensed under the MIT license.

Author

This library is created and maintained by Alireza Javadi. You can reach out to me at [email protected].

jsonize's People

Contributors

alirezajavadigit 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.