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

How do I get the parameters from the url

Discussion in 'XenForo Development Discussions' started by simbolo, Feb 23, 2012.

  1. simbolo

    simbolo Well-Known Member

    Anyone know what I would need to set so I could do something like this:

    example.com/help/advertising/additional-page/
    or
    example.com/help/additional-page/advertising
    To do along with something like this:
    PHP:
    public function actionAdditionalPage()
        {
            
    // Get the page from the url
            
    $current_url_param $this->_input->filterSingle('help_page_name'XenForo_Input::STRING); // Outputs: advertising
            // Template name
            
    $current_url_param_template 'help_' $current_url_param// Outputs: help_advertising
            // Class name
            
    $current_url_param_class 'XenForo_ViewPublic_Help_' .ucfirst($current_url_param); // Outputs: XenForo_ViewPublic_Help_Advertising

            // return template that should be displayed
            
    return $this->_getWrapper($current_url_param,
                        
    $this->responseView$current_url_param_class$current_url_param_template)); // Returns help_advertising template view

        
    }
    This would take the advertising part of the url and output the correct template and class info.

    Instead of coding every page action this would allow me to specify it else where and remove the dependency on creating a new action each time. I *should* be able to do it, just not sure on the syntax within xF.
     

Share This Page