PHPackages                             e-frank/yii2-knockout - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. e-frank/yii2-knockout

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

e-frank/yii2-knockout
=====================

ActiveForm replacement. Automatically generates knockoutjs viewmodels from yii ActiveRecords. Allows computed fields and nested forms.

1.2.0(7y ago)52723BSD-3-ClausePHP

Since Jun 11Pushed 7y ago2 watchersCompare

[ Source](https://github.com/e-frank/yii2-knockout)[ Packagist](https://packagist.org/packages/e-frank/yii2-knockout)[ RSS](/packages/e-frank-yii2-knockout/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (5)Versions (5)Used By (0)

Knockout Viewmodel Generator for Yii2
=====================================

[](#knockout-viewmodel-generator-for-yii2)

This extension provides a replacement for **ActiveForm**. A **KnockoutJS viewmodel** is automatically generated (using knockout mapping lib), which serves a starting point for your customization, e.g. computed observables. Moreover you get some more input types, like "**decimal**", "**percent**", "**date**" and "**datetime**", which display the raw data in the user's locale format and store the data in ISO-format.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist e-frank/yii2-knockout "*"

```

or add

```
"e-frank/yii2-knockout": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

example code for a view. note that you would place model load and validation code in your controller/action.

```
