WebFioriAPI ReferenceLearnDownloadContributeLearn{{result.parent_page}} > {{result.title}}{{result.title}}Classes{{result.class_name}}{{result.summary}}Methods{{result.name}}{{result.summary}}

namespace \webfiori\framework

abstract class Theme

Class Methods Summary

public function __construct($themeNameThe)Creates new instance of the class using default values.public function createHTMLNode(array$options)Creates an instance of 'HTMLNode' given an array of options.public abstract function getAsideNode()Returns an object of type 'HTMLNode' that represents aside section of the page.public function getAuthor()Returns the name of theme author.public function getAuthorUrl()Returns the URL which takes the users to author's web site.public function getBaseURL()Returns the base URL that will be used by the theme.public function getCssDirName()Returns the name of the directory where CSS files are kept.public function getDescription()Returns the description of the theme.public function getDirecotry()Returns a string that represents the directory at which the theme exist in the system.public function getDirectoryName()Returns the name of the directory where all theme files are kept.public abstract function getFooterNode()Returns an object of type 'HTMLNode' that represents footer section of the page.public abstract function getHeadNode()Returns an object of type HeadNode that represents HTML <head> node.public abstract function getHeaderNode()Returns an object of type HTMLNode that represents header section of the page.public function getImagesDirName()Returns the name of the directory where theme images are kept.public function getJsDirName()Returns the name of the directory where JavaScript files are kept.public function getLicenseName()Returns the name of theme license.public function getLicenseUrl()Returns a URL which should contain a full version of theme license.public function getName()Returns the name of the theme.public function getPage()Returns the page at which the theme will be applied to.public function getUrl()Returns A URL which should point to theme web site.public function getVersion()Returns theme version number.public function invokeAfterLoaded()Fire the callback function which should be called after loading the theme.public function invokeBeforeLoaded()Fire the callback function which should be called before loading the theme.public function setAfterLoaded(callable$function, array$params)Sets the value of the callback which will be called after theme is loaded.public function setAuthor(string$author)Sets the name of theme author.public function setAuthorUrl(string$authorUrl)Sets the URL to the theme author.public function setBaseURL(string$url)Sets The base URL that will be used by the theme.public function setBeforeLoaded(callback$function, array$params)Sets the value of the callback which will be called before theme is loaded.public function setCssDirName(string$name)Sets the name of the directory where theme CSS files are kept.public function setDescription(string$desc)Sets the description of the theme.public function setImagesDirName(string$name)Sets the name of the directory where theme images are kept.public function setJsDirName(string$name)Sets the name of the directory where theme JavaScript files are kept.public function setLicenseName(string$text)Sets the name of theme license.public function setLicenseUrl(string$url)Sets a URL to the license where people can find more details about it.public function setName(string$name)Sets the name of the theme.public function setPage(WebPage$page)Sets the page at which the theme will be applied to.public function setUrl(string$url)Sets the URL of theme designer web site.public function setVersion(string$vNum)Sets the version number of the theme.public function toJSON()Returns an object of type Json that represents the theme.

Class Methods Details

public function __construct($themeNameThe)
Creates new instance of the class using default values. The default values will be set as follows:
  • Theme URL will be an empty string.
  • Author name will be an empty string.
  • Author URL will be an empty string.
  • Theme version will be set to '1.0.0'
  • Theme license will be an empty string.
  • License URL will be an empty string.
  • Theme description will be an empty string.
  • Theme directory name will be an empty string.
  • Theme CSS directory name will be set to 'css'
  • Theme JS directory name will be set to 'js'
  • Theme images directory name will be set to 'images'

Parameters:

  • $themeName The name of the theme. The name is used to load the theme. For that reason, it must be unique.
public function createHTMLNode(array$options)Creates an instance of 'HTMLNode' given an array of options. The developer can override this method to make it create custom HTML elements which can be re-used across web pages. By default, the method will create a <div> element. A use case for this method would be as follows, the developer would like to create different type of input elements. One possible option in the passed array would be 'input-type'. By checking this option in the body of the method, the developer can return different types of input elements.

