dev-master
9999999-dev https://github.com/brookinsconsulting/BcKnockoutJSBundleSymfony BcKnockoutJSBundle
MIT
The Requires
- php >=5.6.0
- symfony/symfony 3.2.*
- jms/di-extra-bundle ^1.8
by Adam Prager
javascript symfony knockoutjs knockout mvvm
Wallogit.com
2017 © Pedro Peláez
Symfony BcKnockoutJSBundle
Integrates knockout.js into Symfony2, provides automatic code generation for collections., (*1)
$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)
"brookinsconsulting/bcknockoutjsbundle": "dev-master",
$bundles = array(
...
new BrookinsConsulting\BcKnockoutJSBundle\BcKnockoutJSBundle(),
);
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., (*3)
<script src="{{ asset('bundles/bcknockoutjs/js/knockout-3.4.1.js') }}"></script>
{{ knockout(form.vars.knockout)|raw }}
{{ form_widget(form) }}
This package does infact depend upon the 'jms/di-extra-bundle' bundle., (*4)
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., (*5)
Symfony BcKnockoutJSBundle
MIT
javascript symfony knockoutjs knockout mvvm