https://github.com/brookinsconsulting/bcknockoutjsbundle
[Updated for Symfony 3.2 but still DEPRECATED] Integrates knockout.js into Symfony2/3. Provides automatic code generation for collections.
https://github.com/brookinsconsulting/bcknockoutjsbundle
knockoutjs php symfony symfony-bundle
Last synced: 7 months ago
JSON representation
[Updated for Symfony 3.2 but still DEPRECATED] Integrates knockout.js into Symfony2/3. Provides automatic code generation for collections.
- Host: GitHub
- URL: https://github.com/brookinsconsulting/bcknockoutjsbundle
- Owner: brookinsconsulting
- License: mit
- Fork: true (Padam87/KnockoutJSBundle)
- Created: 2017-02-24T01:58:27.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-24T07:37:58.000Z (over 9 years ago)
- Last Synced: 2024-04-07T15:20:37.606Z (about 2 years ago)
- Topics: knockoutjs, php, symfony, symfony-bundle
- Language: PHP
- Homepage:
- Size: 85.9 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BC KnockoutJS
Integrates knockout.js into Symfony2, provides automatic code generation for collections.
## 1. Example ##
$builder
->add('items', 'knockout', array(
'type' => new OrderItemType(),
'allow_add' => true,
'allow_delete' => true,
'prototype' => true,
'by_reference' => false,
))
;
I have added the items field with the KnockoutType, which extends the CollectionType, and handled the same way as a collection.
## 2. Installation
### 2.1. Composer:
"brookinsconsulting/bcknockoutjsbundle": "dev-master",
### 2.2. AppKernel:
$bundles = array(
...
new BrookinsConsulting\BcKnockoutJSBundle\BcKnockoutJSBundle(),
);
### 2.3. config.yml:
imports:
...
- { resource: "@BcKnockoutJSBundle/Resources/config/config.yml" }
# BcKnockoutJS Bundle Configuration
jms_di_extra:
locations:
all_bundles: false
bundles: [BcKnockoutJSBundle]
directories: ["%kernel.root_dir%/../src"]
jms\_di\_extra configuration is unnecessary if you have set all_bundles to true which is strongly discouraged for performance reasons by the upstream dependant bundle in question.
### 2.4. Add the js to your page.
### 2.5. Create your view
{{ knockout(form.vars.knockout)|raw }}
{{ form_widget(form) }}
## 3. Dependencies
This package does infact depend upon the 'jms/di-extra-bundle' bundle.
For testing purposes the original author used his now private BaseBundle, if you want to test it, you have to include it in your composer.json file too.
## 4. Stuff to do
- Generator. Right now the command is there, but its not working properly.