sfMobileJPlugin - 0.1.0

for mobile contents plugin

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

sfMobileJPlugin - for Mobile contents developer's

This plugin includes a convenient class for mobile contents developer.

Overview

The main function is as follows:

* I can easily use Net_UserAgent_Mobile from symfony.
* The parameter for acquiring imodeID to a DoCoMo terminal is given automatically.
* A career exception or a common template can be created separately.
* etc...

Requirements

This plugin needs "Net_UserAgent_Mobile" of the PEAR module.

command line:

$ sudo pear install Net_UserAgent_Mobile-beta

Installation

To install the plugin for a symfony project, the usual process is to use the symfony command line:

$ php symfony plugin:install -r <version> sfMobileJPlugin

Clear the cache to enable the autoloading to find the new classes:

$ php symfony cc

via the $sf_app/config/settings.yml file.

// in myproject/apps/frontend/config/settings.yml
all:
    .settings:
        mobile_jp_net_ua_mobile_path          :   'Net/UserAgent/Mobile.php'        # is default (Install path of Net_UserAgent_Mobile)
        mobile_jp_is_required_uid             :   on                                # I need UID in the case of a mobile.
        mobile_jp_query_string_for_docomo_uid :   'guid=ON'                         # is default
        mobile_jp_ng_uid_url                  :   '$model/$action' or 'http://...'  # When I was not able to acquire UID, I do redirect here.
        mobile_jp_is_browser_cache            :   off                               # cache is obstructive existence.
        mobile_jp_is_ng_nonmobile             :   on                                # The access excluding the mobile phone is refused.
        mobile_jp_ng_nonmobile_url            :   '$model/$action' or 'http://...'  # When nonmobile user access, I do redirect here.
        mobile_jp_no_uid_ok_pages             :                                     # Register the page where the acquisition of UID is not required with here.
            - '$model/$action'                                              # It is necessary to register `mobile_jp_ng_nonmobile_url` with here at least.
            - '$model/$action'
            - '$model/$action'

via the $sf_app/config/filters.yml file.

// in myproject/apps/frontend/config/filters.yml
mobile:
    class: sfMobileJPFilter

via the $sf_app/config/factories.yml file.

// in myproject/apps/frontend/config/factories.yml
all:
    controller:
        class:  sfFrontWebMobileJPController

via the $sf_app/config/module.yml file.

// in myproject/apps/frontend/config/module.yml
all:
    view_class: sfPHP4MobileJP

setup for templates

$sf_app/modules/$sf_module/templates/mobile/        <- for share mobile template
$sf_app/modules/$sf_module/templates/docomo/        <- for DoCoMo template
$sf_app/modules/$sf_module/templates/softbank/      <- for SoftBank template
$sf_app/modules/$sf_module/templates/ezweb/         <- for EZweb template
$sf_app/modules/$sf_module/templates/               <- for nonmobile template

setup for view.yml

$sf_app/config/view_mobile.yml                      <- for share mobile
$sf_app/config/view_docomo.yml                      <- for DoCoMo
$sf_app/config/view_softbank.yml                    <- for SoftBank
$sf_app/config/view_ezweb.yml                       <- for EZweb
$sf_app/config/view.yml                             <- for nonmobile