Represents an additional CSS resource to be used in the view for rendering. This allows for external libraries to be loaded and rendered more easily. Generates a valid XHTML style block or depending on the type.
// add a separate stylesheet file
$oCss = new mvcViewCss('mycss', mvcViewCss::TYPE_FILE, '/path/to/file.css');
// add some inline CSS
$oCss = new mvcViewCss('mycss', mvcViewCss::TYPE_INLINE, 'body { font-weight: bold; font-size: 12px; }');
// add some CSS specifically for a media type
$oCss = new mvcViewCss(
'mycss', mvcViewCss::TYPE_INLINE, 'body { font-weight: normal; font-size: small; }', mvcViewCss::MEDIA_MOBILE
);
public __construct([$inIdentifier = null], [$inType = 'file'], [$inResource = ''], [$inMediaType = 'screen'], [$inLinkType = 'stylesheet'], [$inMimeType = 'text/css'])
Creates a new CSS object
public __toString()
Converts the object to a string
public reset()
Resets the object
public getMediaType()
Returns the media type e.g. screen, print etc
public setMediaType($inMediaType)
Set $_MediaType to $inMediaType
public getLinkType()
Returns the link type, usually stylesheet but also alternate stylesheet
public setLinkType($inLinkType)
Set $_LinkType to $inLinkType
Tags: mvc, mvcviewcss, mvcviewresource,
mvc Articles