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

Can't Create Code Event Listener

Discussion in 'XenForo Development Discussions' started by Jaxel, Oct 6, 2010.

  1. Jaxel

    Jaxel Well-Known Member

    I created an addon with the id "8wrXenPorta".

    Then I created a file in library/8wrXenPorta/listeners.php
    class 8wrXenPorta_Listeners
    	public static function navtabs(array &$extraTabs, $selectedTabId)
    		$extraTabs['8wrXenPorta'] = array(
    			'title' => 'XenPorta',
    			'href' => 'XenPorta',
    			'selected' => ($selectedTabId == '8wrXenPorta'),
    			'linksTemplate' => '',
    Then I tried to create a Code Event Listener with 8wrXenPorta_Listeners::navtabs
    Unfortunately it keeps kicking back an error...

    Please enter a valid callback method.
  2. Mike

    Mike XenForo Developer Staff Member

    Autoloading is case sensitive. Your file is listeners.php, your class is Listeners.
  3. Jaxel

    Jaxel Well-Known Member

    Yep... that was the issue... there was then a second issue...

    8wrXenPorta_Listeners is not a valid classname. It seems a classname can not start with a NUMBER.
  4. g0rn

    g0rn Well-Known Member

Share This Page