Download the PHP package arnoson/kirby-template-sugar without Composer

On this page you can find all versions of the php package arnoson/kirby-template-sugar. 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 kirby-template-sugar

Kirby Template Sugar

A lightweight template compiler that adds some [syntactic sugar](https://en.wikipedia.org/wiki/Syntactic_sugar) to Kirby's php templates. Kirby's new [snippets with slots](https://getkirby.com/docs/guide/templates/snippets#passing-slots-to-snippets) allow you to adapt a component-based workflow, similar to Laravel blade templates or javascript frameworks like Vue. However, the plain php syntax can be verbose. So with some template sugar you can write this: instead of this: ## How Does It Work Your template files need to be compiled into regular php, similar to how other template languages work. But the goal of this project is not to create a new full-fledged template language for Kirby. Instead it embraces the existing php templates and just adds a little sugar where they tend to get too messy. You still write php/html (with syntax highlighting, intellisense, ...) and add a special ``, `` or `` tag here and there to keep things tidy. ## Getting Started The easiest way to get started is to check out one of the examples: - Use the [CLI example](https://github.com/arnoson/kirby-template-sugar/tree/main/examples/cli) if you want a minimal starter kit that doesn't rely on any other build tools. - Use the [Vite example](https://github.com/arnoson/kirby-template-sugar/tree/main/examples/vite) to compile your templates alongside your other frontend assets. To start manually (or convert an existing project), have a look at the [CLI](https://github.com/arnoson/kirby-template-sugar/tree/main/packages/npm-package#cli-usage) or the [Vite plugin](https://github.com/arnoson/kirby-template-sugar/tree/main/packages/vite-plugin). And make sure you also install the [Kirby plugin](https://github.com/arnoson/kirby-template-sugar/tree/main/packages/kirby-plugin). ## Syntax ### Snippets Snippets can have slots or be self-closing:
With Sugar Compiled
### Props and attributes Snippets can have `props`, which are passed directly to the snippet, and attributes, which are grouped into an `$attr` variable passed to the snippet along with the props. Props start with `$` (like `$open` and `$items`) and attributes are just specified like regular html attributes (`class`, `aria-label`). If you want to pass a php expression to a snippet, e.g.: `items => $site->children()->listed()`, you just have to wrap it in php tags (see the code below):
With Sugar Compiled
Well... actually the compiled code looks like this. To make debugging easier, the line numbers will stay the same:
With Sugar Compiled
This makes it super easy to implement a snippet like this: Or even better with @fabianmichael's fantastic [kirby-template-attributes](https://github.com/fabianmichael/kirby-template-attributes) ### Prop shorthand syntax If your prop names and php variable names are the same you can use the shorthand syntax: Would be the same as: ### CSS Variables You can assign CSS variables with an attribute-like syntax. This works on any tag, not just `` and ``. Note: you can omit the `var()` if you are referencing another variable name (like `--some-variable`).
With Sugar Compiled
### Layouts If you also use Kirby's [layouts](https://github.com/getkirby/layouts) you can define them with the `` tag:
With Sugar Compiled
Or with slots and even props and attributes
With Sugar Compiled
## Debugging If you are using [xdebug](https://xdebug.org/), you won't be able to set breakpoints through your IDE, but you can use `xdebug_break()` in your source file. To remove the breakpoint, simply remove `xdebug_break()` and save the source file again. ## Credits - [magic-string](https://github.com/rich-harris/magic-string) - [glob](https://github.com/isaacs/node-glob) - [CAC](https://github.com/cacjs/cac) - [chokidar](https://github.com/paulmillr/chokidar)

All versions of kirby-template-sugar with dependencies

PHP Build Version
Package Version
Requires getkirby/composer-installer Version ^1.2
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 arnoson/kirby-template-sugar contains the following files

Loading the files please wait ....