You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write a section explaning how one can implement page templates using an abstract class. Like this:
abstract class Template implements Page {
public NestedElement header() {
// return header code here
}
public NestedElement footer() {
// return footer code here
}
public abstract NestedElement content();
public final Tag render() {
return html().with(
header(),
content(),
footer());
}
}
class IndexPage extends Template {
public NestedElement content() {
// return content here
}
}
The text was updated successfully, but these errors were encountered:
Write a section explaning how one can implement page templates using an abstract class. Like this:
abstract class Template implements Page {
public NestedElement header() {
// return header code here
}
public NestedElement footer() {
// return footer code here
}
public abstract NestedElement content();
public final Tag render() {
return html().with(
header(),
content(),
footer());
}
}
class IndexPage extends Template {
public NestedElement content() {
// return content here
}
}
The text was updated successfully, but these errors were encountered: