1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Route only working locally

Discussion in 'XenForo Development Discussions' started by Jamie Corcoran, Jul 24, 2012.

  1. I'm trying to make a custom dynamic page on my forum using my own plugin but it only works locally.
    I exported the plugin to my website and installed it but now I get this error (when I put the site in debug mode):

    Code:
    The controller LIGLivestream_ControllerPublic_Livestream does not define an action called Index.
    This is the code that I'm using.

    PHP:
    <?php
    class LIGLivestream_Route_Prefix_LiveStreams implements XenForo_Route_Interface
    {
    public function 
    match($routePathZend_Controller_Request_Http $requestXenForo_Router $router)
    {
    $controllerName 'LIGLivestream_ControllerPublic_Livestream';
    $routeName 'LiveStreams/';
    return 
    $router->getRouteMatch($controllerName'index'$routeName$routePath);
    }
     
    }
    PHP:
    <?php
    class LIGLivestream_ControllerPublic_Livestream extends XenForo_ControllerPublic_Abstract
    {
    public function 
    actionIndex()
    {
    $visitor XenForo_Visitor::getInstance();
    $sessionModel $this->getModelFromCache('XenForo_Model_Session');
     
    $onlineUsers $sessionModel->getSessionActivityQuickList(
    $visitor->toArray(),
    array(
    'cutOff' => array('>'$sessionModel->getOnlineStatusTimeout())),
    (
    $visitor['user_id'] ? $visitor->toArray() : null)
    );
     
    $boardTotals $this->getModelFromCache('XenForo_Model_DataRegistry')->get('boardTotals');
    if (!
    $boardTotals)
    $boardTotals $this->getModelFromCache('XenForo_Model_Counters')->rebuildBoardTotalsCounter();
     
            
    $viewParams = array(
    'onlineUsers' => $onlineUsers,
    'boardTotals' => $boardTotals
    );
     
    return 
    $this->responseView('IGLivestream_ViewPublic_LiveStreams''EP_LiveStreams'$viewParams);
    }
    }

    Does anyone know what's wrong?
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    The only error I can see is a typo here. There's an L missing - it reads IGLivestream

    "return $this->responseView('IGLivestream_ViewPublic_LiveStreams', 'EP_LiveStreams', $viewParams);"

    Probably would expect a different error if it was that, though.
     
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Well obviously the actionIndex() function is defined in your controller. Make sure that file exists on your server and that it contains actionIndex. Maybe you are editing the wrong file or something.
     

Share This Page