mirror of
https://github.com/flextype/flextype.git
synced 2025-08-11 23:54:06 +02:00
Flextype Core: Entries - new method update() - added.
This commit is contained in:
@@ -282,6 +282,24 @@ class Entries
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update entry
|
||||
*
|
||||
* @param string $entry Entry
|
||||
* @param string $data Data
|
||||
* @return bool
|
||||
*/
|
||||
public static update(string $entry, string $data) : bool
|
||||
{
|
||||
$entry_file = PATH['entries'] . '/' . $entry . '/entry.html';
|
||||
|
||||
if (Filesystem::has($entry_file)) {
|
||||
return Filesystem::write($entry_file, $data);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create entry
|
||||
*
|
||||
|
Reference in New Issue
Block a user