Class AkActionController

(line 24)

Description

AkObject
   |
   --AkActionController

Located in File: /AkActionController.php



Classes extended from AkActionController:
AkWebRequest
Http Web Browser requests are handled by this class

Class Variables

Summary:
mixed $app_helpers
mixed $asset_host
mixed $cookies
mixed $flash
mixed $flash_now
mixed $helpers
mixed $module_name
mixed $params
mixed $Request
mixed $Response
mixed $session
mixed $web_service
mixed $_assigns
mixed $_headers
mixed $_Logger

$app_helpers (line 119)

Data type : mixed

$asset_host = AK_ASSET_HOST (line 53)

Data type : mixed

Prepends all the URL-generating helpers from AssetHelper.

This makes it possible to easily move javascripts, stylesheets, and images to a dedicated asset server away from the main web server. Example: $this->_asset_host = 'http://assets.example.com';

$cookies (line 115)

Data type : mixed

$default_send_file_options = array(
'type' => 'application/octet-stream',
'disposition' => 'attachment',
'stream' => true,
'buffer_size' => 4096
)
(line 2470)

Data type : mixed

$flash = array() (line 2076)

Data type : mixed

The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed

to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create action that sets <tt>flash['notice] = 'Successfully created'</tt> before redirecting to a display action that can then expose the flash to its template. Actually, that exposure is automatically done. Example:

class WeblogController extends ActionController { function create() { // save post $this->flash['notice] = 'Successfully created post'; $this->redirectTo(array('action'=>'display','params' => array('id' =>$Post->id))); }

function display() { // doesn't need to assign the flash notice to the template, that's done automatically } }

display.tpl <?php if($flash['notice']) : ?><div class='notice'><?php echo $flash['notice'] ?></div><?php endif; ?>

This example just places a string in the flash, but you can put any object in there. And of course, you can put as many as you like at a time too. Just remember: They'll be gone by the time the next action has been performed.

==flash_now

Sets a flash that will not be available to the next action, only to the current.

$this->flash_now['message] = 'Hello current action';

This method enables you to use the flash as a central messaging system in your app. When you need to pass an object to the next action, you use the standard flash assign (<tt>[]=</tt>). When you need to pass an object to the current action, you use <tt>now</tt>, and your object will vanish when the current action is done.

Entries set via <tt>flash_now</tt> are accessed the same way as standard entries: <tt>flash['my-key']</tt>.

$flash_now = array() (line 2077)

Data type : mixed

$flash_options = array() (line 2078)

Data type : mixed

$helpers = 'default' (line 117)

Data type : mixed

$module_name (line 128)

Data type : mixed

$params = array() (line 79)

Data type : mixed

Holds an array of all the GET, POST, and Url parameters passed to the action.

Accessed like <tt>$this->params['post_id'];</tt> to get the post_id.

$plugin_helpers = 'all' (line 120)

Data type : mixed

$Request (line 72)

Data type : mixed

Holds the Request object that's primarily used to get environment variables

$Response (line 88)

Data type : mixed

Holds the Response object that's primarily used to set additional HTTP _headers through access like <tt>$this->Response->_headers['Cache-Control'] = 'no-cache';</tt>.

Can also be used to access the final body HTML after a template has been rendered through $this->Response->body -- useful for <tt>after_filter</tt>s that wants to manipulate the output, such as a OutputCompressionFilter.

$session (line 95)

Data type : mixed

Holds an array of objects in the session. Accessed like <tt>$this->session['person']</tt> to get the object tied to the 'person' key. The session will hold any type of object as values, but the key should be a string.

$ssl_for_all_actions = true (line 33)

Data type : mixed

$TemplateClass (line 61)

Data type : mixed

Determines which template class should be used by AkActionController.

$validate_output = false (line 29)

Data type : mixed

$web_service (line 122)

Data type : mixed

$web_services = array() (line 123)

Data type : mixed

$web_service_api (line 125)

Data type : mixed

$web_service_apis = array() (line 126)

Data type : mixed

$_action_name (line 113)

Data type : mixed

Holds the name of the action this controller is processing.

$_afterFilters = array() (line 1683)

Data type : mixed

$_assigns = array() (line 108)

Data type : mixed

Holds the array of variables that are passed on to the template class to be made available to the view. This array is generated by taking a snapshot of all the instance variables in the current scope just before a template is rendered.

$_auto_instantiate_models = true (line 28)

Data type : mixed

$_beforeFilters = array() (line 1683)

Data type : mixed

$_enable_plugins = true (line 27)

Data type : mixed

$_excludedActions = array() (line 1683)

Data type : mixed

$_flash_handled = false (line 2079)

Data type : mixed

$_headers = array() (line 101)

Data type : mixed

Holds an array of header names and values. Accessed like <tt>$this->_headers['Cache-Control']</tt> to get the value of the Cache-Control directive. Values should always be specified as strings.

$_high_load_mode = AK_HIGH_LOAD_MODE (line 26)

Data type : mixed

$_ignore_missing_templates (line 67)

Data type : mixed

Turn on +_ignore_missing_templates+ if you want to unit test actions without making the associated templates.

$_includedActions = array() (line 1683)

Data type : mixed

Filters enable controllers to run shared pre and post processing code for its actions. These filters can be used to do authentication, caching, or auditing before the intended action is performed. Or to do localization or output compression after the action has been performed.

Filters have access to the request, response, and all the instance variables set by other filters in the chain or by the action (in the case of after filters). Additionally, it's possible for a pre-processing <tt>beforeFilter</tt> to halt the processing before the intended action is processed by returning false or performing a redirect or render. This is especially useful for filters like authentication where you're not interested in allowing the action to be performed if the proper credentials are not in order.

== Filter inheritance

Controller inheritance hierarchies share filters downwards, but subclasses can also add new filters without affecting the superclass. For example:

class BankController extends AkActionController { function __construct() { $this->beforeFilter('_audit'); }

function _audit(&$controller) { // record the action and parameters in an audit log } }

class VaultController extends BankController { function __construct() { $this->beforeFilter('_verifyCredentials'); }

function _verifyCredentials(&$controller) { // make sure the user is allowed into the vault } }

Now any actions performed on the BankController will have the audit method called before. On the VaultController, first the audit method is called, then the _verifyCredentials method. If the _audit method returns false, then _verifyCredentials and the intended action are never called.

== Filter types

A filter can take one of three forms: method reference, external class, or inline method. The first is the most common and works by referencing a method somewhere in the inheritance hierarchy of the controller by use of a method name. In the bank example above, both BankController and VaultController use this form.

Using an external class makes for more easily reused generic filters, such as output compression. External filter classes are implemented by having a static +filter+ method on any class and then passing this class to the filter method. Example:

class OutputCompressionFilter { function filter(&$controller) { $controller->response->body = compress($controller->response->body); } }

class NewspaperController extends AkActionController { function __construct() { $this->afterFilter(new OutputCompressionFilter()); } }

The filter method is passed the controller instance and is hence granted access to all aspects of the controller and can manipulate them as it sees fit.

== Filter chain ordering

Using <tt>beforeFilter</tt> and <tt>afterFilter</tt> appends the specified filters to the existing chain. That's usually just fine, but some times you care more about the order in which the filters are executed. When that's the case, you can use <tt>prependBeforeFilter</tt> and <tt>prependAfterFilter</tt>. Filters added by these methods will be put at the beginning of their respective chain and executed before the rest. For example:

class ShoppingController extends AkActionController { function __construct() { $this->beforeFilter('verifyOpenShop'); } }

class CheckoutController extends AkActionController { function __construct() { $this->prependBeforeFilter('ensureItemsInCart', 'ensureItemsInStock'); } }

The filter chain for the CheckoutController is now <tt>ensureItemsInCart, ensureItemsInStock,</tt> <tt>verifyOpenShop</tt>. So if either of the ensure filters return false, we'll never get around to see if the shop is open or not.

You may pass multiple filter arguments of each type.

== Around filters

In addition to the individual before and after filters, it's also possible to specify that a single object should handle both the before and after call. That's especially useful when you need to keep state active between the before and after, such as the example of a benchmark filter below:

class WeblogController extends AkActionController { function __construct() { $this->aroundFilter(new BenchmarkingFilter()); }

// Before this action is performed, BenchmarkingFilter->before($controller) is executed function index() { } // After this action has been performed, BenchmarkingFilter->after($controller) is executed }

class BenchmarkingFilter { function before(&$controller) { start_timer(); }

function after(&$controller) { stop_timer(); report_result(); } }

== Filter chain skipping

Some times its convenient to specify a filter chain in a superclass that'll hold true for the majority of the subclasses, but not necessarily all of them. The subclasses that behave in exception can then specify which filters they would like to be relieved of. Examples

class ApplicationController extends AkActionController { function __construct() { $this->beforeFilter('authenticate'); } }

class WeblogController extends ApplicationController { // will run the authenticate filter }

class SignupController extends AkActionController { function __construct() { $this->skipBeforeFilter('authenticate'); } // will not run the authenticate filter }

== Filter conditions

Filters can be limited to run for only specific actions. This can be expressed either by listing the actions to exclude or the actions to include when executing the filter. Available conditions are +only+ or +except+, both of which accept an arbitrary number of method references. For example:

class Journal extends AkActionController { function __construct() { // only require authentication if the current action is edit or delete $this->beforeFilter(array('_authorize'=>array('only'=>array('edit','delete'))); }

function _authorize(&$controller) { // redirect to login unless authenticated } }

$_Logger (line 56)

Data type : mixed

$_module_path (line 129)

Data type : mixed

$_pagination_actions = array() (line 2207)

Data type : mixed

$_pagination_default_options = array(
'class_name' => null,
'singular_name' => null,
'per_page' => 10,
'conditions' => null,
'order_by' => null,
'order' => null,
'join' => null,
'joins' => null,
'include' => null,
'select' => null,
'parameter' => 'page'
)
(line 2193)

Data type : mixed

$_pagination_options = array(
'class_name' => null,
'singular_name' => null,
'per_page' => 10,
'conditions' => null,
'order_by' => null,
'order' => null,
'join' => null,
'joins' => null,
'include' => null,
'select' => null,
'parameter' => 'page'
)
(line 2178)

Data type : mixed

The Pagination module aids in the process of paging large collections of

Active Record objects. It offers macro-style automatic fetching of your model for multiple views, or explicit fetching for single actions. And if the magic isn't flexible enough for your needs, you can create your own paginators with a minimal amount of code.

The Pagination module can handle as much or as little as you wish. In the controller, have it automatically query your model for pagination; or, if you prefer, create Paginator objects yourself

Pagination is included automatically for all controllers.

For help rendering pagination links, see Helpers/PaginationHelper.

==== Automatic pagination for every action in a controller

class PersonController extends ApplicationController { var $model = 'person'; var $paginate = array('people'=>array('order' => 'last_name, first_name', 'per_page' => 20)); }

Each action in this controller now has access to a <tt>$this->people</tt> instance variable, which is an ordered collection of model objects for the current page (at most 20, sorted by last name and first name), and a <tt>$this->person_pages</tt> Paginator instance. The current page is determined by the <tt>$params['page']</tt> variable.

==== Pagination for a single action

function show_all() { list($this->person_pages, $this->people) = $this->paginate('people', array('order' => 'last_name, first_name')); }

Like the previous example, but explicitly creates <tt>$this->person_pages</tt> and <tt>$this->people</tt> for a single action, and uses the default of 10 items per page.

==== Custom/"classic" pagination

function list() { $this->person_pages = new AkPaginator(&$this, $Person->count(), 10, $params['page']); $this->people = $this->Person->find('all', array( 'order'=> 'last_name, first_name', 'limit' => $this->person_pages->items_per_page, 'offset' => $this->person_pages->getOffset())); }

Explicitly creates the paginator from the previous example and uses AkPaginator::toSql to retrieve <tt>$this->people</tt> from the model.

$_protected_variables_cache = array() (line 44)

Data type : mixed

Protected instance variable cache

$_ssl_allowed_actions = array() (line 32)

Data type : mixed

$_ssl_requirement = false (line 31)

Data type : mixed

$_view_controller_internals = true (line 39)

Data type : mixed

Determines whether the view has access to controller internals $this->Request, $this->Response, $this->session, and $this->Template.

By default, it does.

Class Constants

Summary:

Method Detail

Summary:
void accountDomain ()
void accountHost ([ $account_subdomain = null])
void accountUrl ([ $account_subdomain = null], [ $use_ssl = null])
void addPluginHelper (string $helper_name, [array $options = array()])
void addToUrl ([ $options = array()], [ $options_to_exclude = array()])
void afterAction ([ $method = ''])
void afterFilter ()
void afterFilters ()
void api ([ $protocol = 'xml_rpc'])
void aroundFilter ()
void beforeAction ([ $method = ''])
void beforeFilter ()
void beforeFilters ()
void buildQueryString ( $array, [ $only_keys = null])
void defaultUrlOptions ( $options)
void excludedActions ()
void getActionName ()
void getActiveLayout ([ $passed_layout = null])
void getDefaultTemplateName ([ $default_action_name = null])
void getModuleHelper ()
void getModuleName ()
void handleRequest ()
void includedActions ()
void instantiateIncludedModelClasses ([ $models = array()])
void instantiateModelClass ( $model_class_name, [ $finder_options = array()])
void loadPlugins ()
void paginate ( $collection_id, [ $options = array()])
void performAction ([ $method = ''])
void performActionWithFilters ([ $method = ''])
void performActionWithoutFilters ( $action)
void process ( &$Request,  &$Response)
void redirectTo ([ $options = array()], [ $parameters_for_method_reference = null])
void redirectToAction ( $action, [ $options = array()])
void redirectToLocale ( $locale)
void render ([ $options = null], [ $status = 200])
void renderAction ( $_action_name, [ $status = null], [ $with_layout = true])
void renderFile ( $template_path, [ $status = null], [ $use_full_path = false], [ $locals = array()])
void renderNothing ([ $status = null])
void renderPartial ([ $partial_path = null], [ $object = null], [ $local_assigns = null], [ $status = null])
void renderPartialCollection ( $partial_name,  $collection, [ $partial_spacer_template = null], [ $local_assigns = null], [ $status = null])
void renderTemplate ( $template, [ $status = null], [ $type = 'tpl'], [ $local_assigns = array()])
void renderText ([ $text = null], [ $status = null])
void renderToString ([ $options = null])
void renderWithALayout ([ $options = null], [ $status = null], [ $layout = null])
void renderWithLayout ([ $template_name = null], [ $status = null], [ $layout = null])
void renderWithoutLayout ([ $template_name = null], [ $status = null])
void rewrite ([ $options = array()])
void rewriteOptions ( $options)
void sendData ( $data, [ $options = array()])
void sendDataAsStream ( $data,  $options)
void sendFile ( $path, [ $options = array()])
void setDefaultTemplateName ( $template_name)
void setLayout ( $template_name, [ $conditions = array()])
void setModel ( $model)
void setModels ( $models)
void setModuleName ( $module_name)
void setSslAllowedActions ( $actions)
void setSslRequiredActions ( $actions)
void skipAfterFilter ( $filters)
void skipBeforeFilter ( $filters)
void t ( $string, [ $array = null])
void toString ()
void urlFor ([ $options = array()], [ $parameters_for_method_reference = null])
void _actionIsExempted ( $filter, [ $method = ''])
void _addActionConditions ( $filters,  $conditions)
void _addLayoutConditions ( $conditions)
void _appendFilterToChain ( $condition,  $filters)
void _assertExistanceOfTemplateFile ( $template_name)
bool _authenticate ( $login_procedure)
void _authenticateOrRequestWithHttpBasic ([ $realm = AK_APP_NAME],  $login_procedure)
void _authenticateWithHttpBasic ( $login_procedure)
void _authenticationRequest ( $realm)
void _authorization ()
void _callFilters ( &$filters, [ $method = ''])
void _canApplyLayout ( $template_with_options,  $options)
void _closeSession ()
void _conditionArray ( $actions,  $filter_actions)
void _doubleRenderError ([ $message = null])
void _encodeCredentials ( $user_name,  $password)
void _ensureFilterRespondsToBeforeAndAfter ( &$filter_object)
void _extractConditions ( &$filters)
void _filterId ( $filters)
void _hasPerformed ()
void _hasTemplate ([ $template_name = null])
void _isCandidateForLayout ( $options)
void _isSslAllowed ()
void _isSslRequired ()
void _isTemplateExemptFromLayout ([ $template_name = null])
void _loadActionView ()
void _paginationCountCollection ( &$model,  $conditions,  $joins)
void _paginationFindCollection ( &$model,  $options,  &$paginator)
void _paginationLoadPaginatorAndCollection ( $collection_id,  $options)
void _paginationValidateOptions ( $collection_id, [ $options = array()],  $in_action)
void _pickLayout ( $template_with_options,  $options, [ $layout = null])
void _prependFilterToChain ( $condition,  $filters)
$controller_name _removeModuleNameFromControllerName ( $controller_name)
void _requestHttpBasicAuthentication ([ $realm = AK_APP_NAME])
void _rewriteAuthentication ( $options)
void _rewritePath ( $options)
void _rewriteUrl ( $path,  $options)
void _sendFileHeaders ( &$options)
void _skipFilter ( &$filters,  $type)
void _templateIsPublic ([ $template_name = null])
void __getControllerName_PHP4_fix ( $class_name)

Method accountDomain (line 2448)

void accountDomain( )

Info

Method accountHost (line 2439)

void accountHost( [ $account_subdomain = null])

Parameters

  • $account_subdomain:

Info

Method accountUrl (line 2432)

void accountUrl( [ $account_subdomain = null], [ $use_ssl = null])

Parameters

  • $account_subdomain:
  • $use_ssl:

Info

Method addPluginHelper (line 344)

void addPluginHelper( string $helper_name, [array $options = array()])

Used for adding helpers to the base class like those added by the plugins engine.

Parameters

  • string $helper_name: Helper class name like CalendarHelper
  • array $options: - path: Path to the helper class, defaults to AK_PLUGINS_DIR/helper_name/lib/helper_name.php

Info

Method addToUrl (line 1012)

void addToUrl( [ $options = array()], [ $options_to_exclude = array()])

Parameters

  • $options:
  • $options_to_exclude:

Info

Method afterAction (line 1985)

void afterAction( [ $method = ''])

Calls all the defined after-filter filters, which are added by using "afterFilter($method)".

If any of the filters return false, no more filters will be executed.

Parameters

  • $method:

Info

Method afterFilter (line 1755)

void afterFilter( )

Short-hand for appendAfterFilter since that's the most common of the two.

Info

Method afterFilters (line 1876)

void afterFilters( )

Returns all the after filters for this class and all its ancestors.

Info

Method api (line 2619)

void api( [ $protocol = 'xml_rpc'])

Parameters

  • $protocol:

Info

Method appendAfterFilter (line 1727)

void appendAfterFilter( )

The passed <tt>filters</tt> will be appended to the array of filters that's run _after_ actions on this controller are performed.

Info

Method appendAroundFilter (line 1773)

void appendAroundFilter( )

The passed <tt>filters</tt> will have their +before+ method appended to the array of filters that's run both before actions on this controller are performed and have their +after+ method prepended to the after actions. The filter objects must all respond to both +before+ and +after+. So if you do appendAroundFilter(new A(), new B()), the callstack will look like:

B::before() A::before() A::after() B::after()

Info

Method appendBeforeFilter (line 1688)

void appendBeforeFilter( )

The passed <tt>filters</tt> will be appended to the array of filters that's run _before_ actions on this controller are performed.

Info

Method aroundFilter (line 1812)

void aroundFilter( )

Short-hand for appendAroundFilter since that's the most common of the two.

Info

Method beforeAction (line 1975)

void beforeAction( [ $method = ''])

Calls all the defined before-filter filters, which are added by using "beforeFilter($method)".

If any of the filters return false, no more filters will be executed and the action is aborted.

Parameters

  • $method:

Info

Method beforeFilter (line 1715)

void beforeFilter( )

Short-hand for appendBeforeFilter since that's the most common of the two.

Info

Method beforeFilters (line 1868)

void beforeFilters( )

Returns all the before filters for this class.

Info

Method buildQueryString (line 1176)

void buildQueryString( $array, [ $only_keys = null])

Returns a query string with escaped keys and values from the passed array. If the passed array contains an 'id' it'll be added as a path element instead of a regular parameter pair.

Parameters

  • $array:
  • $only_keys:

Info

Method defaultAccountSubdomain (line 2425)

void defaultAccountSubdomain( )

Account location is a set of methods that supports the account-key-as-subdomain way of identifying the current scope. These methods allow you to easily produce URLs that match this style and to get the current account key from the subdomain.

The methods are: getAccountUrl, getAccountHost, and getAccountDomain.

Example:

include_once('AkAccountLocation.php');

class ApplicationController extends AkActionController { var $before_filter = '_findAccount';

function _findAccount() { $this->account = Account::find(array('conditions'=>array('username = ?', $this->account_domain))); }

class AccountController extends ApplicationController { function new_account() { $this->new_account = Account::create($this->params['new_account']); $this->redirectTo(array('host' => $this->accountHost($this->new_account->username), 'controller' => 'weblog')); }

function authenticate() { $this->session[$this->account_domain] = 'authenticated'; $this->redirectTo(array('controller => 'weblog')); }

function _isAuthenticated() { return !empty($this->session['account_domain']) ? $this->session['account_domain'] == 'authenticated' : false; } }

// The view: Your domain: {account_url?}

By default, all the methods will query for $this->account->username as the account key, but you can specialize that by overwriting defaultAccountSubdomain. You can of course also pass it in as the first argument to all the methods.

Info

Method defaultUrlOptions (line 920)

void defaultUrlOptions( $options)

Overwrite to implement a number of default options that all urlFor-based methods will use.

The default options should come in the form of a an array, just like the one you would use for $this->UrlFor directly. Example:

function defaultUrlOptions($options) { return array('project' => ($this->Project->isActive() ? $this->Project->url_name : 'unknown')); }

As you can infer from the example, this is mostly useful for situations where you want to centralize dynamic decisions about the urls as they stem from the business domain. Please note that any individual $this->UrlFor call can always override the defaults set by this method.

Parameters

  • $options:

Info

Method eraseRenderResults (line 709)

void eraseRenderResults( )

Clears the rendered results, allowing for another render to be performed.

Info

Method excludedActions (line 1892)

void excludedActions( )

Returns a mapping between filters and actions that may not run them.

Info

Method getAccountSubdomain (line 2458)

void getAccountSubdomain( )

Info

Method getActionName (line 1022)

void getActionName( )

Info

Method getActiveLayout (line 1388)

void getActiveLayout( [ $passed_layout = null])

Returns the name of the active layout. If the layout was specified as a method reference, this method is called and the return value is used. Likewise if( the layout was specified as an inline method (through a method object). If the layout was defined without a directory, layouts is assumed. So <tt>setLayout('weblog/standard')</tt> will return weblog/standard, but <tt>setLayout('standard')</tt> will return layouts/standard.

Parameters

  • $passed_layout:

Info

Method getApplicationHelpers (line 301)

void getApplicationHelpers( )

Info

Method getControllerName (line 834)

void getControllerName( )

Info

Method getCurrentControllerHelper (line 262)

void getCurrentControllerHelper( )

Info

Method getDefaultHelpers (line 286)

void getDefaultHelpers( )

Info

Method getDefaultTemplateName (line 1084)

void getDefaultTemplateName( [ $default_action_name = null])

Parameters

  • $default_action_name:

Info

Method getLayoutConditions (line 1370)

void getLayoutConditions( )

Info

Method getModuleHelper (line 274)

void getModuleHelper( )

Info

Method getModuleName (line 855)

void getModuleName( )

Info

Method getPluginHelpers (line 319)

void getPluginHelpers( )

Info

Method handleRequest (line 136)

void handleRequest( )

Old fashioned way of dispatching requests. Please use AkDispatcher or roll your own.

Info

  • deprecated -

Method includedActions (line 1884)

void includedActions( )

Returns a mapping between filters and the actions that may run them.

Info

Method instantiateHelpers (line 230)

void instantiateHelpers( )

Creates an instance of each available helper and links it into into current controller.

Per example, if a helper TextHelper is located into the file text_helper.php. An instance is created on current controller at $this->text_helper. This instance is also available on the view by calling $text_helper.

Helpers can be found at lib/AkActionView/helpers (this might change in a future)

Info

Method instantiateIncludedModelClasses (line 386)

void instantiateIncludedModelClasses( [ $models = array()])

Parameters

  • $models:

Info

Method instantiateModelClass (line 401)

void instantiateModelClass( $model_class_name, [ $finder_options = array()])

Parameters

  • $model_class_name:
  • $finder_options:

Info

Method loadPlugins (line 216)

void loadPlugins( )

Info

Method paginate (line 2258)

void paginate( $collection_id, [ $options = array()])

Returns a paginator and a collection of Active Record model instances for the paginator's current page. This is designed to be used in a single action.

+options+ are: <tt>singular_name</tt>:: the singular name to use, if it can't be inferred by singularizing the collection name <tt>class_name</tt>:: the class name to use, if it can't be inferred by camelizing the singular name <tt>per_page</tt>:: the maximum number of items to include in a single page. Defaults to 10 <tt>conditions</tt>:: optional conditions passed to Model::find('all', $this->params); and Model::count() <tt>order</tt>:: optional order parameter passed to Model::find('all', $this->params); <tt>order_by</tt>:: (deprecated, used :order) optional order parameter passed to Model::find('all', $this->params) <tt>joins</tt>:: optional joins parameter passed to Model::find('all', $this->params) and Model::count() <tt>join</tt>:: (deprecated, used :joins or :include) optional join parameter passed to Model::find('all', $this->params) and Model::count() <tt>include</tt>:: optional eager loading parameter passed to Model::find('all', $this->params) and Model::count()

Creates a +before_filter+ which automatically paginates an Active Record model for all actions in a controller (or certain actions if specified with the <tt>actions</tt> option).

+options+ are the same as PaginationHelper::paginate, with the addition of: <tt>actions</tt>:: an array of actions for which the pagination is active. Defaults to +null+ (i.e., every action)

Parameters

  • $collection_id:
  • $options:

Info

Method performAction (line 1965)

void performAction( [ $method = ''])

Parameters

  • $method:

Info

Method performActionWithFilters (line 1955)

void performActionWithFilters( [ $method = ''])

Parameters

  • $method:

Info

Method performActionWithoutFilters (line 1948)

void performActionWithoutFilters( $action)

Parameters

  • $action:

Info

Method prependAfterFilter (line 1742)

void prependAfterFilter( )

The passed <tt>filters</tt> will be prepended to the array of filters that's run _after_ actions on this controller are performed.

Info

Method prependAroundFilter (line 1796)

void prependAroundFilter( )

The passed <tt>filters</tt> will have their +before+ method prepended to the array of filters that's run both before actions on this controller are performed and have their +after+ method appended to the after actions. The filter objects must all respond to both +before+ and +after+. So if you do appendAroundFilter(new A(), new B()), the callstack will look like:

A::before() B::before() B::after() A::after()

Info

Method prependBeforeFilter (line 1702)

void prependBeforeFilter( )

The passed <tt>filters</tt> will be prepended to the array of filters that's run _before_ actions on this controller are performed.

Info

Method process (line 145)

void process( &$Request, &$Response)

Parameters

  • &$Request:
  • &$Response:

Info

Method redirectTo (line 781)

void redirectTo( [ $options = array()], [ $parameters_for_method_reference = null])

Redirects the browser to the target specified in +options+. This parameter can take one of three forms:

* <tt>Array</tt>: The URL will be generated by calling $this->UrlFor with the +options+. * <tt>String starting with protocol:// (like http://)</tt>: Is passed straight through as the target for redirection. * <tt>String not containing a protocol</tt>: The current protocol and host is prepended to the string. * <tt>back</tt>: Back to the page that issued the Request-> Useful for forms that are triggered from multiple places. Short-hand for redirectTo(Request->env["HTTP_REFERER"])

Examples: redirectTo(array('action' => 'show', 'id' => 5)); redirectTo('http://www.akelos.com'); redirectTo('/images/screenshot.jpg'); redirectTo('back');

The redirection happens as a "302 Moved" header.

Parameters

  • $options:
  • $parameters_for_method_reference:

Info

Method redirectToAction (line 810)

void redirectToAction( $action, [ $options = array()])

Parameters

  • $action:
  • $options:

Info

Method redirectToLocale (line 2605)

void redirectToLocale( $locale)

Parameters

  • $locale:

Info

Method render (line 569)

void render( [ $options = null], [ $status = 200])

Renders the content that will be returned to the browser as the Response body.

=== Rendering an action

Action rendering is the most common form and the type used automatically by Action Controller when nothing else is specified. By default, actions are rendered within the current layout (if one exists).

* Renders the template for the action "goal" within the current controller

$this->render(array('action'=>'goal'));

* Renders the template for the action "short_goal" within the current controller, but without the current active layout

$this->render(array('action'=>'short_goal','layout'=>false));

* Renders the template for the action "long_goal" within the current controller, but with a custom layout

$this->render(array('action'=>'long_goal','layout'=>'spectacular'));

=== Rendering partials

Partial rendering is most commonly used together with Ajax calls that only update one or a few elements on a page without reloading. Rendering of partials from the controller makes it possible to use the same partial template in both the full-page rendering (by calling it from within the template) and when sub-page updates happen (from the controller action responding to Ajax calls). By default, the current layout is not used.

* Renders the partial located at app/views/controller/_win.tpl

$this->render(array('partial'=>'win'));

* Renders the partial with a status code of 500 (internal error)

$this->render(array('partial'=>'broken','status'=>500));

* Renders the same partial but also makes a local variable available to it

$this->render(array('partial' => 'win', 'locals' => array('name'=>'david')));

* Renders a collection of the same partial by making each element of $wins available through the local variable "win" as it builds the complete Response

$this->render(array('partial'=>'win','collection'=>$wins));

* Renders the same collection of partials, but also renders the win_divider partial in between each win partial.

$this->render(array('partial'=>'win','collection'=>$wins,'spacer_template'=>'win_divider'));

=== Rendering a template

Template rendering works just like action rendering except that it takes a path relative to the template root. The current layout is automatically applied.

* Renders the template located in app/views/weblog/show.tpl $this->render(array('template'=>'weblog/show'));

=== Rendering a file

File rendering works just like action rendering except that it takes a filesystem path. By default, the path is assumed to be absolute, and the current layout is not applied.

* Renders the template located at the absolute filesystem path $this->render(array('file'=>'/path/to/some/template.tpl')); $this->render(array('file'=>'c:/path/to/some/template.tpl'));

* Renders a template within the current layout, and with a 404 status code $this->render(array('file' => '/path/to/some/template.tpl', 'layout' => true, 'status' => 404)); $this->render(array('file' => 'c:/path/to/some/template.tpl', 'layout' => true, 'status' => 404));

* Renders a template relative to the template root and chooses the proper file extension $this->render(array('file' => 'some/template', 'use_full_path' => true));

=== Rendering text

Rendering of text is usually used for tests or for rendering prepared content, such as a cache. By default, text rendering is not done within the active layout.

* Renders the clear text "hello world" with status code 200 $this->render(array('text' => 'hello world!'));

* Renders the clear text "Explosion!" with status code 500 $this->render(array('text' => "Explosion!", 'status' => 500 ));

* Renders the clear text "Hi there!" within the current active layout (if one exists) $this->render(array('text' => "Explosion!", 'layout' => true));

* Renders the clear text "Hi there!" within the layout * placed in "app/views/layouts/special.tpl" $this->render(array('text' => "Explosion!", 'layout => "special"));

=== Rendering an inline template

Rendering of an inline template works as a cross between text and action rendering where the source for the template is supplied inline, like text, but its evaled by PHP, like action. By default, PHP is used for rendering and the current layout is not used.

* Renders "hello, hello, hello, again" $this->render(array('inline' => "<?php echo str_repeat('hello, ', 3).'again'?>" ));

* Renders "hello david" $this->render(array('inline' => "<?php echo 'hello ' . $name ?>", 'locals' => array('name' => 'david')));

=== Rendering nothing

Rendering nothing is often convenient in combination with Ajax calls that perform their effect client-side or when you just want to communicate a status code. Due to a bug in Safari, nothing actually means a single space.

* Renders an empty Response with status code 200 $this->render(array('nothing' => true));

* Renders an empty Response with status code 401 (access denied) $this->render(array('nothing' => true, 'status' => 401));

Parameters

  • $options:
  • $status:

Info

Method renderAction (line 626)

void renderAction( $_action_name, [ $status = null], [ $with_layout = true])

Parameters

  • $_action_name:
  • $status:
  • $with_layout:

Info

Method renderFile (line 636)

void renderFile( $template_path, [ $status = null], [ $use_full_path = false], [ $locals = array()])

Parameters

  • $template_path:
  • $status:
  • $use_full_path:
  • $locals:

Info

Method renderNothing (line 664)

void renderNothing( [ $status = null])

Parameters

  • $status:

Info

Method renderPartial (line 669)

void renderPartial( [ $partial_path = null], [ $object = null], [ $local_assigns = null], [ $status = null])

Parameters

  • $partial_path:
  • $object:
  • $local_assigns:
  • $status:

Info

Method renderPartialCollection (line 680)

void renderPartialCollection( $partial_name, $collection, [ $partial_spacer_template = null], [ $local_assigns = null], [ $status = null])

Parameters

  • $partial_name:
  • $collection:
  • $partial_spacer_template:
  • $local_assigns:
  • $status:

Info

Method renderTemplate (line 649)

void renderTemplate( $template, [ $status = null], [ $type = 'tpl'], [ $local_assigns = array()])

Parameters

  • $template:
  • $status:
  • $type:
  • $local_assigns:

Info

Method renderText (line 656)

void renderText( [ $text = null], [ $status = null])

Parameters

  • $text:
  • $status:

Info

Method renderToString (line 617)

void renderToString( [ $options = null])

Renders according to the same rules as <tt>render</tt>, but returns the result in a string instead of sending it as the Response body to the browser.

Parameters

  • $options:

Info

Method renderWithALayout (line 1409)

void renderWithALayout( [ $options = null], [ $status = null], [ $layout = null])

Parameters

  • $options:
  • $status:
  • $layout:

Info

Method renderWithLayout (line 694)

void renderWithLayout( [ $template_name = null], [ $status = null], [ $layout = null])

Parameters

  • $template_name:
  • $status:
  • $layout:

Info

Method renderWithoutLayout (line 700)

void renderWithoutLayout( [ $template_name = null], [ $status = null])

Parameters

  • $template_name:
  • $status:

Info

Method rewrite (line 1096)

void rewrite( [ $options = array()])

Parameters

  • $options:

Info

Method rewriteOptions (line 819)

void rewriteOptions( $options)

This methods are required for retrieving available controllers for URL Routing

Parameters

  • $options:

Info

Method sendData (line 2565)

void sendData( $data, [ $options = array()])

Send binary data to the user as a file download. May set content type, apparent file name, and specify whether to show data inline or download as an attachment.

Options: * <tt>filename</tt> - Suggests a filename for the browser to use. * <tt>type</tt> - specifies an HTTP content type. Defaults to 'application/octet-stream'. * <tt>disposition</tt> - specifies whether the file will be shown inline or downloaded. Valid values are 'inline' and 'attachment' (default).

Generic data download: sendData($buffer)

Download a dynamically-generated tarball: sendData(Ak::compress('dir','tgz'), array('filename' => 'dir.tgz'));

Display an image Active Record in the browser: sendData($image_data, array('type' =>Ak::mime_content_type('image_name.png'), 'disposition' => 'inline'));

See +sendFile+ for more information on HTTP Content-* headers and caching.

Parameters

  • $data:
  • $options:

Info

Method sendDataAsStream (line 2577)

void sendDataAsStream( $data, $options)

Creates a file for streaming from a file.

This way you might free memory usage is file is too large

Parameters

  • $data:
  • $options:

Info

Method sendFile (line 2521)

void sendFile( $path, [ $options = array()])

Sends the file by streaming it 4096 bytes at a time. This way the whole file doesn't need to be read into memory at once. This makes it feasible to send even large files.

Be careful to sanitize the path parameter if it coming from a web page. sendFile($params['path']) allows a malicious user to download any file on your server.

Options: * <tt>filename</tt> - suggests a filename for the browser to use. Defaults to realpath($path). * <tt>type</tt> - specifies an HTTP content type. Defaults to 'application/octet-stream'. * <tt>disposition</tt> - specifies whether the file will be shown inline or downloaded. Valid values are 'inline' and 'attachment' (default). * <tt>stream</tt> - whether to send the file to the user agent as it is read (true) or to read the entire file before sending (false). Defaults to true. * <tt>buffer_size</tt> - specifies size (in bytes) of the buffer used to stream the file. Defaults to 4096.

The default Content-Type and Content-Disposition headers are set to download arbitrary binary files in as many browsers as possible. IE versions 4, 5, 5.5, and 6 are all known to have a variety of quirks (especially when downloading over SSL).

Simple download: sendFile('/path/to.zip');

Show a JPEG in browser: sendFile('/path/to.jpeg', array('type' => 'image/jpeg', 'disposition' => 'inline'));

Read about the other Content-* HTTP headers if you'd like to provide the user with more information (such as Content-Description). http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11

Also be aware that the document may be cached by proxies and browsers. The Pragma and Cache-Control headers declare how the file may be cached by intermediaries. They default to require clients to validate with the server before releasing cached responses. See http://www.mnot.net/cache_docs/ for an overview of web caching and http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 for the Cache-Control header spec.

Parameters

  • $path:
  • $options:

Info

Method setDefaultTemplateName (line 1089)

void setDefaultTemplateName( $template_name)

Parameters

  • $template_name:

Info

Method setLayout (line 1364)

void setLayout( $template_name, [ $conditions = array()])

If a layout is specified, all actions rendered through render and render_action will have their result assigned to <tt>$this->content_for_layout</tt>, which can then be used by the layout to insert their contents with <tt><?php echo $$this->content_for_layout ?></tt>. This layout can itself depend on instance variables assigned during action performance and have access to them as any normal template would.

Parameters

  • $template_name:
  • $conditions:

Info

Method setModel (line 376)

void setModel( $model)

Methods for loading desired models into this controller

Parameters

  • $model:

Info

Method setModels (line 381)

void setModels( $models)

Parameters

  • $models:

Info

Method setModuleName (line 860)

void setModuleName( $module_name)

Parameters

  • $module_name:

Info

Method setSslAllowedActions (line 2338)

void setSslAllowedActions( $actions)

Parameters

  • $actions:

Info

Method setSslRequiredActions (line 2331)

void setSslRequiredActions( $actions)

Specifies that the named actions requires an SSL connection to be performed (which is enforced by ensure_proper_protocol).

Parameters

  • $actions:

Info

Method skipAfterFilter (line 1834)

void skipAfterFilter( $filters)

Removes the specified filters from the +after+ filter chain. Note that this only works for skipping method-reference filters, not instances. This is especially useful for managing the chain in inheritance hierarchies where only one out of many sub-controllers need a different hierarchy.

Parameters

  • $filters:

Info

Method skipBeforeFilter (line 1823)

void skipBeforeFilter( $filters)

Removes the specified filters from the +before+ filter chain.

This is especially useful for managing the chain in inheritance hierarchies where only one out of many sub-controllers need a different hierarchy.

Parameters

  • $filters:

Info

Method t (line 750)

void t( $string, [ $array = null])

Use this to translate strings in the scope of your controller

Parameters

  • $string:
  • $array:

Info

  • see - Ak::t

Method toString (line 1102)

void toString( )

Overrides : AkObject::toString() Object-to-string conversion

Info

Method urlFor (line 1007)

void urlFor( [ $options = array()], [ $parameters_for_method_reference = null])

Returns a URL that has been rewritten according to the options array and the defined Routes.

(For doing a complete redirect, use redirectTo).

<tt>$this->UrlFor</tt> is used to:

All keys given to $this->UrlFor are forwarded to the Route module, save for the following: * <tt>anchor</tt> -- specifies the anchor name to be appended to the path. For example, <tt>$this->UrlFor(array('controller' => 'posts', 'action' => 'show', 'id' => 10, 'anchor' => 'comments'</tt> will produce "/posts/show/10#comments". * <tt>only_path</tt> -- if true, returns the absolute URL (omitting the protocol, host name, and port) * <tt>trailing_slash</tt> -- if true, adds a trailing slash, as in "/archive/2005/". Note that this is currently not recommended since it breaks caching. * <tt>host</tt> -- overrides the default (current) host if provided * <tt>protocol</tt> -- overrides the default (current) protocol if provided

The URL is generated from the remaining keys in the array. A URL contains two key parts: the <base> and a query string. Routes composes a query string as the key/value pairs not included in the <base>.

The default Routes setup supports a typical Akelos Framework path of "controller/action/id" where action and id are optional, with action defaulting to 'index' when not given. Here are some typical $this->UrlFor statements and their corresponding URLs:

$this->UrlFor(array('controller'=>'posts','action'=>'recent')); // 'proto://host.com/posts/recent' $this->UrlFor(array('controller'=>'posts','action'=>'index')); // 'proto://host.com/posts' $this->UrlFor(array('controller'=>'posts','action'=>'show','id'=>10)); // 'proto://host.com/posts/show/10'

When generating a new URL, missing values may be filled in from the current Request's parameters. For example, <tt>$this->UrlFor(array('action'=>'some_action'));</tt> will retain the current controller, as expected. This behavior extends to other parameters, including <tt>controller</tt>, <tt>id</tt>, and any other parameters that are placed into a Route's path.

The URL helpers such as <tt>$this->UrlFor</tt> have a limited form of memory: when generating a new URL, they can look for missing values in the current Request's parameters. Routes attempts to guess when a value should and should not be taken from the defaults. There are a few simple rules on how this is performed:

* If the controller name begins with a slash, no defaults are used: <tt>$this->UrlFor(array('controller'=>'/home'));</tt> * If the controller changes, the action will default to index unless provided

The final rule is applied while the URL is being generated and is best illustrated by an example. Let us consider the route given by <tt>map->connect('people/:last/:first/:action', array('action' => 'bio', 'controller' => 'people'))</tt>.

Suppose that the current URL is "people/hh/david/contacts". Let's consider a few different cases of URLs which are generated from this page.

* <tt>$this->UrlFor(array('action'=>'bio'));</tt> -- During the generation of this URL, default values will be used for the first and last components, and the action shall change. The generated URL will be, "people/hh/david/bio". * <tt>$this->UrlFor(array('first'=>'davids-little-brother'));</tt> This generates the URL 'people/hh/davids-little-brother' -- note that this URL leaves out the assumed action of 'bio'.

However, you might ask why the action from the current Request, 'contacts', isn't carried over into the new URL. The answer has to do with the order in which the parameters appear in the generated path. In a nutshell, since the value that appears in the slot for <tt>first</tt> is not equal to default value for <tt>first</tt> we stop using defaults. On it's own, this rule can account for much of the typical Akelos Framework URL behavior.

Although a convienence, defaults can occasionaly get in your way. In some cases a default persists longer than desired. The default may be cleared by adding <tt>'name' => null</tt> to <tt>$this->UrlFor</tt>'s options. This is often required when writing form helpers, since the defaults in play may vary greatly depending upon where the helper is used from. The following line will redirect to PostController's default action, regardless of the page it is displayed on:

$this->UrlFor(array('controller' => 'posts', 'action' => null));

If you explicitly want to create a URL that's almost the same as the current URL, you can do so using the overwrite_params options. Say for your posts you have different views for showing and printing them. Then, in the show view, you get the URL for the print view like this

$this->UrlFor(array('overwrite_params' => array('action' => 'print')));

This takes the current URL as is and only exchanges the action. In contrast, <tt>$this->UrlFor(array('action'=>'print'));</tt> would have slashed-off the path components after the changed action.

Parameters

  • $options:
  • $parameters_for_method_reference:

Info

Method _actionIsExempted (line 2018)

void _actionIsExempted( $filter, [ $method = ''])

Parameters

  • $filter:
  • $method:

Info

Method _addActionConditions (line 1925)

void _addActionConditions( $filters, $conditions)

Parameters

  • $filters:
  • $conditions:

Info

Method _addInstanceVariablesToAssigns (line 724)

void _addInstanceVariablesToAssigns( )

Info

Method _addLayoutConditions (line 1375)

void _addLayoutConditions( $conditions)

Parameters

  • $conditions:

Info

Method _addVariablesToAssigns (line 716)

void _addVariablesToAssigns( )

Info

Method _appendFilterToChain (line 1898)

void _appendFilterToChain( $condition, $filters)

Parameters

  • $condition:
  • $filters:

Info

Method _assertExistanceOfTemplateFile (line 1071)

void _assertExistanceOfTemplateFile( $template_name)

Parameters

  • $template_name:

Info

Method _authenticate (line 2744)

bool _authenticate( $login_procedure)

This is method takes a $login_procedure for performing access authentication.

If an array is given, it will check the key for a user and the value will be verified to match given password.

You can pass and array like array('handler' => $Account, 'method' => 'verifyCredentials'), which will call

$Account->verifyCredentials($user_name, $password, $Controller)

You can also pass an object which implements an "authenticate" method. when calling

$this->_authenticate(new User());

It will call the $User->authenticate($user_name, $password, $Controller)

In both cases the authentication method should return true for valid credentials or false is invalid.

Parameters

  • $login_procedure:

Info

Method _authenticateOrRequestWithHttpBasic (line 2707)

void _authenticateOrRequestWithHttpBasic( [ $realm = AK_APP_NAME], $login_procedure)

Simple Basic example:

class PostsController extends ApplicationController { var $_authorized_users = array('bermi' => 'secret');

function __construct(){ $this->beforeFilter(array('authenticate' => array('except' => array('index')))); }

function index() { $this->renderText("Everyone can see me!"); }

function edit(){ $this->renderText("I'm only accessible if you know the password"); }

function authenticate(){ return $this->_authenticateOrRequestWithHttpBasic('App name', $this->_authorized_users); } }

Here is a more advanced Basic example where only Atom feeds and the XML API is protected by HTTP authentication, the regular HTML interface is protected by a session approach:

class ApplicationController extends AkActionController { var $models = 'account';

function __construct() { $this->beforeFilter(array('_setAccount', 'authenticate')); }

function _setAccount() { $this->Account = $this->account->findFirstBy('url_name', array_pop($this->Request->getSubdomains())); }

function authenticate() { if($this->Request->isFormat('XML', 'ATOM')){ if($User = $this->_authenticateWithHttpBasic($Account)){ $this->CurrentUser = $User; }else{ $this->_requestHttpBasicAuthentication(); } }else{ if($this->isSessionAuthenticated()){ $this->CurrentUser = $Account->user->find($_SESSION['authenticated']['user_id']); }else{ $this->redirectTo(array('controller'=>'login')); return false; } } } }

On shared hosts, Apache sometimes doesn't pass authentication headers to FCGI instances. If your environment matches this description and you cannot authenticate, try this rule in public/.htaccess (replace the plain one):

RewriteRule ^(.*)$ index.php [E=X-HTTP_AUTHORIZATION:%{HTTP:Authorization},QSA,L]

Parameters

  • $realm:
  • $login_procedure:

Info

Method _authenticateWithHttpBasic (line 2715)

void _authenticateWithHttpBasic( $login_procedure)

Parameters

  • $login_procedure:

Info

Method _authenticationRequest (line 2799)

void _authenticationRequest( $realm)

Parameters

  • $realm:

Info

Method _authorization (line 2769)

void _authorization( )

Info

Method _callFilters (line 1992)

void _callFilters( &$filters, [ $method = ''])

Parameters

  • &$filters:
  • $method:

Info

Method _canApplyLayout (line 1432)

void _canApplyLayout( $template_with_options, $options)

Parameters

  • $template_with_options:
  • $options:

Info

Method _closeSession (line 1048)

void _closeSession( )

Info

Method _conditionArray (line 1935)

void _conditionArray( $actions, $filter_actions)

Parameters

  • $actions:
  • $filter_actions:

Info

Method _decodeCredentials (line 2784)

void _decodeCredentials( )

Info

Method _doesActionHasLayout (line 1471)

void _doesActionHasLayout( )

Info

Method _doubleRenderError (line 1028)

void _doubleRenderError( [ $message = null])

Parameters

  • $message:

Info

Method _encodeCredentials (line 2794)

void _encodeCredentials( $user_name, $password)

Parameters

  • $user_name:
  • $password:

Info

Method _ensureActionExists (line 2812)

void _ensureActionExists( )

Info

Method _ensureFilterRespondsToBeforeAndAfter (line 1908)

void _ensureFilterRespondsToBeforeAndAfter( &$filter_object)

Parameters

  • &$filter_object:

Info

Method _ensureProperProtocol (line 2361)

void _ensureProperProtocol( )

Info

Method _extractConditions (line 1915)

void _extractConditions( &$filters)

Parameters

  • &$filters:

Info

Method _filterId (line 1943)

void _filterId( $filters)

Parameters

  • $filters:

Info

Method _getCompleteRequestUri (line 1043)

void _getCompleteRequestUri( )

Info

Method _getIncludedControllerNames (line 885)

void _getIncludedControllerNames( )

Info

Method _getProtectedInstanceVariables (line 735)

void _getProtectedInstanceVariables( )

Info

Method _getRequestOrigin (line 1038)

void _getRequestOrigin( )

Info

Method _getTemplateBasePath (line 880)

void _getTemplateBasePath( )

Info

Method _getUserNameAndPassword (line 2763)

void _getUserNameAndPassword( )

Info

Method _handleFlashAttribute (line 2081)

void _handleFlashAttribute( )

Info

Method _handleFlashOptions (line 2097)

void _handleFlashOptions( )

Info

Method _hasPerformed (line 1033)

void _hasPerformed( )

Info

Method _hasTemplate (line 1054)

void _hasTemplate( [ $template_name = null])

Parameters

  • $template_name:

Info

Method _isCandidateForLayout (line 1437)

void _isCandidateForLayout( $options)

Parameters

  • $options:

Info

Method _isSslAllowed (line 2354)

void _isSslAllowed( )

Info

Method _isSslRequired (line 2348)

void _isSslRequired( )

Returns true if the current action is supposed to run as SSL

Info

Method _isTemplateExemptFromLayout (line 1065)

void _isTemplateExemptFromLayout( [ $template_name = null])

Parameters

  • $template_name:

Info

Method _loadActionView (line 197)

void _loadActionView( )

Info

Method _mergeFlashOnFlashNow (line 2111)

void _mergeFlashOnFlashNow( )

Info

Method _paginationCountCollection (line 2285)

void _paginationCountCollection( &$model, $conditions, $joins)

Returns the total number of items in the collection to be paginated for the +model+ and given +conditions+. Override this method to implement a custom counter.

Parameters

  • &$model:
  • $conditions:
  • $joins:

Info

Method _paginationCreateAndRetrieveCollections (line 2266)

void _paginationCreateAndRetrieveCollections( )

Info

Method _paginationFindCollection (line 2295)

void _paginationFindCollection( &$model, $options, &$paginator)

Returns a collection of items for the given +$model+ and +$options['conditions']+, ordered by +$options['order']+, for the current page in the given +$paginator+.

Override this method to implement a custom finder.

Parameters

  • &$model:
  • $options:
  • &$paginator:

Info

Method _paginationLoadPaginatorAndCollection (line 2310)

void _paginationLoadPaginatorAndCollection( $collection_id, $options)

Parameters

  • $collection_id:
  • $options:

Info

  • todo - Fix this function

Method _paginationValidateOptions (line 2209)

void _paginationValidateOptions( $collection_id, [ $options = array()], $in_action)

Parameters

  • $collection_id:
  • $options:
  • $in_action:

Info

Method _pickLayout (line 1444)

void _pickLayout( $template_with_options, $options, [ $layout = null])

Parameters

  • $template_with_options:
  • $options:
  • $layout:

Info

Method _prependFilterToChain (line 1903)

void _prependFilterToChain( $condition, $filters)

Parameters

  • $condition:
  • $filters:

Info

Method _removeModuleNameFromControllerName (line 870)

$controller_name _removeModuleNameFromControllerName( $controller_name)

Removes the modules name from the controller if exists and sets it.

Parameters

  • $controller_name:

Info

Method _requestHttpBasicAuthentication (line 2720)

void _requestHttpBasicAuthentication( [ $realm = AK_APP_NAME])

Parameters

  • $realm:

Info

Method _rewriteAuthentication (line 1141)

void _rewriteAuthentication( $options)

Parameters

  • $options:

Info

Method _rewritePath (line 1150)

void _rewritePath( $options)

Parameters

  • $options:

Info

Method _rewriteUrl (line 1112)

void _rewriteUrl( $path, $options)

Given a path and options, returns a rewritten URL string

Parameters

  • $path:
  • $options:

Info

Method _sendFileHeaders (line 2587)

void _sendFileHeaders( &$options)

Parameters

  • &$options:

Info

Method _skipFilter (line 1840)

void _skipFilter( &$filters, $type)

Parameters

  • &$filters:
  • $type:

Info

Method _templateIsPublic (line 1059)

void _templateIsPublic( [ $template_name = null])

Parameters

  • $template_name:

Info

Method _validateGeneratedXhtml (line 358)

void _validateGeneratedXhtml( )

Info

Method __getControllerName_PHP4_fix (line 847)

void __getControllerName_PHP4_fix( $class_name)

Parameters

  • $class_name:

Info

Inherited Variables

Inherited Class Variable Summary

Inherited Methods

Inherited Method Summary

Inherited From Class AkObject

AkObject::AkObject() - A hack to support __construct() on PHP 4

AkObject::__construct() - Class constructor, overriden in descendant classes

AkObject::freeMemory() - Unsets circular reference children that are not freed from memory when calling unset() or when the parent object is garbage collected.

AkObject::log() -

AkObject::toString() - Object-to-string conversion

AkObject::__clone() - Clone class (Zend Engine 2 compatibility trick)

AkObject::__destruct() - Class destructor, overriden in descendant classes

AkObject::__toString() -



Documentation generated on Tue, 17 Jun 2008 14:23:08 +0200 by phpDocumentor 1.3.2