Overview

Classes

  • Ws_logged_inModel
  • Ws_permissionsModel
  • Ws_role_permModel
  • Ws_rolesModel
  • Ws_user_roleModel
  • Ws_userModel
  • WsAuth
  • WsauthController
  • WsChart
  • WsConfig
  • WsController
  • WsDatabase
  • WsForm
  • WsImage
  • WsLocalize
  • WsModel
  • WsModelForm
  • WsModelGridView
  • WsUrl

Functions

  • __autoload
  • callHook
  • WsErrorHandler
  • Overview
  • Class

Class WsController

WsController Is controller part of Model-View-Controller. WsController manages a set of actions which deal with the corresponding user requests. Through the actions, WsController coordinates the data flow between models and views.

Example usage:

class SiteController extends WsController
{
    // this function handles request to 'http://server_name/site/index'
    public function index()
    {
        // use variable $m in view file
        $m = 'this is test';

        // view file 'index.php' is placed in directory
        // '/application/views/site'
        $this->render('index', array('m' => $m));
    }
}
Located at WsController.class.php
Methods summary
public
# __construct( )
public
# render( $action = 'index', array $params = array() )

Renders controller action in web brovser

Parameters

$action
Optional name of action.
$params

{ Optional list of key=>value parameters that are passed to action }

public string
# encodeCSVField( string $string )

Prepares string for usage in CSV output

Parameters

$string
Text that will be send to CSV file

Returns

string
CSV encoded sting
public string
# getRequestMethod( )

Get HTTP request method. It's used for implementation of RESTful API.

Returns

string
HTTP method
public
# sendResponse( mixed $data, integer $status = 200 )

Send HTTP response with status and JSON data. It's used for implementation of RESTful API.

Send HTTP response with status and JSON data. It's used for implementation of RESTful API.

Parameters

$data
JSON data to send
$status
HTTP status code
public
# redirect( string $controller, string $action = 'index', array $params = array() )

Redirect HTTP request

Redirect HTTP request

Parameters

$controller
Controller name
$action
Action name
$params
Optional parameters
public boolean
# isAjax( )

check if call is ajax request

Returns

boolean
isAjax
Properties summary
public string $layout

$layout Name of layout file located in '/public/layouts'

$layout Name of layout file located in '/public/layouts'

#
public string $title

$title Web page title

$title Web page title

#
public array $breadcrumbs

$breadcrumbs List of links that indicate position in Web app

$breadcrumbs List of links that indicate position in Web app

#
API documentation generated by ApiGen