Parameters:

  • array $options An array of options that developer can specify. Default implementation of the method accepts two options, the option 'name' which represents the name of HTML tag (such as 'div') and the option 'attributes' which is a sub array that contains tag attributes.
Returns: HTMLNodeThe developer must implement this method in away that makes it return an instance of the class 'HTMLNode'.
public abstract function getAsideNode()Returns an object of type 'HTMLNode' that represents aside section of the page. The developer must implement this method such that it returns an object of type 'HTMLNode'. Aside section of the page will contain advertisements most of the time. Sometimes, it can contain aside menu for the web site or widgets.Returns: HTMLNodeAn object of type 'HTMLNode'. If the theme has no aside section, the method might return null.public function getAuthor()Returns the name of theme author. Returns: stringThe name of theme author. If author name is not set, the method will return empty string.public function getAuthorUrl()Returns the URL which takes the users to author's web site. Returns: stringThe URL which takes users to author's web site. If author URL is not set, the method will return empty string.public function getBaseURL()Returns the base URL that will be used by the theme. The URL is used by the HTML tag 'base' to fetch page resources. If the URL is not set by the developer, the method will return the URL that is returned by the method SiteConfig::getBaseURL().Returns: stringThe base URL that will be used by the theme.public function getCssDirName()Returns the name of the directory where CSS files are kept. Returns: stringThe name of the directory where theme CSS files kept. If the name of the directory was not set by the method Theme::setCssDirName(), then the returned value will be 'css'.public function getDescription()Returns the description of the theme. Returns: stringThe description of the theme. If the description is not set, the method will return empty string.public function getDirecotry()Returns a string that represents the directory at which the theme exist in the system. This method is useful if the developer would like to load HTML file which is part of the theme using the method HTMLNode::loadComponent().Returns: stringThe string will be something like 'C:\Server\apache\htdocs\my-site\themes\my-theme\'.public function getDirectoryName()Returns the name of the directory where all theme files are kept. The directory of a theme is a folder which exist inside the directory '/themes'.Returns: stringThe name of the directory where all theme files are kept. If it is not set, the method will return empty string.public abstract function getFooterNode()Returns an object of type 'HTMLNode' that represents footer section of the page. The developer must implement this method such that it returns an object of type 'HTMLNode'. Footer section of the page usually include links to social media profiles, about us page and site map. In addition, it might contain copyright notice and contact information. More complex layouts can have more items in the footer.Returns: HTMLNodeAn object of type 'HTMLNode'. If the theme has no footer section, the method might return null.public abstract function getHeadNode()Returns an object of type HeadNode that represents HTML <head> node. The developer must implement this method such that it returns an object of type HeadNode. The developer can use this method to include any JavaScript or CSS files that website pages needs. Also, it can be used to add custom meta tags to <head> node or any tag that can be added to the <head> HTML element.Returns: HeadNodeAn object of type HeadNode.public abstract function getHeaderNode()Returns an object of type HTMLNode that represents header section of the page. The developer must implement this method such that it returns an object of type 'HTMLNode'. Header section of the page usually include a main navigation menu, web site name and web site logo. More complex layout can include other things such as a search bar, notifications area and user profile picture. If the page does not have a header section, the developer can make this method return null.Returns: HTMLNode|nullAn object of type 'HTMLNode'. If the theme has no header section, the method might return null.public function getImagesDirName()Returns the name of the directory where theme images are kept. Returns: stringThe name of the directory where theme images are kept. If the name of the directory was not set by the method Theme::setImagesDirName(), then the returned value will be 'images'.public function getJsDirName()Returns the name of the directory where JavaScript files are kept. Returns: stringThe name of the directory where theme JavaScript files kept. If the name of the directory was not set by the method Theme::setJsDirName(), then the returned value will be 'js'.public function getLicenseName()Returns the name of theme license. Returns: stringThe name of theme license. If it is not set, the method will return empty string.public function getLicenseUrl()Returns a URL which should contain a full version of theme license. Returns: stringA URL which contain a full version of theme license. If it is not set, the method will return empty string.public function getName()Returns the name of the theme. If the name is not set, the method will return empty string.Returns: stringThe name of the theme.public function getPage()Returns the page at which the theme will be applied to. Returns: WebPage|nullIf the theme is applied to a page, the method will return it as an object. If theme is not applied to any page, the method will return null.public function getUrl()Returns A URL which should point to theme web site. Returns: stringA URL which should point to theme web site. Usually, this one is the same as author URL.If it is not set, the method will return empty string.public function getVersion()Returns theme version number. Returns: stringtheme version number. The format if the version number is 'x.x.x' where 'x' can be any number. If it is not set, the method will return '1.0.0'.public function invokeAfterLoaded()Fire the callback function which should be called after loading the theme. This method must not be used by the developers. It is called automatically when the theme is loaded.public function invokeBeforeLoaded()Fire the callback function which should be called before loading the theme. This method must not be used by the developers. It is called automatically when the theme is being loaded.public function setAfterLoaded(callable$function, array$params)Sets the value of the callback which will be called after theme is loaded.

