Login | Forgot password | Register

X

What is OpenID?

OpenID is an Internet-wide identity system that allows you to sign in to many websites with a single account.

With OpenID, your ID becomes a URL (e.g. http://username.myopenid.com/). You can get a free OpenID for example from myopenid.com.

For more information visit the official OpenID site.

Jump to:

17480 Posts in 4474 Topics by 1973 members

Archive

SilverStripe Forums » Archive » Pass Variables in a Query String?

Our old forums are still available as a read-only archive.

Page: 1
Go to End
Author Topic: Pass Variables in a Query String? 211 Views
  • Garrett
    avatar
    Community Member
    73 posts

    Pass Variables in a Query String? Link to this post

    Pass Variables in a Query String?

    Hi,

    What is the best way to pass variables from page to page (template to template) in Silverstripe?

    I'm on a page which lists clients, and I want to click on the client and pass that client's name to a page whose controller takes the name and get all the projects for that particular client from the database.

    The link is "projects-by-client?Client=Client1". In my ProjectsByClient controller, I have the following function:

    function ProjectsByClient($Client) {
    $whereStatement = "ProjectClient = '".$Client."'";
    return DataObject::get("ProjectPage", $whereStatement);
    }

    Thwe query works fine if you hard-code a client name. But my controller is saying "missing argument" when I try to pass it in dynamically. How can I pass the client name to the controller?? Seems like this should be easy.

    Thanks in advance,
    Garrett

    211 Views
Page: 1
Go to Top

Currently Online: There is nobody online.

Welcome to our latest member: AlfonsoGrondo

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.