[pLog-svn] r6562 - plog/branches/lifetype-1.2/class/view
mark at devel.lifetype.net
mark at devel.lifetype.net
Wed Jun 18 01:02:59 EDT 2008
Author: mark
Date: 2008-06-18 01:02:59 -0400 (Wed, 18 Jun 2008)
New Revision: 6562
Modified:
plog/branches/lifetype-1.2/class/view/view.class.php
Log:
We can not use $this->_request here, because getCurrentPageFromRequest is a static method and used in many actions.
So, I just implement $request as static variable inside getCurrentPageFromRequest.
Modified: plog/branches/lifetype-1.2/class/view/view.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/view/view.class.php 2008-06-18 04:15:46 UTC (rev 6561)
+++ plog/branches/lifetype-1.2/class/view/view.class.php 2008-06-18 05:02:59 UTC (rev 6562)
@@ -294,16 +294,21 @@
*/
function getCurrentPageFromRequest()
{
- lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php");
- // get the value from the request
- $page = HttpVars::getRequestValue( VIEW_DEFAULT_PAGE_PARAMETER );
+ static $request;
+ if( $request == null )
+ $request = new Request( HttpVars::getRequest() );
+
+ // get the page value from the request
+ $page = $request->getValue( VIEW_DEFAULT_PAGE_PARAMETER );
+
// but first of all, validate it
+ lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php");
$val = new IntegerValidator();
if( !$val->validate( $page ))
- $page = VIEW_DEFAULT_START_PAGE;
+ $page = VIEW_DEFAULT_START_PAGE;
return $page;
- }
+ }
/**
* Renders the view. Here we would ideally call a template engine, using the
More information about the pLog-svn
mailing list