Parameters:

  • callable $function The callback. The first parameter of the callback will be always 'this' theme. (e.g. function ($theme){}). The function can have other parameters if they are provided.
  • array $params An array of parameters which can be passed to the callback.
public function setAuthor(string$author)Sets the name of theme author.

Parameters:

  • string $author The name of theme author (such as 'Ibrahim BinAlshikh').
public function setAuthorUrl(string$authorUrl)Sets the URL to the theme author. It can be the same as Theme URL.

Parameters:

  • string $authorUrl The URL to the author's web site.
public function setBaseURL(string$url)Sets The base URL that will be used by the theme. This URL is used by the HTML tag 'base' to fetch page resources. The given string must be non-empty string in order to set.

Parameters:

  • string $url The base URL that will be used by the theme.
public function setBeforeLoaded(callback$function, array$params)Sets the value of the callback which will be called before theme is loaded.

Parameters:

  • callback $function The callback. The first parameter of the callback will be always 'this' theme. (e.g. function ($theme){}). The function can have other parameters if they are provided.
  • array $params An array of parameters which can be passed to the callback.
public function setCssDirName(string$name)Sets the name of the directory where theme CSS files are kept. Note that it will be set only if the given name is not an empty string. In addition, directory name must not include theme directory name. For example, if your theme CSS files exist in the directory '/themes/super-theme/css', the value that must be supplied to this method is 'css'.

Parameters:

  • string $name The name of the directory where theme CSS files are kept.
public function setDescription(string$desc)Sets the description of the theme.

Parameters:

  • string $desc Theme description. Usually a short paragraph of two or 3 sentences. It must be non-empty string in order to set.
public function setImagesDirName(string$name)Sets the name of the directory where theme images are kept. Note that it will be set only if the given name is not an empty string. In addition, directory name must not include theme directory name. For example, if your theme images exist in the directory '/themes/super-theme/images', the value that must be supplied to this method is 'images'.

Parameters:

  • string $name The name of the directory where theme images are kept.
public function setJsDirName(string$name)Sets the name of the directory where theme JavaScript files are kept. Note that it will be set only if the given name is not an empty string. In addition, directory name must not include theme directory name. For example, if your theme JavaScript files exist in the directory '/themes/super-theme/js', the value that must be supplied to this method is 'js'.

Parameters:

  • string $name The name of the directory where theme JavaScript files are kept.
public function setLicenseName(string$text)Sets the name of theme license.

Parameters:

  • string $text The name of theme license. It must be non-empty string in order to set.
