getResourceConfig
Client-side
Server-side
Shared
This page is incomplete! Help wanted!
Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.
This function is used to return the root node of a configuration file. Config files must be predefined in a resource's meta file. An alternative way to load XML files is to use xmlLoadFile.
Syntax
getResourceConfig ( )Code Examples
server
This example opens a configuration file and prints the value of the 'attr' attribute of the first 'group' node.
function resourceStart ( ) -- When the resource is started local node = getResourceConfig( "config.xml" ) -- get the configuration file local subNode = xmlFindChild( node, "group", 0 ) -- get a subnode in it outputChatBox( xmlNodeGetAttribute( subNode, "attr" ),root ) -- output its attributes value to chatboxendaddEventHandler ( "onResourceStart", resourceRoot, resourceStart )See Also
Resource Functions
- abortRemoteRequest
- addResourceConfig
- addResourceMap
- call
- callRemote
- copyResource
- createResource
- deleteResource
- fetchRemote
- getRemoteRequestInfo
- getRemoteRequests
- getResourceACLRequests
- getResourceConfig
- getResourceDynamicElementRoot
- getResourceExportedFunctions
- getResourceFromName
- getResourceGUIElement
- getResourceInfo
- getResourceLastStartTime
- getResourceLoadFailureReason
- getResourceLoadTime
- getResourceMapRootElement
- getResourceName
- getResourceOrganizationalPath
- getResourceRootElement
- getResources
- getResourceState
- getThisResource
- isResourceArchived
- isResourceProtected
- refreshResources
- removeResourceFile
- renameResource
- restartResource
- setResourceInfo
- startResource
- stopResource
- updateResourceACLRequest