jlaso/visit-control-bundle

用于 Symfony2 项目的访问控制

dev-master 2018-11-14 20:50 UTC

This package is auto-updated.

Last update: 2024-09-15 10:35:33 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

JaitecClickBundle

  • 此包提供了一个简单的方法来控制我们项目页面被访问的次数

安装

将 JaitecClickBundle 添加到 vendor/bundles/ 目录

::

$ git submodule add https://bitbucket.org/jlaso/jaitecclickbundle.git vendor/bundles/Jaitec/ClickBundle

或将其添加到 deps 中

[JaitecClickBundle]    
    git=https://bitbucket.org/jlaso/jaitecclickbundle.git
    target=/bundles/Jaitec/ClickBundle

然后运行

$ php bin/vendors update

将 Jaitec 命名空间添加到您的自动加载器

::

// app/autoload.php
$loader->registerNamespaces(array(
    'Jaitec' => __DIR__.'/../vendor/bundles',
    // your other namespaces
);

将 JaitecClickBundle 添加到您的应用程序内核

::

// app/AppKernel.php

public function registerBundles()
{
    return array(
        // ...
        new Jaitec\ClickBundle\JaitecClickBundle(),
        // ...
    );
}

使用示例

::

configuration sample

//app/config.yml

#every time a route is visited
jaitec_click:
    routes:
        # this is a logic name and can be anything
        demo:
            # this match to logic route (not pattern) defined in routing.yml
            route: _demo_hello
            # the type in to save at jaitec_click table
            entity_type: demo
            # this is for no id, the route contains a name or slug
            entity_id: ~
            entity_name: name
        another:
            route: _demo
            entity_type: demo
            # the route not contains any info because is a fixed route
            entity_id: 1
            entity_name: ~

更多信息请访问我的西班牙语网站