Hi all,

I am developing an application which requires some quite powerful
markup. I won't bother explaining with words until you've seen some
markup:

=======

[title]A title which will be pulled and put in to a field separate to
the content in the database[/title]

This [i]is[/i] [b]some[/b] text. Here is the first paragraph of the
about page:

[div="home"][page url="/about" limit="paragraph" start=1][/div]

Here is 200 characters starting 100 characters in of the news page:

[div="news"][page url="/news" limit=200 start=100][/div]

[quote=23]
Here I am quoting an item of content with id 23, the quote header will
have a link to the content in question and will grab the username of
the content creator.
[/quote]

Some more text.

=======

Note: the above markup is just representative of what I might like to
do, it is not exactly what I will do.

What I want to know, is how I should split the logic for this. I have
a parser which understands the markup, but should it be in a component
(surely it needs to have open communication with the controller, for
the controller to get the information it needs) or should it be split
between a component and a helper

So,

Option 1, only a component: Tells the controller what data to get,
parses the markup to HTML and hands it back to the controller to pass
on to the view (which is non-the-wiser as to any pre-processing having
occurred).

Option 2: The component parses the markup and tells the controller to
get and give to the view any data it will need from the model. Then
the helper re-parses the markup and turns it in to a html
representation based on the data given.

Option n: Any other suggestions?

I hope this makes sense,

Adam.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to