Re: Html helper emits id attribute that i don't want

2006-09-19 Thread [EMAIL PROTECTED]

I don't think Nate was flaming Dieter.  So, it shouldn't be a problem.
Nate was flaming all those people that want to configure and
reconfigure over and over again.  Those are the same people with
spaghetti code.  And even the ones that don't have spaghetti code, that
have studied well and make their own standards, wouldn't it be much
easier if they just used CakePHP which has standards which is what the
conventions are.  It is a standard way of outputting so you know what
to expect without having to type all over the place.

Before I found CakePHP I use to wonder how people can do open source, I
mean I realized it was good at getting the best result because the most
minds could work on it, but why not make money?  I just didn't get it.
Now, I found CakePHP and donate my monthly money, contribute to this
Google group, and worked hard to debug the code when it was RC and
preRC.  I did all this because I believed in CakePHP and it's mission.

I know that I myself often get frustrated with people who are new to
CakePHP and want it to do things the way they use to do them.  Back in
the days when they took months to write applications and ended up with
some level of spaghetti code just simply because it worked.  I also get
frustrated with people who are so quick to say, CakePHP is screwing up,
or not working right!  Instead of trying to actually debug their app,
discover the behaviour, become familiar with CakePHP and love it.  So
many people it seems forget that this is code, not life.  It follows a
predesigned set of rules.  The output is predictable.  And when you get
unpredicted results, you can debug it because there isn't chance, or
life in the equation.  Making any application work isn't the result of
throwing dice until it lands on 7.  It is the result of resolving
problems as they arise.  Every programming problem has a solution.  And
often it is simple and not that CakePHP is broken, but that you forgot
case sensitivity or didn't know how to turn off mod_rewrite in CakePHP.

So, it wasn't a flame, but an expression of angst against those that
just don't get it.  That don't realize that by following standards
(even if imposed by CakePHP) is much better way of coding than
reinventing the wheel from the ground up.


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



Re: Html helper emits id attribute that i don't want

2006-09-19 Thread nate

> The above message from you to the list is almost a flame. Well, it is a
> flame.

I disagree.

> On purely neutral grounds -- as I would tend to agree with your opinion
> on this topic -- I've found that things work out better in a mailing
> list if people refrain from writing flames and almost-flames.

What I expressed was a strong opinion, which goes to the core of the
philosophy of this project, as well as my belief (which I stand by)
that people who do not agree with the philosophy of the project should
not use it.

Further, the expression of that opinion was not about or directed
towards any one person.  Rather, it was directed towards an idea, and
idea which runs counter to the philosophy of this project.  Once again,
this project has a very specific philosophy, and as such, very strong
opinions.  Therein lies the problem: it is difficult, if not
impossible, to have strong opinions without upsetting some people or
offending their sensibilities.  However, this is something I'm willing
to deal with.

Such is life.


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



Re: Html helper emits id attribute that i don't want

2006-09-19 Thread [EMAIL PROTECTED]

nate wrote:
> Yes, you're right: the usual, dumb, wasteful approach to coding is that
> you have to explicitly specify every little thing you want your program
> to do.
>
> If that's how you want to write your code, you should not, I repeat
> *not* use CakePHP.  ...

Nate,

The above message from you to the list is almost a flame. Well, it is a
flame.

On purely neutral grounds -- as I would tend to agree with your opinion
on this topic -- I've found that things work out better in a mailing
list if people refrain from writing flames and almost-flames.

Of course, I also know how tense one can get with a busy mailing list!
It's exhausting, especially when the original group is overwhelmed by
newcomers.

Regards,

Ralph


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



Re: Html helper emits id attribute that i don't want

2006-09-19 Thread [EMAIL PROTECTED]

No problems Dieter.  Just seemed so weird to us that use the natural id
and do AJAX daily with CakePHP.  Seemed like a no brainer to us.  You
really should try AJAX.  CakePHP makes it SO easy to implement.


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



