symfony-cmf / resource-bundle

Resource Location for CMF documents based on Puli
https://cmf.symfony.com
5 stars 7 forks source link

[WIP] ResourceBundle #1

Closed dantleech closed 9 years ago

dantleech commented 10 years ago

This bundle aims provides object resource location services based on Puli.

Note that I will break a component out of this bundle, but its just easier to do the initial development as a bundle.

Examples:

The first example could use the existing CMF base route configuration to resolve paths.

The benefit of the next two examples would be most strongly felt in association with another component which would provide a context for the document resource resolution.

For example, a Site which is matched against the incoming hostname would provide the context with which to resolve the documents.

Problems which this aims to solve:

Things it would make possible:

See:

dbu commented 10 years ago

so for the menu example, we would have a map of "virtual paths" to repository paths, that in addition can be dynamic to support a multisite situation?

dantleech commented 10 years ago

Yeah, @webmozart just added a CompositeRepository to Puli, so we can do the following:

$repo->mount('/menu', function () use ($manager) {
    // $nestedRepo
    return new PhpcrOdmRepository($manager, '/cms/site1/menus');
});

// so
$repo->get('/menu/main');

// is the same as
$phpcrOdmRepo->get('/cms/site1/menus/main');

Still some blanks to be filled in however, its interesting.

dbu commented 10 years ago

... however, its interesting.

indeed it is!

dantleech commented 9 years ago

Will apply CSFixer and merge in the coming days.

dantleech commented 9 years ago

Merged.