Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Application development questions
Hi, loving using Vanilla but a couple of questions when trying to create my application.
1. How do I redirect a user to a Not Found page? At the moment I'm doing something similar to:
if ($id) {
$this->Render();
}
else {
// Redirect to not found...
}
2. When calling $this->Render() is it possible to change the layout, for example the User Profile has the sidebar on the left rather than the right, how it this accessed via $this->Render()?
Thanks for any help!
1. How do I redirect a user to a Not Found page? At the moment I'm doing something similar to:
if ($id) {
$this->Render();
}
else {
// Redirect to not found...
}
2. When calling $this->Render() is it possible to change the layout, for example the User Profile has the sidebar on the left rather than the right, how it this accessed via $this->Render()?
Thanks for any help!
0
Best Answer
-
Todd Vanilla StaffWhen a record is not found I'd do the following:
if (!$id)
This will render the default page not found page in the current url. It will also work when accessing the page as json.
throw NotFoundException();
With regards to your layout question: the user profile renders the way it does using css rules. The body of the page always gets assigned an id and class that you can cascade from.0
Answers
With regards to your layout question: the user profile renders the way it does using css rules. The body of the page always gets assigned an id and class that you can cascade from.