public function setLicenseUrl(string$url)Sets a URL to the license where people can find more details about it.

Parameters:

  • string $url A URL to the license.
public function setName(string$name)Sets the name of the theme.

Parameters:

  • string $name The name of the theme. It must be non-empty string in order to set. Note that the name of the theme acts as the unique identifier for the theme. It can be used to load the theme later.
public function setPage(WebPage$page)Sets the page at which the theme will be applied to.

Parameters:

  • WebPage $page The page that the theme is applied to.
public function setUrl(string$url)Sets the URL of theme designer web site. Theme URL can be the same as author URL.

Parameters:

  • string $url The URL to theme designer web site.
public function setVersion(string$vNum)Sets the version number of the theme.

Parameters:

  • string $vNum Version number. The format of version number is usually like 'X.X.X' where the 'X' can be any number.
public function toJSON()
Returns an object of type Json that represents the theme. JSON string that will be generated by the Json instance will have the following information:

{
  "themesPath":""
  "name":""
  "version":""
  "author":""
  "imagesDirName":""
  "themeDirName":""
  "cssDirName":""
  "jsDirName":""
}

Returns: JsonAn object of type Json.
mdi-menuAll Classesmdi-chevron-leftAnchorBrCodeSnippetHTMLDocHTMLListHTMLNodeHTMLTableHeadNodeInputJsCodeLabelListItemOrderedListParagraphRadioGroupTableCellTableRowUnorderedListInvalidNodeNameExceptionTemplateNotFoundExceptionCaseConverterJsonJsonConverterJsonIJsonTypesPropertyAPIFilterAbstractWebServiceManagerInfoServiceParamTypesRequestRequestParameterResponseUriWebServicesManagerAccessAutoLoaderConfigConfigControllerDBEAbstractWebServiceExtendedWebServicesManagerFileLoggerPrivilegePrivilegesGroupThemeThemeLoaderUploadFileUploaderUserUtilWebFioriAppLanguageErrorBoxHTTPCodeViewMessageBoxServerErrViewStarterPageWebPageDatabaseSessionStorageDefaultSessionStorageMSSQLSessionDataTableMSSQLSessionsTableMySQLSessionDataTableMySQLSessionsTableSessionSessionOperationsSessionStorageSessionsManagerRouterRouterUriAbstractMiddlewareMiddlewareManagerEmailMessageSMTPAccountSMTPServerClassLoaderExceptionFileExceptionInitializationExceptionInvalidCRONExprExceptionMissingLangExceptionNoSuchThemeExceptionRoutingExceptionSMTPExceptionSessionExceptionUIExceptionAbstractJobCronCronEmailCronJobJobArgumentCronLoginViewCronTasksViewCronViewCronLoginServiceCronLogoutServiceCronServicesManagerForceCronExecutionServiceGetJobsServiceCLICLICommandInputStreamOutputStreamStdInStdOutClassWriterLangClassWriterQueryClassWriterServiceHolderThemeClassWriterWebServiceWriterCreateCLIClassHelperCreateCronJobCreateMiddlewareCreateTableCreateTableObjCreateThemeHelperCreateWebServiceAddCommandCreateCommandCronCommandHelpCommandListCronCommandListRoutesCommandListThemesCommandRunSQLQueryCommandSettingsCommandTestRouteCommandUpdateSettingsCommandUpdateTableCommandVersionCommandAbstractQueryColumnColumnFactoryConditionConnectionConnectionInfoDatabaseDatabaseExceptionDateTimeValidatorEntityMapperExpressionForeignKeyJoinTableResultSetSelectExpressionTableWhereExpressionMySQLColumnMySQLConnectionMySQLQueryMySQLTableMSSQLColumnMSSQLConnectionMSSQLQueryMSSQLTableAbstractCollectionComparableLinkedListNodeQueueStack
Powered By: WebFiori Framework, Vue and VuetifyAll Rights Reserved © 2018 - 2024