I’m relatively new to Yii, and am still learning where everything belongs in the whole MVC structure.
Yii Models seem to be heavily based the Active Record concept, which is heavily based around retrieving data from an SQL database. I’m trying to understand from a philosophical viewpoint how to structure the MVC architecture when an application needs to display something that doesn’t come from a database such as directory/folder information from a file-system.
In this case, each file in a folder will have attributes such as "name", "size", etc associated with it. If this same information was stored in an SQL database clearly the Active Record provides a nice level of abstraction for accessing these properties, but when this information is sourced from file-system access functions, is there a philosophically correct way that this should be abstracted within a Yii Model?
I’m really trying to get my head around this concept, because an extension of this same question is: how should data be abstracted when it comes from table-like XML files rather than a MYSQL table.
<table>
<row> <name>abc</name> <size>123</size> </row>
<row> <name>def</name> <size>456</size> </row>
</table>
Any suggestions?
Regards,
Michael