你能否告诉我什么是<的freemarker等效标签? tiles:insertAttribute name =“contentName”/> ?我试过用< @ tiles.insertAttribute name =“contentname”/>它会抛出错误(因为freemarker.core.InvalidReferenceException:未定义表达式图块)。
答案 0 :(得分:0)
你必须告诉FreeMarker tiles
是什么,例如通过从JspTaglibs
哈希检索Tiles taglib。您可能想阅读the section about FreeMarker, servlets and taglibs from the FreeMarker manual。
答案 1 :(得分:0)
public protocol ViewControllerContainer {
var topMostViewController: UIViewController? { get }
}
extension UIViewController: ViewControllerContainer {
public var topMostViewController: UIViewController? {
if let presentedView = presentedViewController {
return recurseViewController(presentedView)
}
return childViewControllers.last.map(recurseViewController)
}
}
extension UITabBarController {
public override var topMostViewController: UIViewController? {
return selectedViewController.map(recurseViewController)
}
}
extension UINavigationController {
public override var topMostViewController: UIViewController? {
return viewControllers.last.map(recurseViewController)
}
}
extension UIWindow: ViewControllerContainer {
public var topMostViewController: UIViewController? {
return rootViewController.map(recurseViewController)
}
}
func recurseViewController(viewController: UIViewController) -> UIViewController {
return viewController.topMostViewController.map(recurseViewController) ?? viewController
}