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

unsure what to do with the actions I need

Discussion in 'XenForo Development Discussions' started by dmnkhhn, Oct 9, 2010.

  1. dmnkhhn

    dmnkhhn Active Member

    Hello there!

    I am rebuilding some of my addons and right now I am unsure what to do with all the actions I need.

    My first add-on is going to be some sort of garage where my members can show their cars.

    Here's the url structure I would like to use

    /garage => index (list of garages)
    /garage/2 => details for garage with id of 2
    /garage/2/car/1 => details for a car with id of 1 parked in garage with id of 2

    And (for admins and the owner of the garage)
    /garage/2/edit
    /garage/2/car/1/edit

    I am already using
    PHP:
    $action $router->resolveActionWithIntegerParam($routePath$request'garage_id');
    in the router so /garage and garage/2 and even garage/2/edit are working fine (the latter just calls actionEdit inside my controller).

    Now when I type /garage/2/car/1 into my browser I get:
    How do I get the last part of the Url (the car thing) working?

    Is it even possible or do I need to create a new route (like garage-car/2/edit)?
     
    steven s likes this.
  2. Lawrence

    Lawrence Well-Known Member

    The Class you are using to action your index will also need a function added like this:

    public function actionCar()
    {

    }
     
  3. steven s

    steven s Well-Known Member

  4. dmnkhhn

    dmnkhhn Active Member

    I already tried it but I don't get the ID of the car.
    With this function in place, the following works: /garage/2/car

    But this does not: /garage/2/car/1

    ragtek suggest to take a look at prefixadmin/moderators.php - The code looks promising. :)
     
  5. wickedstangs

    wickedstangs Well-Known Member

    good luck, I need a garage for my site as well.
     
  6. trilogy33

    trilogy33 Well-Known Member

    Same here.
    I used to run vBGarage which was good in it's day, around the vB3.6 era. Lack of updates meant that it broke after 3.8 IIRC.
     

Share This Page