techgardeners/sf-baseprj-bundle

Symfony2 使用的基础包

安装: 100

依赖: 1

建议: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:symfony-bundle

dev-master 2013-04-10 14:44 UTC

This package is not auto-updated.

Last update: 2024-09-14 14:30:25 UTC


README

基于 Symfony 2 的项目的基础包

安装

添加到您的 composer.json 中

"require": {
    "jms/serializer": ">=0.11.0",
    "egeloen/google-map-bundle": "1.0.0",
    "friendsofsymfony/user-bundle": "*",
    "avalanche123/imagine-bundle": "v2.1",
    "mobiledetect/mobiledetectlib": "dev-master", 
    "suncat/mobile-detect-bundle": "dev-master",
    "techgardeners/sf-baseprj-bundle": "dev-master"   
    
},

在 appKernel 中添加

        // Base bundle for project based on techgardeners/sfbaseprj
        new FOS\UserBundle\FOSUserBundle(), // https://github.com/FriendsOfSymfony/FOSUserBundle
        new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), // https://github.com/doctrine/DoctrineMigrationsBundle
        new Avalanche\Bundle\ImagineBundle\AvalancheImagineBundle(), // https://github.com/avalanche123/AvalancheImagineBundle           
        new SunCat\MobileDetectBundle\MobileDetectBundle(),  // http://knpbundles.com/egeloen/IvoryGoogleMapBundle
        new Ivory\GoogleMapBundle\IvoryGoogleMapBundle(),   // https://github.com/egeloen/IvoryGoogleMapBundle         
        new TechG\Bundle\SfBaseprjBundle\TechGSfBaseprjBundle(),  

通过导入路由文件,您将拥有登录、创建用户等内容的现成页面。

在 YAML 中

# app/config/routing.yml
tech_g_baseprj_bundle:
    resource: "@TechGSfBaseprjBundle/Resources/config/routing.yml"
    prefix:   /

在 config.yml 中添加

# app/config/config.yml

mobile_detect:
    redirect:
        mobile: ~
        tablet: ~
    switch_device_view: ~
    
#mobile_detect:
#    redirect:
#        mobile:
#            is_enabled: true            # default false
#            host: http://m.site.com     # with scheme (http|https), default null, url validate
#            status_code: 301            # default 302
#            action: redirect            # redirect, no_redirect, redirect_without_path 
#        tablet:
#            is_enabled: true            # default false
#            host: http://t.site.com     # with scheme (http|https), default null, url validate
#            status_code: 301            # default 302
#            action: redirect            # redirect, no_redirect, redirect_without_path 
#    switch_device_view:
#        save_referer_path: false        # default true
                                        # true  redirectUrl = http://site.com/current/path
                                        # false redirectUrl = http://site.com  
                                        
tech_g_sf_baseprj:
    debug:
        enable: true
    log:
        enable: true
        level: 1000
        queue: true
        savesession: true
        saverequest: true
        keepalive: true
        skippattern: /^\/gPanel/
    guesslocale:
        enable: true
        savesession: true        
        onlyfirstrequest: true        
    mobiledetect:
        enable: true
    geodecode:
        enable: true
        savesession: true        
    whitelist:
        enable: false
    blacklist:
        enable: false