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

route

F

Floris

Guest
#2
under your library/Jake/Route/Route.php
have something like this:

Code:
<?php

/**
 * meow
 **/

// Jake == dir Jake/ Route == dir Route and Route at the end is Route.php
class Jake_Route_Route implements XenForo_Route_Interface
{
	public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
	{
		// route for /jake/
		return $router->getRouteMatch('Jake_ControllerPublic_Jake', 'index', 'jake', $routePath);
	} // public
} // class
# EOF
and in the admin > dev > route prefix, add the class name Jake_Route_Route to route class, and set prefix to jake

the custom page is like library/Jake/ControllerPublic_Jake/Jake.php

Code:
<?php

class XenFans_ExtraPage_ControllerPublic_About extends XenForo_ControllerPublic_Abstract
{
	public function actionIndex()
	{
		return $this->responseView('Jake_ViewPublic_Jake', 'jake_template_content', $viewParams);
	} // public
} // class
#EOF
and eh .. i hope that's about it. lol
 

Jake Bunce

XenForo moderator
Staff member
#3
I am not an addon product. :eek:

I got all that setup but the URL doesn't work. I get:

A controller for the route path gallery/ was not found.
When I export my product the XML file has no route prefix:

Code:
  <route_prefixes/>
I can't find where to define that when creating an addon.
 
F

Floris

Guest
#6
in his screenshot

Route prefix: jake (reflects .com/xenforo/jake/ so to speak)
the class input field is how you call the class in the .php file

class dir_dir_dir_file (minus the .php)

library/JakesAddons/Gallery/Route/Gallery.php

class JakesAddons_Gallery_Route_Gallery { .. }

responseView has index, gallery, $whatever