Download the PHP package avik/canvas without Composer

On this page you can find all versions of the php package avik/canvas. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package canvas

avik/canvas

Canvas is the view and template layer of the Avik framework.

It is intentionally simple, PHP-first, and predictable.

Canvas is not Blade, not a new language, and not a logic engine. It is a very thin declarative layer that compiles to plain PHP and renders HTML.


Philosophy

Canvas follows these strict principles:

Canvas is designed to be stable for years without redesign.


What Canvas Is


What Canvas Is NOT

Canvas does not try to replace PHP. It only removes small pain points.


Supported Syntax (Final & Closed)

⚠️ The syntax below is FINAL and IMMUTABLE. No new directives will be added in future versions.

Output

text @component('card', ['title' => 'User Profile']) @slot('body')

This is the profile body.

@endslot

@endcomponent html

{{ title }}

@yieldSlot('body')


### Advanced Features

- **View Composers**: Bind data to specific views automatically.
- **Custom Directives**: Extend the compiler with your own syntax.
- **Shared Data**: Share variables across all views.
- **Exception Handling**: Detailed exceptions for missing views or components.

### Example Usage

Rendering a View
$factory = new Factory(
    viewsPath: __DIR__ . '/views',
    cachePath: __DIR__ . '/storage/canvas'
);

$view = $factory->make('home', [
    'title' => 'Welcome',
    'users' => $users,
    'isAdmin' => true,
]);

echo $view->render();

Compilation & Caching

Templates are compiled to plain PHP

Compiled files are cached by file hash

No runtime parsing

No performance penalty after first render

All versions of canvas with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
avik/seed Version ^1.0
avik/essence Version ^1.0
avik/crate Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package avik/canvas contains the following files

Loading the files please wait ...