Try this:

Create a file app/views/helpers/myhtml.php with the following code:

---------------------------------------------------------------------------
<?php

require_once(CAKE_CORE_INCLUDE_PATH . DS . 'cake' . DS . 'libs' . DS .
'view' . DS . 'helpers' . DS . 'html.php');

class MyhtmlHelper extends HtmlHelper 
{
        function dateTimeOptionTag($tagName, $dateFormat = 'DMY',
$timeFormat = '12', $selected = null, $selectAttr = null, $optionAttr =
null, $showEmpty = true) 
        {
                parent:: dateTimeOptionTag($tagName, $dateFormat,
$timeFormat, $selected, $selectAttr, $optionAttr, $showEmpty);
        }
}

?>
---------------------------------------------------------------------------

Then on your controller add this helper:

var $helpers = array( 'Myhtml' );

And on your view use this helper to create your tag:

<?php echo $myhtml->dateTimeOptionTag(...); ?>

Finally you can customize your version of dateTimeOptionTag() instead of
calling the parent version.

You can even copy the code from HtmlHelper right there and modify at will,
since this class inherits from HtmlHelper.

-MI

---------------------------------------------------------------------------

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!


-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de Rodrigo Tassinari
Enviado el: MiƩrcoles, 29 de Noviembre de 2006 09:48 p.m.
Para: Cake PHP
Asunto: Re: Replacing Html Helper


Adrian, I tried to do what you said, but I failed. I need to override
the dateTimeOptionTag() function, which uses lots of other functions
and public variables from thr HtmlHelper... how do I do that? Do I have
to override all those functions too?


--~--~---------~--~----~------------~-------~--~----~
 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