๐Ÿšฆ Viewi PHP integration for your Leaf apps

Related tags

Miscellaneous viewi
Overview



Leaf Viewi Module



Latest Stable Version Total Downloads License

This module allows you to quickly and easily integrate Viewi into your Leaf apps without any pain at all.

Installation

You can easily install Leaf Viewi using the Leaf CLI:

leaf install viewi

Or with Composer.

composer require leafs/viewi

Basic Usage

After installing the module, you can setup a viewi-app/components folder as prescribed by the Viewi docs. In there you can create your Viewi components. Back in your Leaf entry point, all you need to do is initialize the Leaf Viewi module and add your viewi routes.

<?php

require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/viewi-app/components/HomePage.php';

viewi()->init();

// This is a viewi route.
viewi()->get('/', HomePage::class);

app()->get('/something', function () {
  echo 'This is a Leaf route';
});

app()->run();

By default, the Leaf Viewi module will handle the configuration for Viewi, so you don't need to anything unless you want to use your own setup. In that case, you can pass the Viewi config into viewi()->init();:

<?php

use Viewi\PageEngine;

require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/viewi-app/components/HomePage.php';

viewi()->init([
  PageEngine::SOURCE_DIR => __DIR__ . '/ViewiApp/Components',
  PageEngine::SERVER_BUILD_DIR =>  __DIR__ . '/ViewiApp/build',
  PageEngine::PUBLIC_ROOT_DIR => __DIR__,
  PageEngine::DEV_MODE => true,
  PageEngine::RETURN_OUTPUT => true,
  PageEngine::COMBINE_JS => true
]);

viewi()->get('/', HomePage::class);

app()->get('/something', function () {
  echo 'This is a Leaf route';
});

app()->run();

Contributing

We are glad to have you. All contributions are welcome! To get started, familiarize yourself with our contribution guide and you'll be ready to make your first pull request ๐Ÿš€ .

To report a security vulnerability, you can reach out to @mychidarko or @leafphp on twitter. We will coordinate the fix and eventually commit the solution in this project.

Code contributors


Ivan Voitovych

Michael Darko

๐Ÿคฉ Sponsoring Leaf

Your cash contributions go a long way to help us make Leaf even better for you. You can sponsor Leaf and any of our packages on open collective or check the contribution page for a list of ways to contribute.

And to all our existing cash/code contributors, we love you all โค๏ธ

Cash contributors


Aaron Smith

Peter Bogner

Vano

Casprine

Farhan Yahaya

Lucas Chaplain
You might also like...
AccessibleBundle provides an Accessible integration for your Symfony projects

AccessibleBundle AccessibleBundle provides an Accessible integration for your Symfony projects. This will allow you to define your class behavior usin

Integration with your Symfony app & Stimulus!

StimulusBundle: Symfony integration with Stimulus! This bundle adds integration between Symfony, Stimulus and Symfony UX: A) Twig stimulus_* functions

A bot written in PHP which attempts to link IRC with SQL database, allowing for integration between platforms

Valeyard IRC-SQL-GateWay A bot written in PHP which attempts to link IRC with SQL database, allowing for integration between platforms. This bot is mo

the repository uses some of the code from php-meminfo to simplify integration

the repository uses some of the code from php-meminfo to simplify integration

QuickBooks Integration for PHP

QuickBooks PHP DevKit QuickBooks integration support for PHP 5.x+ The package you've downloaded contains code and documentation for connecting various

Laravel Integration for Switchover PHP SDK. Feature Toggle Management made easy.

Switchover Laravel Integration Switchover Switchover is a Software-As-A-Service for managing feature toggles (aka switches, flags or feature flips) in

Simple php-imap integration for Symfony 2.8, 3.x and 4.x.

PHP-IMAP integration bundle Simple php-imap integration for Symfony 4.x, 5.x and 6.x. The version 1.5 and above are only compatible with Symfony 4+. P

A project of a Login screen made in PHP/CSS3/HTML5/JS with MySQL database integration
A project of a Login screen made in PHP/CSS3/HTML5/JS with MySQL database integration

A project of a Login screen made in PHP/CSS3/HTML5/JS with MySQL database integration. And animations made with CSS3 and JavaScript itself! ๐Ÿ˜Š

ShurjoPay payment gateway integration for PHP applications.

ShurjoPay PHP Library Using this library you can integrate ShurjoPay payment gateway into your PHP applications. If you face any problem then create i

Releases(v0.1.0)
Owner
Leaf Framework
Create clean, simple but powerful web applications and APIs quickly.
Leaf Framework
Viewi - Tour of Heroes app and tutorial

Viewi - Tour of Heroes app and tutorial

Ivan Voitovych 9 Oct 3, 2022
Leaf's very own high-speed, high-performance server

[WIP] Leaf Eien Server Eien is Leaf's implementation of a high-speed, high-performance server based on powerful tools like Open Swoole and Swoole. Eie

Leaf Framework 8 Dec 28, 2022
EBook-Apps - The eBook Apps is a web application that helps you browse ebooks from anywhere using your smartphone and laptop.

โšก๏ธ eBook Apps The eBook Apps is a web application that helps you browse ebooks from anywhere using your smartphone and laptop. ?? Getting Started To s

Ahmad Fauzy 32 Nov 14, 2022
Send your laravel apps to the moon with web3 enabled ๐Ÿš€

Laravel Web3 ?? ?? Laravel Web3 helps you to kickstart your web3 apps. No more headache with handling wallet changing address and sync with laravel ba

Ricardo Sawir 15 Oct 29, 2022
A Laravel Wrapper for the Binance API. Now easily connect and consume the Binance Public & Private API in your Laravel apps without any hassle.

This package provides a Laravel Wrapper for the Binance API and allows you to easily communicate with it. Important Note This package is in early deve

Moinuddin S. Khaja 7 Dec 7, 2022
Prepare your Laravel apps incredibly fast, with various commands, services, facades and boilerplates.

Grafite Builder Grafite has archived this project and no longer supports or develops the code. We recommend using only as a source of ideas for your o

Grafite Inc 997 Dec 22, 2022
Venture allows you to create and manage complex, async workflows in your Laravel apps.

Venture is a package to help you build and manage complex workflows of interdependent jobs using Laravel's queueing system. Installation Note: Venture

Kai Sassnowski 680 Dec 14, 2022
Fly50W is a new language which helps you build simple apps using more than 500k lines of code easily.

Fly50W is a new language which helps you build simple apps using more than 500k lines of code easily. Installation

null 4 Jun 22, 2022
Laravel Plans is a package for SaaS apps that need management over plans, features, subscriptions, events for plans or limited, countable features.

Laravel Plans Laravel Plans is a package for SaaS apps that need management over plans, features, subscriptions, events for plans or limited, countabl

รกngel 2 Oct 2, 2022
Demo Silverstripe and JavaScript sources for Lightning Talk "FormField Mini Apps" at StripeCon EU 2022

Watch the Lightning Talk on Youtube ?? Demo repository for Lightning Talk "FormField Mini Apps with the JavaScript framework/lib/style of your choice"

Julian Scheuchenzuber 2 Sep 20, 2022