This repository was archived by the owner on Jun 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Views basics
Alexanderius edited this page Feb 14, 2016
·
4 revisions
Views is a classes specifically designed to generated HTML content.
Each user created view must be derived from View class.
Views have limited amount of AcspNet modules, only modules useful for HTML content generation (to keep code SOLID;
public class LoggedUserPanelView : View
{
public ITemplate Get(string userName)
{
var tpl = await TemplateFactory.Load("Shared/LoginPanel/LoggedUserPanel");
tpl.Add("UserName", userName);
return tpl;
}
}You can access other views from a view, to do that you should use GetView<T>() method.
public class LoggedUserPanelView : View
{
public ITemplate Get(string userName)
{
var tpl = await TemplateFactory.Load("Shared/LoginPanel/LoggedUserPanel");
tpl.Add("SomePanel", GetView<SomePanel>().Get());
return tpl;
}
}- Getting Started
- Main Simplify.Web principles
- Simplify.Web controllers
- Simplify.Web views
- Simplify.Web templates
- Simplify.Web configuration
- Templates variables
- Static content
- Template factory
- Data collector
- String table
- File reader
- Web context
- Environment
- Language manager
- Redirector
- HTML