diff --git a/monstra/engine/options.php b/monstra/engine/options.php index c68c7a5..68a8524 100644 --- a/monstra/engine/options.php +++ b/monstra/engine/options.php @@ -164,4 +164,26 @@ return Option::$options->deleteWhere('[name="'.$option.'"]'); } + + /** + * Check if option exist + * + * + * if (Option::exist('pages_limit')) { + * // do something... + * } + * + * + * @param string $option Name of option to check. + * @return boolean + */ + public static function exist($option) { + + // Redefine vars + $option = (string) $option; + + // Check if option exist + return (count(Option::$options->select('[name="'.$option.'"]', null)) > 0) ? true : false; + } + } \ No newline at end of file