21491 Posts in 5783 Topics by 2622 members
| Go to End | ||
| Author | Topic: | 3510 Views |
-
Re: Query Data from a custom Table

16 March 2009 at 3:57am
Ah ok.
that was my Idea to have 1Page (Location) instead of upcoming 500
There is another Question in the Board i wrote.
It is related to this here, because i want to grab Data on a Detailpage.
But the Variable shouldn't be an ID.
It should be the name with some modiifcations.Maybe you have some Thoughts for me ;) ?
Thanks Aram!
-
Re: Query Data from a custom Table

16 March 2009 at 4:30am Last edited: 16 March 2009 4:30am
ok, well you can pass anything you like as long as you can use it to fetch the Submission that you want from the database.
So for example you could use $Name and $Author by passing a link location/$Name/$Author and using a function like this:
public function GetLocationSubmission(){
$Params = Director::urlParams(); //This gets our URLparams
$Name = $Params['Action']; //gets the first param
$Author = $Params['ID']; //gets the second paramreturn DataObject::get_one("LocationSubmission", "Name = {$Name} AND Author = {$Author}");
}
-
Re: Query Data from a custom Table

16 March 2009 at 4:39am
ah ok and how can i replace
"ä ö ü ß" with "ae oe ue ss" write everything lowercase and replace an Space with "_"?
For example:
Locationname: "Die kleine Kneipe" - should be fetched by the URL: domain.de/die_kleine_kneipe:/
-
Re: Query Data from a custom Table

16 March 2009 at 5:17am
have a look at the PHP docs for string functions, theres probably some stuff in there to do search and replace type stuff. I don't think sapphire/SS has anything that can help you with that.
| 3510 Views | ||
| Go to Top |


