This repository has been 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
File reader
Alexanderius edited this page Jun 30, 2019
·
3 revisions
FileReader
is a class for loading localizable text files from data folder specified in Simplify.Web configuration.
- File name should contain language prefix, for example, if you loading file
Menu.xml
, then it should be namedMenu.{language}.xml
in data folder; - File will be loaded for current language, if current language file does not exist, then the file for default language will be loaded.
public class MyController : Controller
{
public override ControllerResponse Invoke()
{
// It loads Menu.en.xml file
var myData = FileReader.LoadXDocument("Menu.xml");
...
}
}
public class MyController : Controller
{
public override ControllerResponse Invoke()
{
// It loads Menu.en.xml file
var myData = FileReader.LoadXDocument("Menu");
...
}
}
public class MyController : Controller
{
public override ControllerResponse Invoke()
{
// It loads Menu.en.xml file
var myData = FileReader.LoadTextDocument("SomeFile.html");
...
}
}
...
FileReader.LoadTextDocument("SomeFile.html", true);
FileReader.LoadXDocument("Menu", true);
...
Files cache can be globally disabled via Simplify.Web configuration.
- 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