-
Dispatching & URLs
Overview Vanilla has 3 primary ways of dispatching URLs and they are tried in the following order. Routes registered with Garden\Web\Dispatcher. Pages using Gdn_Dispatcher. Redirects from Gdn_Router. Garden\Web\Dispatcher Routes There are primarily 2 types of routes dispatched from Garden\Web\Dispatcher.…
-
Creating Pages & Controllers
Looking to create routes containing some UI and content? This is the article for you! Differences from Gdn_Controller A PageDispatchController serves a different purpose to a Gdn_Controller. PageDispatchController Core static master view only. Primary views expected to be rendered in React. Server side rendering only of…
-
Routing in React
Once a PageDispatchController has been configured and the server is serving a route, the frontend needs to be configured to mount something there. From here the frontend router will attempt to handle as much routing as possible, until it it navigates to a route outside of its current section. Generally this is caused by a…
-
Route Management & Redirects
Route management allows you to create custom urls to specific pages within your Vanilla 2 installation. It also comes with some pre-defined default values. Pre-defined Routes There are four pre-defined routes that have special meaning. They are: DefaultController - This is the main page to load when the root url of your…
-
The Request Object
Vanilla’s base Controller class (the class from which all controllers are extended) accepts a DeliveryType parameter on every request. Depending on the type of delivery being requested, a controller in Garden will deliver all of a page, part of a page, or part of a page plus extra information as JSON. DeliveryType There…
-
Permission Checking
Vanilla uses permissions to restrict access to particular content, options, or workflows. There are a number of functions built into the framework to do this efficiently. We eschew role-detection as a means of access control. For example, we would never check to make sure someone was in a role named Moderator before…
-
Models, Forms, & Validation
The theory of a Model in MVC is that it is an object representation of the data being manipulated. In Garden, however, the actual object representation of the data comes from the DataSet class in the form of a php stdClass. So, as you may have guessed already, in Garden the model isn’t a representation of the data. In…