Pluf_Views Class Reference

List of all members.

Public Member Functions

 redirectTo ($request, $match, $url)
 login ($request, $match, $success_url='/', $extra_context=array(), $template='login_form.html')
 logout ($request, $match, $success_url='/')
 createObject ($request, $match, $p)
 updateObject ($request, $match, $p)
 deleteObject ($request, $match, $p)


Detailed Description

Some basic views that can be reused by other views.

Most of them are not supposed to be called directly via the dispatcher as they take extra parameters for basic customization.


Member Function Documentation

Pluf_Views::redirectTo ( request,
match,
url 
)

Simple redirection view.

Parameters:
Request Request object
array Match
string Redirection URL (not a view)

Pluf_Views::login ( request,
match,
success_url = '/',
extra_context = array(),
template = 'login_form.html' 
)

Log the user in.

The login form is provided by the login_form.html template. The '_redirect_after' hidden value is used to redirect the user after successfull login. If the view is called with _redirect_after set in the query as a GET variable it will be available as $_redirect_after in the template.

Parameters:
Request Request object
array Match
string Default redirect URL after login ('/')
array Extra context values (array()).
string Login form template ('login_form.html')
Returns:
Response object

Pluf_Views::logout ( request,
match,
success_url = '/' 
)

Logout the user.

The success url is either an absolute url starting with http(s):// or considered as an action.

Parameters:
Request Request object
array Match
string Default redirect URL after login '/'
Returns:
Response object

Pluf_Views::createObject ( request,
match,
p 
)

Create an object (Part of the CRUD series).

The minimal extra parameter is the model class name. The list of extra parameters is:

'model' - Class name string, required.

'extra_context' - Array of key/values to be added to the context (array())

'extra_form' - Array of key/values to be added to the form generation (array())

'login_required' - Do we require login (false)

'template' - Template to use ('"model class"_create_form.html')

'post_save_redirect' - View to redirect after saving (use getAbsoluteUrl() method of the mode)

'post_save_redirect_keys' - Which keys of the model to pass to the view (array('id'))

Parameters:
Pluf_HTTP_Request Request object
array Match
array Extra parameters
Returns:
Pluf_HTTP_Response Response object (can be a redirect)

Pluf_Views::updateObject ( request,
match,
p 
)

Update an object (Part of the CRUD series).

The minimal extra parameter is the model class name. The list of extra parameters is:

'model' - Class name string, required.

'model_id' - Id of of the current model to update

'extra_context' - Array of key/values to be added to the context (array())

'extra_form' - Array of key/values to be added to the form generation (array())

'login_required' - Do we require login (false)

'template' - Template to use ('"model class"_update_form.html')

'post_save_redirect' - View to redirect after saving (use getAbsoluteUrl() method of the mode)

'post_save_redirect_keys' - Which keys of the model to pass to the view (array('id'))

Parameters:
Pluf_HTTP_Request Request object
array Match
array Extra parameters
Returns:
Pluf_HTTP_Response Response object (can be a redirect)

Pluf_Views::deleteObject ( request,
match,
p 
)

Delete an object (Part of the CRUD series).

The minimal extra parameter is the model class name. The list of extra parameters is:

'model' - Class name string, required.

'post_delete_redirect' - View to redirect after saving, required.

'id' - Index in the match to fin the id of the object to delete (1)

'login_required' - Do we require login (false)

'template' - Template to use ('"model class"_confirm_delete.html')

'post_delete_redirect_keys' - Which keys of the model to pass to the view (array())

'extra_context' - Array of key/values to be added to the context (array())

Parameters:
Pluf_HTTP_Request Request object
array Match
array Extra parameters
Returns:
Pluf_HTTP_Response Response object (can be a redirect)


The documentation for this class was generated from the following file:

Generated on Wed Feb 3 15:44:52 2010 for Pluf by  doxygen