Vanilla\AddonManager::lookupTheme PHP Method

lookupTheme() public method

The theme's key MUST be the same as the folder it's in.
public lookupTheme ( string $key ) : null | Addon
$key string The key of the theme.
return null | Addon Returns an {@link Addon} object for the theme or **null** if it can't be found.
    public function lookupTheme($key)
    {
        $result = $this->lookupSingleCachedAddon($key, Addon::TYPE_THEME);
        return $result;
    }

Usage Example

コード例 #1
0
 /**
  * Test a theme for dependencies and parse errors.
  *
  * @param string $themeName The case-sensitive theme name.
  * @return bool Returns
  * @throws Gdn_UserException Throws an exception when there was an issue testing the theme.
  */
 public function testTheme($themeName)
 {
     $addon = $this->addonManager->lookupTheme($themeName);
     if (!$addon) {
         throw notFoundException('Plugin');
     }
     try {
         $this->addonManager->checkRequirements($addon, true);
         $addon->test(true);
     } catch (\Exception $ex) {
         throw new Gdn_UserException($ex->getMessage(), $ex->getCode());
     }
     return true;
 }