Skip to content
Permalink
Browse files

Ported the documentation to Docsify

  • Loading branch information
cedx committed Nov 26, 2020
1 parent 6be27a9 commit 573714e4070081ae9a2c75a46de81de59965bc2a
@@ -3,7 +3,7 @@
!/.vscode/

/build/
/doc/api/
/docs/api/
/var/
/vendor/
/www/
@@ -1,5 +1,5 @@
# MIT License
Copyright © 2014 - 2020 Cédric Belin
Copyright © 2014 - 2021 Cédric Belin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -1,7 +1,7 @@
# Mustache for Yii
![Yii Framework](https://badgen.net/badge/yii/%3E%3D2.0.0/green) ![Runtime](https://badgen.net/packagist/php/cedx/yii2-mustache) ![Release](https://badgen.net/packagist/v/cedx/yii2-mustache) ![License](https://badgen.net/packagist/license/cedx/yii2-mustache) ![Downloads](https://badgen.net/packagist/dt/cedx/yii2-mustache) ![Coverage](https://badgen.net/coveralls/c/github/cedx/yii2-mustache) ![Build](https://badgen.net/github/checks/cedx/yii2-mustache/main)

[Mustache](https://mustache.github.io) templating for the [Yii Framework](https://www.yiiframework.com).
> [Mustache](https://mustache.github.io) templating for the [Yii Framework](https://www.yiiframework.com).
## Documentation
- [User guide](https://docs.belin.io/yii2-mustache)
BIN -14.7 KB doc/img/favicon.ico
Binary file not shown.
Empty file.
@@ -7,7 +7,7 @@ This renderer allows to use [Mustache syntax](https://mustache.github.io/mustach
## Quick start
Install the latest version of **Mustache for Yii** with [Composer](https://getcomposer.org):

``` shell
```shell
composer require cedx/yii2-mustache
```

@@ -0,0 +1,5 @@
- [Installation](installation.md)
- [Usage](usage.md)
- About
- [License](about/license.md)
- [See also](about/see_also.md)
@@ -1,5 +1,5 @@
# MIT License
Copyright © 2014 - 2020 Cédric Belin
Copyright © 2014 - 2021 Cédric Belin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
File renamed without changes.
BIN +14.7 KB docs/favicon.ico
Binary file not shown.
BIN +6.55 KB docs/favicon.png
Binary file not shown.
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Mustache for Yii</title>

<meta name="application-name" content="Mustache for Yii">
<meta name="author" content="Cédric Belin - cedric@belin.io">
<meta name="description" content="Mustache templating for the Yii Framework.">
<meta name="format-detection" content="telephone=no">
<meta name="referrer" content="same-origin">
<meta name="theme-color" content="#3e7fca">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, shrink-to-fit=no, user-scalable=no, width=device-width">

<link rel="icon" href="favicon.ico" sizes="16x16 32x32 48x48" type="image/x-icon">
<link rel="icon" href="favicon.png" sizes="192x192" type="image/png">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify/lib/themes/vue.css">

<script>
window.$docsify = {
alias: {"/.*/_sidebar.md": "/_sidebar.md"},
auto2top: true,
ga: "UA-38560031-41",
loadSidebar: true,
name: "Mustache for Yii",
repo: "https://git.belin.io/cedx/yii2-mustache",
themeColor: "#3e7fca"
};
</script>

<script defer src="https://cdn.jsdelivr.net/npm/docsify"></script>
<script defer src="https://cdn.jsdelivr.net/npm/docsify/lib/plugins/ga.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/prismjs/components/prism-bash.min.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/prismjs/components/prism-php.min.js"></script>
</head>

<body>
<div id="app"></div>
</body>
</html>
@@ -6,31 +6,28 @@ and [Composer](https://getcomposer.org), the PHP package manager, up and running

You can verify if you're already good to go with the following commands:

``` shell
```shell
php --version
# PHP 7.4.12 (cli) (built: Oct 27 2020 17:18:33) ( NTS Visual C++ 2017 x64 )
# PHP 8.0.0 (cli) (built: Nov 24 2020 22:02:58) ( NTS Visual C++ 2019 x64 )
composer --version
# Composer version 2.0.7 2020-11-13 17:31:06
```

!!! info
If you plan to play with the package sources, you will also need the latest versions of
[PowerShell](https://docs.microsoft.com/en-us/powershell) and [Material for MkDocs](https://squidfunk.github.io/mkdocs-material).
?> If you plan to play with the package sources, you will also need the latest versions of [PowerShell](https://docs.microsoft.com/en-us/powershell).

## Installing with Composer package manager

### 1. Install it
From a command prompt, run:

``` shell
```shell
composer require cedx/yii2-mustache
```

### 2. Import it
Now in your [PHP](https://www.php.net) code, you can use:

``` php
<?php
```php
use yii\mustache\ViewRenderer;
```
@@ -3,8 +3,8 @@
## Configuring application
In order to start using [Mustache](https://mustache.github.io) you need to configure the `view` application component, like the following:

``` php
<?php return [
```php
return [
"components" => [
"view" => [
"class" => "yii\\web\\View",
@@ -18,8 +18,7 @@ In order to start using [Mustache](https://mustache.github.io) you need to confi

After it's done you can create templates in files that have the `.mustache` extension (or use another file extension but configure the component accordingly). Unlike standard view files, when using [Mustache](https://mustache.github.io) you must include the extension in your `$this->render()` controller call:

``` php
<?php
```php
use yii\web\{Controller, Response};
class AppController extends Controller {
@@ -35,8 +34,8 @@ The best resource to learn Mustache basics is its official documentation you can
### Variables
Within Mustache templates the following variables are always defined:

- `app`: the [`Yii::$app`](https://www.yiiframework.com/doc/api/2.0/yii-baseyii#$app-detail) instance.
- `this`: the current [`View`](https://www.yiiframework.com/doc/api/2.0/yii-base-view) object.
- `app`: the `\Yii::$app` instance.
- `this`: the current `\yii\base\View` object.

### Lambdas
- `format`: provides a set of commonly used data formatting methods.

This file was deleted.

@@ -4,11 +4,11 @@
xmlns="http://www.phpdoc.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://docs.phpdoc.org/latest/phpdoc.xsd">

<title>Mustache for Yii</title>
<paths>
<cache>../var/phpdoc</cache>
<output>../doc/api</output>
<output>../docs/api</output>
</paths>
<version number="10.1.0">
<api>

This file was deleted.

This file was deleted.

0 comments on commit 573714e

Please sign in to comment.