#3740 - FILE_EXISTS symbol

Identifier #3740
Issue type Feature request or suggestion
Title FILE_EXISTS symbol
Status Completed
Tags

Good for training (custom)

Handling member Chris Graham
Addon core
Description Create and document a FILE_EXISTS symbol. This may be useful to templators who may embed procedurally-named graphics present on the filesystem, iff they exist.
Steps to reproduce

Additional information Sample code for a symbol hook which works (sources_custom/hooks/systems/symbols/FILE_EXISTS.php)...

<?php
class Hook_symbol_FILE_EXISTS
{
public function run($param)
{
if (!isset($param[0])) {
return '0';
}
$path = $param[0];
if (url_is_local($path)) {
$path = get_custom_file_base() . '/'. $path;
}
return file_exists($path) ? '1' : '0';
}
}
Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated