qpautrat/reactjs-php-bundle
最新稳定版本:1.0.0
Composer 安装命令:
composer require qpautrat/reactjs-php-bundle
包简介
Render ReactJS component in server side using reactjs/react-php-v8js
README 文档
README
Render ReactJS components in server side using reactjs/react-php-v8js
Prerequisites
Installation
composer require qpautrat/reactjs-php-bundle
Whitelist following library in require section until maintainers release a version on packagist
"reactjs/react-php-v8js": "*@dev"
Register the bundle in your AppKernel
new QPautrat\ReactjsPhpBundle\ReactjsPhpBundle()
Configuration
Add in your config.yml file
reactjs_php: library_path: path_to_reactjs_library app_path: path_to_app_components
Usage
Use helper with php engine
<?php echo $view['reactjs']->renderMarkup('Component', array('foo' => 'bar')) ?> <?php echo $view['reactjs']->renderJS('Component', '#dom_element', array('foo' => 'bar')) ?>
Or you can use our twig extension as well
{{ 'Component'|reactjs_render_markup({'foo':'bar'}) }}
{{ 'Component'|reactjs_render_js('#component', {'foo':'bar'}) }}
Demo
We provide a small demo application in another repository, living in a docker container, that you can use to test.
License
This bundle is available under the MIT License
统计信息
- 总下载量: 57
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 28
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-08-10