Re: Html helper emits id attribute that i don't want

2006-09-19 Thread [EMAIL PROTECTED]

Okay okay guys, you made your point very clear.

Offcourse i also enjoy the benefits of convention over configuration.
and i never intented to "fight" that.  I just didn't realise that
people actually _need_ the id attribute.  (because i never used ajax,
dom,...)


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



Re: Html helper emits id attribute that i don't want

2006-09-18 Thread John Zimmerman
Related to how the htmlHelper outputs tags, I just read a blurb about the tags.ini file at http://www.avatarfinancial.com
/pages/cake/Here is the relevant infoCustomizing HTML generated by the Helper  
I needed to change the default  generated when I called $html->selectTag() to say something like "Please Select" rather than an empty space (default). I also wanted radio buttons to have labels so the user doesn't have to click exactly on the radio button itself but can instead click anywhere on the text associated with it. 
Create the file /app/config/tags.ini.php and add the following:; Tag template for a input type='radio' tag.
radio = "
; Tag template for an empty select option tag.
selectempty = "-- Please Select --"You can get a full list of available tags in /cake/config/tags.ini.php. I wouldn't recommend modifying that file, however, because you could lose your changes when you upgrade CakePHP.
So using this configuration file, you can change the convention and omit the id tag. 

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


Re: Html helper emits id attribute that i don't want

2006-09-18 Thread [EMAIL PROTECTED]

Chris that is so funny that people fight something that would make over
90% of their programming lives MUCH easier.  And for the 10% that you
have to figure out how to make it do it the CakePHP way it would still
be hard programming it the conventional way of configuration.  It is
just that by that time you are used to configuring everything so why
not configure the 10% as well.

CakePHP takes all that away and lets you JUST configure for the special
cases.  And isn't it nice that they made it with classes that you can
extend the functionality and wrap your own code around it?  How
awesome!!!


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



Re: Html helper emits id attribute that i don't want

2006-09-18 Thread John Zimmerman
On 9/18/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
and what's wrong with just not outputting an id attribute unlessspecified?(like is the usual approach for attributes, you have to specify them ifyou want them)Cake is not the "usual approach".  That is what makes it useful.
There is nothing stopping your from creating your form without
the use of the html helper to omit the id, or as suggested earlier in
the thread, wrapping the html helper in your custom helper.Not
including the id by default would cause people to have to write more
code/configuration in other situations that differ from your "special
case".
Special cases are treated as special cases for a reason.Please
do not take shots at the work being done (for free in fact).  Calling
it stupid does not help.  There is a lot of intelligent design work
that has been done with Cake and chances are if it works one way there
is a good reason for it.  Ask for an explanation or help with a solution instead.  If
there is a bug it will be taken care of promptly if you submit it to
trac. 

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


Re: Html helper emits id attribute that i don't want

2006-09-18 Thread Chris Hartjes

On 9/18/06, nate <[EMAIL PROTECTED]> wrote:
> Yes, you're right: the usual, dumb, wasteful approach to coding is that
> you have to explicitly specify every little thing you want your program
> to do.
>
> If that's how you want to write your code, you should not, I repeat
> *not* use CakePHP.  CakePHP does things like automatically generate DOM
> ID's for form inputs, because 99.9% of the time, that's exactly what I
> want it to do, so I'd rather it just do it, as opposed to me having to
> tell it to do it.
>
> That's called "convention over configuration".  If you *do not* want it
> to follow this default behavior (a.k.a. "convention"), you can
> *explicitly specify* something else.  Like, for example, a custom DOM
> ID.

During my presentation on Thursday at php|works I talked about
convention over configuration and I fielded a lot of questions from
people about why convention over configuration is good, and the
opinion of a lot of developers seemed to be, well, they wanted to
waste lots of time configuring everything and couldn't understand how
Cake (or Rails for that matter) would be any good if there weren't all
sorts of configuration files to tweak.

/me throws his hands up in the air

