Okay, this might sound a bit crazy at first, but there's real reasons
for doing this.

We're a design firm that developed a CMS to handle the advanced layout
requirement of our projects. The main thing is being able to build
pages which content fields change in name, amount and type. And that's
really working fine.

The problem is that the rest of the app services (blog, news, product)
need to change from project to project. I mean: for a client's
website, having a blog post with title and body fields is enough, but
another one might need a summary and two picture fields added to that.
What we've being doing to address this requirement is to start a new
project with a basic deploy, common to all projects, and change the DB
tables, models and controllers to fit the need of the client.

The problem is that it starts to become hard to merge back the
improvements we make in one project to the trunk, and then to use it
in another project, because they can be specific and dependent of
certain fields.

So we discussed and came up with the idea of encapsulating the
functionality of each feature in plugins, such as blog, news, catalog,
each with their own models, controllers and basic views, so we could
then extend those base classes into the functionality that is specific
to the project.

Objectively put:

- There's the BaseBlogPostsController which has all the functionality
we need.
- There's the BlogPostsController, which works the same way, but needs
three new methods and to change one of the base methods.

That's simple, isn't it? Basic OOP: just make class
BlogPostsController extends BaseBlogPostsController! (This last one in
the inheritance chain extends AppController)

Not quite so.

I wrote a class and defined a workflow that enables the app classes to
actually extend the base classes, through a singleton a series of
App:import() calls. But there's one problem I just can't figure out,
and here I hope you can help:

Cake only looks for the view for an action in the app/views/
<controller> folder, even if I added the plugin view folder to the
$viewPaths array in bootstrap.php.

I tried in BlogPostsController

function index() {
$this->autoRender = false;
parent::index();
}

but the view that Cake looks for is in the App folder.

And setAction() only accepts a string parameter, so I can't refer to
another class.

Does anyone has any idea?

I hope I was able to explain the problem properly. If not, PLEASE tell
me so and I'll try another way.

Thanks a lot!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to