ZF2:致命错误:在linux平台的对象上下文中使用$ this

时间:2015-08-26 14:46:42

标签: php linux oop model-view-controller zend-framework2

我正在尝试调用函数但是我收到此错误:

  

致命错误:在/home/content/34/8007634/html/independent-platform/module/Application/Module.php中不在对象上下文中时使用$ this

错误行

            $without_login_allowed_action = $this->getWithoutLoginAllowedActionList();

代码

namespace Application;

use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
use Zend\Mvc\Router\RouteMatch;



use Zend\Authentication\AuthenticationService;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface,
Zend\ModuleManager\Feature\ConfigProviderInterface,
Zend\ModuleManager\Feature\ViewHelperProviderInterface; 


 use Zend\Db\ResultSet\ResultSet;
use Zend\Db\TableGateway\TableGateway;

use Application\Model\Album;
use Application\Model\AlbumTable;

 use Application\Model\User;
 use Application\Model\UserTable;

 use Application\Model\Program;
 use Application\Model\ProgramTable;
 use Zend\Db\Adapter\Adapter;

 use Zend\Session\SessionManager;
 use Zend\Session\Container;

 class Module implements AutoloaderProviderInterface,     ConfigProviderInterface, ViewHelperProviderInterface
 {






 //...handle the exception... maybe log it and redirect to another page,
 //or send an email that an exception occurred...

 public function handleError(MvcEvent $e)
 {
    //get the exception
    $exception = $e->getParam('exception');

    $response = $e->getResponse();
    $response->setStatusCode(404);
    $response->sendHeaders();
 }

public function onBootstrap(MvcEvent $e)
{
    ini_set('memory_limit', '-1');

    $app = $e->getApplication();


        $without_login_allowed_action = $this->getWithoutLoginAllowedActionList();
        // Route is whitelisted





    $this->bootstrapSession($e);

}


public function getWithoutLoginAllowedActionList(){
    $without_login_allowed_action = array(
                    'index',
                    'login',
                    'register',
                    'program',
                    'thanks',
                    'logout',
                    'forgotpass',
                    'resetpassword',
                    'checkMonthlySubscription',
                    'consultantform',
                    'checkForTestingStarted',
                    'emailcron',
                    'flushemailqueue',
                    'rtuactivity',
                    'blogslider',
                    'contact',
                    'latestnews',
                    'privacypolicy',
                    'news',
                    'generatemathcaptcha',
                    'getprofileimagewithoutlogin',
                    'getprogramimagebyprofilewithoutlogin',
                    'wlcinquiry',
                    'normalchaineduserregister',            
    );
    return $without_login_allowed_action;
}
  } 

0 个答案:

没有答案