类 GetUrlMethod

java.lang.Object
com.publiccms.common.base.BaseMethod
com.publiccms.views.method.tools.GetUrlMethod
所有已实现的接口:
freemarker.template.TemplateMethodModel, freemarker.template.TemplateMethodModelEx, freemarker.template.TemplateModel
直接已知子类:
GetAbsoluteUrlMethod

@Component public class GetUrlMethod extends BaseMethod
getUrl 获取url绝对路径

参数列表

parameter list

パラメータリスト

  1. url前缀
  2. url,当第二个为空时,将第一个参数当作url

返回结果

return result

戻り値

  • url:绝对路径的url

使用示例

usage example

使用例

${getUrl(site.sitePath,'index.html')} ${getUrl('index.html')}

<script>
$.getJSON('${site.dynamicPath}api/method/getUrl?parameters=index.html', function(data){
console.log(data);
});
</script>
 
  • 字段详细资料

  • 构造器详细资料

    • GetUrlMethod

      public GetUrlMethod()
  • 方法详细资料

    • execute

      public Object execute(jakarta.servlet.http.HttpServletRequest request, List<freemarker.template.TemplateModel> arguments) throws freemarker.template.TemplateModelException
      覆盖:
      execute 在类中 BaseMethod
      抛出:
      freemarker.template.TemplateModelException
    • execute

      public Object execute(List<freemarker.template.TemplateModel> arguments) throws freemarker.template.TemplateModelException
      指定者:
      execute 在类中 BaseMethod
      抛出:
      freemarker.template.TemplateModelException
    • execute

      public Object execute(SysSite site, List<freemarker.template.TemplateModel> arguments) throws freemarker.template.TemplateModelException
      抛出:
      freemarker.template.TemplateModelException
    • needAppToken

      public boolean needAppToken()
      指定者:
      needAppToken 在类中 BaseMethod
      返回:
      whether to need app token
    • minParametersNumber

      public int minParametersNumber()
      指定者:
      minParametersNumber 在类中 BaseMethod
      返回:
      min parameters number