For example, news. Just example, no explanations
Example:
// class.newsconttroller.php // file
// public function Index($Code) {
if (is_numeric($Code)) {
$this->View($Code);
}
// elseif(... other check for news category url code, etc.
}
...
// public function View() { // method
...
// trick
$NewsModel = Gdn_NewsModel();
$Story = $NewsModel->GetID($NewsID);
...
$NewsStoryURL = 'news/'.$Story->NewsID.'/'.Gdn_Format::Url($News->Title); // or you can use Clean() method
$CanonicalUrl = $this->CanonicalUrl(Url($NewsStoryURL, True));
if ($NewsStoryURL != $this->SelfUrl) Redirect($CanonicalUrl, 301);
...
0 • •
Comments
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •www.oreeka.co.uk
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •We can provide any original contents to bind url in this way within Garden framework, right?
I'll try it out later.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •What to do if I get a Bonk Error?
Vanilla Wiki : Join and help edit our Wiki! | View all Vanilla issues on GitHub | Report a new Vanilla issue on GitHub
Deploying a new Forum and adding a Theme | Give thanks to the Vanilla Developers!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Developer at Vanilla Forums, Inc. [GitHub, Twitter]
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •Thanks @Lincoln!
I posted, sleeped and woke up. Now I'm back in here and read this before to start coding.
It's my lucky day.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •