This is part of a content management system in which I allow my users
to upload images and files and create links to internal pages using
tinyMCE. The problem is that I have to fix the paths for much of the
stuff that they are uploading/linking to because tinyMCE creates the
links to images and files uploaded starting with ../../app/webroot  --
and obviously that has to change because those links won't work.  If I
change the way tinyMCE does the links, then the assets won't appear
correctly in the WYSIWYG editor.

So - I wrote a helper to fix all the paths, basically replacing
../../app/webroot where appropriate, and that helper uses the Html
helper to ensure that the links to images, files, and other links to
internal pages of the site have the correct path every time.

However that path fixing, IMO, should be part of the business logic and
not part of the views.  I don't want to call my path fixer every time I
output user-submitted content in the view.   I would rather prepare all
the user-submitted content before sending it to the view, because then
I can put it in a loop and not have a million calls to the path-fixing
method scattered throughout the view code.

I'm faced with basically writing my own version of the Html->link and
Html->image methods that can be used in a component, which I really
don't want to do, unless someone here has any other ideas.

-Rosie




On Jan 17, 12:46 pm, "John David Anderson (_psychic_)"
<[EMAIL PROTECTED]> wrote:
On Jan 17, 2007, at 10:17 AM, Rosie F. wrote:



> Hello all,

> I have a need to create links (both regular and images) from within
> the
> controller/component side of things.  Normally of course we would use
> the Html helper to make links.  But for this particular need I have,
> the links must be created before sending to the view.  Is there a
> component analogous to the Html helper that i can use to create links
> and image tags?This is hard, mostly because any sort of presentational stuff 
(i.e.
HTML) should be done in the views. Is there a reason you're not just
making the links in the views?

-- John


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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