System
[ class tree: System ] [ index: System ] [ all elements ]

Class: TResourceLocator

Source Location: /TResourceLocator.php

Class Overview


TResourceLocator class

Class Details

[line 34]
TResourceLocator class

By default, TResourceLocator is used by the PRADO framework to locate resource files including component specification and component template files.

You can specify your own locator class in the application specification.

Namespace: System




version:  v1.0, last update on 2004/08/13 21:44:52
author:  Qiang Xue <qiang.xue@gmail.com>


[ Top ]

Variables

Constants

Methods



Class Variables

$cssPath = 'css'

[line 54]

The absolute local URI storing css files.



access:  protected

Type:   string


[ Top ]

$imagePath = 'images'

[line 59]

The absolute local URI storing image files.



access:  protected

Type:   string


[ Top ]

$jsPath = 'js'

[line 49]

The absolute local URI storing javascript files.



access:  protected

Type:   string


[ Top ]



Class Methods


constructor __construct [line 65]

TResourceLocator __construct( mixed $config)

Constructor.



Parameters:

mixed   $config   configuration given in the application specification

[ Top ]

method getCssPath [line 193]

string getCssPath( )



return:  the absolute URI having css files
access:  public


[ Top ]

method getExternalTemplate [line 165]

string getExternalTemplate( string $pathAlias)

Gets the content of an external template.



return:  the external template content
access:  public


Parameters:

string   $pathAlias   the path alias to the external template.

[ Top ]

method getImagePath [line 201]

string getImagePath( )



return:  the absolute URI having image files
access:  public


[ Top ]

method getJsPath [line 185]

string getJsPath( )



return:  the absolute URI having javascript files
access:  public


[ Top ]

method getResource [line 136]

void getResource( string $file, string $dir, string $ext, [string $prefix = '.'], [string $culture = null])

Locate the resource for a particular culture. The parameter $resource must be the filename without the file extension.

e.g. support a resource of indexpage.tpl, then the parameter $resource should be $resouce = 'indexpage'; Resources are searched using "$resource.$prefix.$culture.$ext". Where each $culture is enumerated from "<LANG>_<COUNTYRY>_<VAIRANT>" "<LANG>_<COUNTYRY>" and then "<LANG>". If no culture specific resource is found, it returns the default "$resource.$ext".




access:  public
see:  TGlobalization::getVariants()


Parameters:

string   $file   the resource filename without extension
string   $dir   the resource directory with ending slash
string   $ext   the resource filename extension
string   $prefix   the prefix before appending the culture. Default is "."
string   $culture   the culture for this resource, default is null such that it uses the application default culture.

[ Top ]

method getRootURI [line 177]

string getRootURI( )



return:  the absolute URI having the entry script
access:  public


[ Top ]

method getSpecification [line 87]

string getSpecification( string $type)

Gets the content of the component specification.



return:  the component specification content, empty if specification not found.
access:  public


Parameters:

string   $type   the component type

[ Top ]

method getTemplate [line 102]

string getTemplate( string $type)

Gets the content of the component template



return:  the component template content, empty if template not found.
access:  public


Parameters:

string   $type   the component type

[ Top ]


Class Constants

EXT_SPECIFICATION = '.spec'

[line 39]

name extension to specification files


[ Top ]

EXT_TEMPLATE = '.tpl'

[line 43]

name extension to template files


[ Top ]



© 2004-2005 PRADO Software Group. All Rights Reserved.