joomla_api中文版(编辑修改稿)内容摘要:

name) string $name:The name of the template.(注 :template 包括 form,page,body). $temp = amp。 Jfactory::getTemplate()。 $tem = $tempdisplay(form)。 echo $tem。 结果 :释放并显示模板 . result: Could not load templates from dynamic. getURI 意义 :返回一个指向 JURI的标识符 . 语法 :object JURI amp。 getURI ([ $uri = 39。 server39。 ]) 实际应用 : example1 Variable string $_uri = null Original URL $temp = amp。 Jfactory::getURI()。 $uri = $temp_uri。 echo $uri。 结果 :显示 uri result: example2 Method string root ([boolean $pathonly = false], [$path = null]) boolean $pathonly :if ture,prepend the scheme,host and port information,Default is false. path $temp = amp。 Jfactory::getURI()。 $tem = $temproot()。 echo $tem。 结果 :为请求返回根 URI result: getUser 意义 :返回一个指向 JUser 的标识符 ,如果不存在就创建一个 . 语法 :object JUser amp。 getUser ([int $id = null]) int $id:the user to load Can be an integer or string – if string, it is converted to ID automatically. 实际应用 : example1 Methods object The amp。 getParameters ([boolean $loadsetupfile = false],[path $path = null]) boolean $loadsetupfile:if ture,loads the parameters setup is false. path $path:set the parameters setup file base path to be used to load the user parameters. $temp = amp。 Jfactory::getUser()。 $tem = $tempgetParameters()。 print_r($tem)。 结果 :得到用户参数 . result: JParameter Object ( [_raw] = [_xml] = Array ( [_default] = JSimpleXMLElement Object ( [_attributes] =.......... example2 Methods object The amp。 getTable ([string $type = null],[string $prefix = 39。 Jtable39。 ]) string $type:The user table name to be used. string $prefix:The user table prefix to be used. $temp = amp。 Jfactory::getUser()。 $tem = $tempgetTable()。 print_r($tem)。 结果 :得到用户表对像 . result: JTableUser Object ( [id] = 0 [name] = [username] = [] = [password] = [usertype] = [block] =....... getXMLParser 意义 :得到 XML文件对像 . 语法 :object Parsed amp。 getXMLParser ([string $type = 39。 DOM39。 ],[array:$option = array()]) string $type:The type of xml parser needed 39。 DOM39。 ,39。 RSS39。 or 39。 Simple39。 实际应用 : example1 Method loadstring $xmldoc = amp。 Jfactory::getXMLParser(39。 Simple39。 )。 $xmlstring = “product nameTelephone/name price$/price manufacturerCAMNAI Manufacturing Company/manfacturer /product”。 if ($xmldocloadString($xmlstring)){ echo “String sucessfully loaded!”。 } else { echo “Something didn39。 t work!”。 } 结果 :读取 xml 文件 . result: String successfully loaded! JLoader API Package 从指定的目录装载类 . 方法 Method Description import 从指定的目录装载类 load 为类装载文件 register 增加类到自动加载 方法应用 : register 意义 :增加类到自动加载 . 语法 :array $register ([$class = null],[string $file = null],string $classname) string $classname:The class name string $file:Full path to the file that holds the class. $class 实际应用 : $temp = amp。 new JLoader。 $tem = $tempregister()。 print_r($tem)。 结果 :返回类的数组 . result: Array ( [jobject] = /var//test/joomlaAPItest/libraries/joomla/base/ [jrequest] = /var//test/joomlaAPItest/libraries/joomla/environment/ [jresponse]= /var//test/joomlaAPItest/libraries/joomla/environment/ [jfactory] =........ JRoute API Package 翻译内部 Joomla URL 为人们可读的 URL. 方法 Method Description _ 翻译人类可读的 URL 方法应用 The _ 意义 :翻译为人为可读的 URL. 语法 :The _(string $url, [boolean $xhtml = ture],[int $ssl = null]) string $url:Absolute or Relative URI to Joomla resource boolean $xhtml:Replace amp。 by amp。 for xml pilance int $ssl:Secure state for the resolved URI 实际应用 : $temp = amp。 new JRoute。 $url = “?Itemid=29”。 $tem = $temp_($url,true)。 echo $tem。 结果 :用于产生网站链接地址 .当启用了 SEF,生成的链接就是重写后的地址 ,反之则为原地址 . result: /test/joomlaAPItest/?Itemid=29 JApplication API Package Home 作为特殊的工厂对像类 ,提供丰富的 API函数 . 方法 Method Description __construct 构建 JApplication 类 addCustomHeadTag Deprecated, use JDocumentaddCustomTag instead addMetaTag Deprecated, use JDocumentsetMetaData instead. appendMetaTag Deprecated, use JDocumentsetMetaData instead. appendPathWay Deprecated, use JPatwhWayaddItem() method instead. close 退出应用 . dispatch 派遣应用 . enqueueMessage 排队系统信息 . getBasePath Deprecated, use JURI::base() instead. getBlogCategoryCount Deprecated. getBlogSectionCount Deprecated. getCfg 得到配置变量 . getClientId 得到当前应用的客户 id. getContentItemLinkCount Deprecated. getCustomPathWay Deprecated, use JPathwaygetPathWayNames() method instead. getGlobalBlogSectionCount Deprecated. getHead Deprecated, use JDocumentget( 39。 head39。 ) instead. getInstance 返回一个 JApplication的对像 ,如果没有就创建一 个 . getItemid Deprecated, use ContentHelper::getItemid instead. getMenu 返回一个 JPathWay的对像 . getMessageQueue 得到系统消息队列 getName 得到应用程序名称的方法 . getPageTitle Deprecated, use JDocument::getTitle instead. getPath Deprecated, use JApplicationHelper::getPath instead. getPathway 返回一个 JPathWay的对像 . getRouter 返回一个 JRouter 的对像 . getStaticContentCount Deprecated. getTemplate 返回模板的名称 . getUser Deprecated, use JFactory::getUser instead. getUserState 得到用户状态 . getUserStateFromRequest 得到用户状态变量的值 . initialise 初始化应用 . isAdmin 是否 admin接口 isSite 是否 site 接口 login 登录认证函数 logout 登出认证函数 prependMetaTag Deprecated, use JDocumentsetMetaData instead redirect Redirect to another URL. registerEvent 注册管理一个特殊事件小组 . render Render the application. route 寻址应用 . setPageTitle Deprecated, use JDocument::setTitle instead. setUserState 设置用户状态变量的值 . triggerEvent 调用所有管理事件小组 方法应用 : addCustomHeadTag 意义 :增加一个自定义的 html 串到 head 块 . 语法 :void addCustomTag (string $html) string $html:The html to add to the head. (在 以上的版本里使用 JDocumentHTML::addCustomTag) 实际应用 : $doc。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。