LSYii_Application

Extends \CWebApplication

Implements global config

package

Default

Methods

Initiates the application

__construct(array $aApplicationConfig = null) 
access

public

Arguments

$aApplicationConfig

array

The pre-filter for controller actions.

beforeControllerAction(\CController $controller, \CAction $action) : boolean

This method is invoked before the currently requested controller action and all its filters are executed. You may override this method with logic that needs to be done before all controller actions.

Arguments

$controller

\CController

the controller

$action

\CAction

the action

Response

boolean

whether the action should be executed.

Get the Api object.

getApi() 

Returns a config variable from the config

getConfig(string $name, boolean|mixed $default = false) : string
access

public

Arguments

$name

string

$default

boolean|mixed

Value to return when not found, default is false

Response

string

Return plugin, if any

getPlugin() : object

Response

object

Get the pluginManager

getPluginManager() : \PluginManager

Response

\PluginManager

init

init() 

initLanguage

initLanguage() 

Loads a config from a file

loadConfig(string $file) : void
access

public

Arguments

$file

string

Loads a helper

loadHelper(string $helper) : void
access

public

Arguments

$helper

string

Loads a library

loadLibrary(string $library) : void
access

public

Arguments

$library

string

Libraby name

onException

onException(\CExceptionEvent $event) : void
see http://www.yiiframework.com/doc/api/1.1/CApplication#onException-detail

Set surveys/error for 404 error

Arguments

$event

\CExceptionEvent

Sets a configuration variable into the config

setConfig(string $name, mixed $value) : void
access

public

Arguments

$name

string

$value

mixed

Set a 'flash message'.

setFlashMessage(string $message, string $type = 'success') : \LSYii_Application

A flahs message will be shown on the next request and can contain a message to tell that the action was successful or not. The message is displayed and cleared when it is shown in the view using the widget: $this->widget('application.extensions.FlashMessage.FlashMessage');

Arguments

$message

string

The message you want to show on next page load

$type

string

Type can be 'success','info','warning','danger','error' which relate to the particular bootstrap alert classes - see http://getbootstrap.com/components/#alerts . Note: Option 'error' is synonymous to 'danger'

Response

\LSYii_Application

Provides a fluent interface

For future use, cache the language app wise as well.

setLanguage(string $sLanguage) : void
access

public

Arguments

$sLanguage

string

Used by PluginHelper to make the controlling plugin available from everywhere, e.g. from the plugin's models.

setPlugin( $plugin) : void

Corresponds to Yii::app()->getController()

Arguments

$plugin

Properties

config

config : 

Type(s)

api

api : \LimesurveyApi
var

Type(s)

\LimesurveyApi

If a plugin action is accessed through the PluginHelper, store it here.

plugin : \iPlugin
var

Type(s)

\iPlugin

log

log : \CLogRouter

Log router component.

Type(s)

\CLogRouter

language

language : string

Returns the language that the user is using and the application should be targeted to.

Type(s)

string

clientScript

clientScript : \CClientScript

CClientScript manages JavaScript and CSS stylesheets for views.

Type(s)

\CClientScript

request

request : \CHttpRequest

The request component.

Type(s)

\CHttpRequest

db

db : \CDbConnection

The database connection.

Type(s)

\CDbConnection

baseUrl

baseUrl : string

The relative URL for the application.

Type(s)

string

user

user : \CWebUser

The user session information.

Type(s)

\CWebUser

twigRenderer

twigRenderer : \LSETwigViewRenderer

Twig rendering plugin

Type(s)

\LSETwigViewRenderer

pluginManager

pluginManager : \PluginManager

The LimeSurvey Plugin manager

Type(s)

\PluginManager

bootstrap

bootstrap : \TbApi

The bootstrap renderer

Type(s)

\TbApi

session

session : \CHttpSession

The HTTP session

Type(s)

\CHttpSession