Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/neoacevedo/yii2-material3

Extensión Material Components de Yii2
https://github.com/neoacevedo/yii2-material3

Last synced: about 1 month ago
JSON representation

Extensión Material Components de Yii2

Awesome Lists containing this project

README

        

Yii2 Material 3
============

Esta es una extensión primaria para [Yii framework 2.0](https://www.yiiframework.com). Encapsula componentes de [Material Design](https://m3.material.io/) en términos de Widgets Yii.

**NOTA**: Material 3 no tiene el componente `Card`, así que se ha adaptado el componente de la versión 2 para intentar seguir los lineamientos de la versión 3.

Instalación
------------

La forma preferida de instalar esta extensión es a través de [composer](http://getcomposer.org/download/).

Luego ejecute

```
php composer.phar require --prefer-dist neoacevedo/yii2-material3
```

o agregue

```js
"neoacevedo/yii2-material3": "*"
```

a la sección require de su archivo `composer.json`.

Uso
----

### Card e Icon Buttons

```php
registerCss($css);
?>

[
'class' => 'demo-card'
],
'titleOptions' => [
'class' => 'mdc-typography--headline6'
],
'subtitleOptions' => [
'class' => 'mdc-typography--subtitle2'
],
'title' => 'Our Changing Planet',
'subtitle' => 'by Kurt Wagner',
'mediaSrc' => 'https://material-components.github.io/material-components-web-catalog/static/media/photos/3x2/2.jpg',
'actions' => [
'icons' => [
Html::iconButton(['icon' => 'dictionary']),
Html::iconButton(['icon' => 'bookmark'])
]
]
]);
?>

Visit ten places on our planet that are
undergoing the biggest changes today.

```

### Material3ActiveForm

```php
'form'
]);
?>
...

```

### Material3ActiveField

```php
field($model, 'username', [
'options' => ['class' => 'mb-3']
])->textInput();

// Filled input
echo $form->field($model, 'password', [
'options' => ['class' => 'mb-3']
])->passwordInput(['variant' => 'filled']);

echo $form->field($model, 'remember_me')->checkbox();

?>
```

### Chips

```php
= \neoacevedo\yii2\material3\widgets\Chip::widget([
'chips' => [
[
'type' => \neoacevedo\yii2\material3\widgets\Chip::TYPE_ASSIST,
'options' => [
'label' => 'Chip 1'
]
],
[
'type' => \neoacevedo\yii2\material3\widgets\Chip::TYPE_INPUT,
'options' => [
'label' => 'Chip 2'
]
],
[
'type' => \neoacevedo\yii2\material3\widgets\Chip::TYPE_FILTER,
'options' => [
'label' => 'Chip 3'
]
],
[
'type' => \neoacevedo\yii2\material3\widgets\Chip::TYPE_SUGGESTION,
'options' => [
'label' => 'Chip 4'
]
],
]
]) ?>
```