yepsua/smartwig-bundle

jQuery、jQueryUI(以及更多)的Symfony包

安装数: 3,859

依赖项: 3

建议者: 0

安全: 0

星级: 22

关注者: 5

分支: 6

开放问题: 0

语言:JavaScript

类型:symfony-bundle

v1.1.0 2014-01-29 22:57 UTC

This package is auto-updated.

Last update: 2024-08-28 11:34:58 UTC


README

YepsuaSmarTwigBundle

是一组Twig标签,允许以简单的方式创建jQueryUI小部件。

使用Symfony2和jQuery4PHP创建RIA(富互联网应用程序)。

访问展示

安装

在Symfony 2.0.x上安装

$ git clone --recursive https://github.com/oyepez003/YepsuaSmarTwigBundle.git vendor/bundles/Yepsua/SmarTwigBundle

更新包

$ cd vendor/bundles/Yepsua/SmarTwigBundle
$ git pull -v --progress  "origin"
$ git submodule update --init

在Symfony 2.1.x或更高版本上安装

下载并确保运行最新版本的composer.phar,执行以下命令

$ php composer.phar self-update

在composer.json文件中添加以下依赖项

"require": {
        ...
        "yepsua/smartwig-bundle": "1.1.*"
        ...
    },

安装和更新包

$ php composer.phar update yepsua/smartwig-bundle

配置

*** 注意:如果您使用的是Sf 2.1.x或更高版本,请跳到步骤3

1) 将Yepsua命名空间添加到您的自动加载器中

<?php
// app/autoload.php

$loader->registerNamespaces(array(
    'Yepsua' => __DIR__.'/../vendor/bundles',
    // ...
);

2) 在自动加载器中激活jQuery4PHP库

将以下代码复制到文件末尾

<?php
// app/autoload.php
include_once __DIR__.'/../vendor/bundles/Yepsua/SmarTwigBundle/vendor/YepSua/Labs/RIA/jQuery4PHP/YsJQueryAutoloader.php';
YsJQueryAutoloader::register();

3) 将YepsuaSmarTwigBundle添加到您的应用程序内核中

<?php
// app/AppKernel.php

public function registerBundles()
{
    return array(
        new Yepsua\SmarTwigBundle\YepsuaSmarTwigBundle(),
        // ...
    );
}

4) 发布资源

运行symfony命令

$ php app/console assets:install web

5) 在布局中包含SmarTwigBundle资源

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>YepsuaSmarTwigBundle</title>

  {% include 'YepsuaSmarTwigBundle::smartwigAssets.html.twig' %}

</head>
<body>
  {% ui_dialog  %}
    Hello World!.
  {% end_ui_dialog %}
</body>
</html>

享受

展示 Twig jQuery4PHP