Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8535381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:25:03+00:00 2026-06-11T10:25:03+00:00

In my current Contrete5 project, I have a single page, that takes one url

  • 0

In my current Contrete5 project, I have a single page, that takes one url parameter. So the urls look like this:

domain.com/[singlepagename]/[id]

and the controller has a corresponding view function:

function view($id) { ... }

now i need access to the id in the on_start() function. but function on_start($id) { ... } throws an error and $this->get() returns an empty array.

any idea how i can get url parts in on_start()?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:25:05+00:00Added an answer on June 11, 2026 at 10:25 am

    I’ve encountered this before… the problem is that C5’s Request object is not initialized until after the various package controllers’ on_start events are fired. I believe the only solution that people came up with was to manually initialize the Request class yourself in you package controller’s on_start function. If you look at the dispatcher.php file, you’ll see the following chunk of code around line #129 (in Concrete5.6.0.1):

    // figure out where we need to go
    $req = Request::get();
    if ($req->getRequestCollectionPath() != '') {
        if (ENABLE_LEGACY_CONTROLLER_URLS) {
            $c = Page::getByPath($req->getRequestCollectionPath(), 'ACTIVE');       
        } else {
            $c = $req->getRequestedPage();
        }
    } else {
        $c = Page::getByID($req->getRequestCollectionID(), 'ACTIVE');
    }
    
    $req = Request::get();
    $req->setCurrentPage($c);
    
    if ($c->isError()) {
        // if we've gotten an error getting information about this particular collection
        // than we load up the Content class, and get prepared to fire away
        switch($c->getError()) {
            case COLLECTION_NOT_FOUND:
                $v = View::getInstance();
                $v->render('/page_not_found');
                break;
        }
    }
    

    …so I think you can copy that all into your package controller’s on_start function, then you have the $req object to get your path info and variables from.

    NOTE: I copied that code from Concrete5.6.0.1. If you’re using a different version of the system, you should not just take what I pasted above, but instead copy the appropriate code yourself from the /concrete/dispatcher.php file

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a current (C#) project we have a 3rd party assembly that contains a
I have a small project that builds a number of targets from the same
My current project's UITableViewCell behavior is baffling me. I have a fairly straightforward subclass
I'm planing / designing my database for my current project (Java). For this project
I have a MVC3 project that uses the Entity Framework and Ninject v2.2, and
Here's a simple design patterns question: As part of my current project, I have
Background I am using interface-based programming on a current project and have run into
Current Process: I have a tar.gz file. (Actually, I have about 2000 of them,
In my current project I'm currently trying to replace the Windsor IoC in favour
I have tried: 1) I tried empty string first: <action type=Redirect url= redirectType=Permanent appendQueryString=false

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.