Me, I'm lazy and would rather have people smarter than me come up with
solutions that I can work with so I can get back to my life.


-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

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



Re: Html helper emits id attribute that i don't want

2006-09-18 Thread Sohei Okamoto
Sorry, I accidentally sent in the middle.But anyway, do some checking on attributes and preg_replace the output from the Html helper.Would that be a bad practice, or fine approach in Cake?Sohei

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


Re: Html helper emits id attribute that i don't want

2006-09-18 Thread Sohei Okamoto
[EMAIL PROTECTED] If it is really causing some problem or bothers you, but you still want to use Html helper,why not write a simple wrapper helper that strip out id attribute when you don't specify?
class HtmlwrapperHelper extends Helper {    var $helpers = Array("Html");        function input($fieldName, $htmlAttributes = null, $return = false)    {    }

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


Re: Html helper emits id attribute that i don't want

2006-09-18 Thread nate

[EMAIL PROTECTED] wrote:
> and what's wrong with just not outputting an id attribute unless
> specified?
> (like is the usual approach for attributes, you have to specify them if
> you want them)

Yes, you're right: the usual, dumb, wasteful approach to coding is that
you have to explicitly specify every little thing you want your program
to do.

If that's how you want to write your code, you should not, I repeat
*not* use CakePHP.  CakePHP does things like automatically generate DOM
ID's for form inputs, because 99.9% of the time, that's exactly what I
want it to do, so I'd rather it just do it, as opposed to me having to
tell it to do it.

That's called "convention over configuration".  If you *do not* want it
to follow this default behavior (a.k.a. "convention"), you can
*explicitly specify* something else.  Like, for example, a custom DOM
ID.


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



Re: Html helper emits id attribute that i don't want

2006-09-18 Thread [EMAIL PROTECTED]

It is auto outputting to aid in javascript and AJAX.  Which is a little
hiccup in this stage until 1.2 is releasing with the multiple form
elements for a single field and auto id.

For now you could modify the HTML helper yourself to not do the auto
id.  That is the best suggestion I can give.  Probably something more
elegant, but that does what you need until 1.2 is released.  I
personally love that the framework has taken the turn to closely start
integrating AJAX and Web2.0 tiny helpers like making ids nice and
pretty for us automatically.

I would like to see the Event.Selector code make its way into Cake 1.2
for even prettier degrading.  Also, which Event.Selector and the rules
it would be possible for an end user with problems to switch off AJAX
rather quickly since if the Event.Selector never starts up neither does
AJAX.  Isn't that nice!??!?!

http://encytemedia.com/event-selectors/


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



Re: Html helper emits id attribute that i don't want

2006-09-18 Thread [EMAIL PROTECTED]

and what's wrong with just not outputting an id attribute unless
specified?
(like is the usual approach for attributes, you have to specify them if
you want them)


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



Re: Html helper emits id attribute that i don't want

2006-09-18 Thread nate

Currently, the helpers do not support multiple form elements for a
single field.  We're working on a solution for this in Cake 1.2.


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



Re: Html helper emits id attribute that i don't want

2006-09-18 Thread [EMAIL PROTECTED]

i've looked in the sourcecode of htmlhelper. apparently if you didn't
set an id yourself, the helper will always automatically set the id

setting id to null will trigger the behaviour above, setting id to ''
sets id to '' so we don't want that either :'(

this really isn't fun, because i have several forms of the same type on
1 page. (eg many newsitems each with a reply-form) and thus, i have
many elements with the same id in my xhtml code.  if i don't want this,
i have to type the html code manually instead of using the html
helper.. that's a bit a stupid solution imo


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



Html helper emits id attribute that i don't want

2006-08-31 Thread [EMAIL PROTECTED]

a simple piece of php code like this:
echo $html->textarea('Reply/content', array('cols' => 60, 'rows' =>
2));

makes the html helper output something like:


and it's not only with textareas, also others (e.g. hidden fields)

how can avoid this? i don't want the id attribute.


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