svandragt / cuttlefish-blog

Blog app built on Cuttlefish
MIT License
0 stars 0 forks source link

Installable Transforms #4

Open svandragt opened 11 years ago

svandragt commented 11 years ago

A model currently declares a structure, which describes the sections within a record. The structure is an array of field / transform pairs. Cuttlefish comes with markdown and metadatareader transforms, but we want the user to install and use their own. There is currently no registration method and extensibility to allow this, so this is not currently possible.

see https://github.com/svandragt/cuttlefish/blob/c432589449b8ee743862c11b051faadfd90c38d3/src/system/Model.php#L87

In the code above the transforms are hardcoded. Therefore there needs to be a registration system where a transform registers and then the register can be searched to match the model structure.

Previously: Model section explicitly has loading mechanisms for metadata and markdown. This should be part of the metadata and derived markdown class implementation respectively. This can be achieved using a trait, I think. Then content includes svandragt/cuttlefish-blog#2 can use this mechanism to register themselves and provide a loader for a content section.

svandragt commented 5 years ago

this is duped by svandragt/cuttlefish#67

svandragt commented 4 years ago

Maybe I shouldn't have removed the loaded_classes passing as I have in svandragt/cuttlefish#88. Would prefer to use some kind of hooking system ala wordpress.