Re: renderElement et son $params

2006-09-18 Thread John Zimmerman
On 9/17/06, bicephale [EMAIL PROTECTED] wrote: Je n'arrive pas à comprendre l'usage et l'utilisation du deuxièmeparamètre de la renderElement.Dans la documentation c'est unarray().J'envoie un array().Dans le fichier élément je peux lire le premier argument mais le second argument ($params)

Need a Genius for this one!

2006-09-18 Thread ameshkin
What I am trying to do, is... Find users in a database between two ages. $minage $maxage The birthdays of the users are in the database in this format 01-30-1980 Now this function takes a birthday in this format 1980-01-30 and returns the age function birthday ($birthday) {

Re: Need a Genius for this one!

2006-09-18 Thread Martin Schapendonk
On 9/18/06, ameshkin [EMAIL PROTECTED] wrote: But what I need to do, is somehow only show the results from the database where the birthday is in between two different ages. Then do it in the database, not in PHP. Assuming MySQL: year(current_date()) - year(date_of_birth) returns almost

Re: Need a Genius for this one!

2006-09-18 Thread John Zimmerman
But what I need to do, is somehow only show the results from the database where the birthday is in between two different ages.If you store your data in your database in a supported date format you can do everything with one mysql statement.

Re: display enum values in dropdown

2006-09-18 Thread [EMAIL PROTECTED]
Thanks to everyone who replied, I didn't check this thread all weekend. Nate: Thanks I moved the app model to model/app_model.php and updated it with the it works great now. I've also updated the code that retrieves the DB table name, cheers for that. my 2p's worth: I think Enums are great, a

Is there a way for $html- method return normal form names

2006-09-18 Thread [EMAIL PROTECTED]
Hi, I am trying to see if $html-selectTag or other other methods return a variable name that is not in the form of data[model][field] eg: input name='varname' value='somevalue'/ instead of input name='data[model][varname]' value='somevalue'/ In RoR, there is a input as well as inputTag to

Re: Security Exploit.

2006-09-18 Thread [EMAIL PROTECTED]
Yes it seems CakePHP has picked up a security expert as this is the second update I have seen for CakePHP security fix. Very nice to have someone interested in CakePHP enough to find them AND report them in a manner that the developers can resolve it. I love CakePHP!

Re: Need a Genius for this one!

2006-09-18 Thread Chris Partridge
Store the age in days/minutes/hours/seconds, and use a simple greater than less than query. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Postgres and Model-del() problem

2006-09-18 Thread Felipe Nascimento
Hi, I had an application that was using Mysql as the database. We switched to Postgres cause of client's request. Then we started to have some problems with some delete operations. Taking a look at the model_php5.php class, I saw that there is: if ($this-id $db-delete($this)) {

Re: Postgres and Model-del() problem

2006-09-18 Thread nate
Hmm, you might be right. Open a ticket at https://trac.cakephp.org and we'll take a look at it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: renderElement et son $params

2006-09-18 Thread nate
Slight correction for the above: the file path would be /app/views/elements/test_element.thtml --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: Is there a way for $html- method return normal form names

2006-09-18 Thread nate
In short, the answer is no, since this defeats half the purpose of using the method in the first place. Can I ask if there's a particular reason why you'd want to do that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Is there a way for $html- method return normal form names

2006-09-18 Thread olle
Makes me think about the ugly word performance: * At which point will my helper methods in $html weigh me down more than they help me? * When will I have to write Javascript manually, to lessen the load? I have no numbers on how much $html weighs in terms of processing overhead. I have

Re: PHP 4.4.2 and MySQL 4.1.16.

2006-09-18 Thread olle
Hey Sujith, http://www.php.net/ChangeLog-4.php#4.4.2 lists what's happened in the bugs list. Take a look at the things that are not listed as Fixed bug #. They aren't that many. Does any one of those impact your work? (Probably not, but check anyway, so you are sure.) Then, go grab latest

Re: PHP 4.4.2 and MySQL 4.1.16.

2006-09-18 Thread olle
Also, older MySQL's parted in 3 groups: 3.23, 4.0 and 4.1. Those are the partitions, where useful new stuff's been added in. The documentation link uses them in a group (all-versions-less-than-5): http://dev.mysql.com/doc/refman/4.1/en/ You've got 4.1. One of the very useful releases. That means

Re: renderElement et son $params

2006-09-18 Thread olle
Thinking of the Element as its own little View can make things easier to grasp. A View underneath the View, so to speak. Just like the Controller assigns a few variables to its friend the View, the View can assign a couple of choice variables to its buddy, little Element. Elements and

Re: Is there a way for $html- method return normal form names

2006-09-18 Thread nate
Hey Olle, I don't quite follow what you mean about JavaScript, but as far as performance overhead, I really don't think there is that much in the helpers, since all they're doing is outputting data, with no large loops or decision-making code, so I seriously doubt performance is an issue there.

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

How to use a suffix ?

2006-09-18 Thread Edu
Hi, I've seen that in CodeIgniter you can use a suffix for all your urls, say: web.site.com/controller.html or web.site.com/controller/action.html or web.site.com/controller/action/param.html Is it possible in Cake ? Regards --~--~-~--~~~---~--~~ You

Association Array Structure

2006-09-18 Thread Sonic Baker
Hi there, I'm joining a link table via bindModel to manipulate extra data in the link table. The php code below is called from the 'Quote' model. The associations before the bind are as follows: Quote belongsTo Customer Quote belongsTo User Quote HABTM StockedItem (link table

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

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

Re: How to use a suffix ?

2006-09-18 Thread [EMAIL PROTECTED]
You could use regex and Routes \ mod_rewrite to accomplish this. --~--~-~--~~~---~--~~ 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

Re: Is there a way for $html- method return normal form names

2006-09-18 Thread [EMAIL PROTECTED]
For stuff I collect in forms that doesn't ever make it's way into a database I just use Misc/formfield. This way I know that $this-data['Misc'] contains all those non saved form entered values. --~--~-~--~~~---~--~~ You received this message because you are

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.

Multiple File upload Flash

2006-09-18 Thread [EMAIL PROTECTED]
Okay I am integrating a Multiple File upload Flash applet into CakePHP. It is configurable to direct the uploaded files to a CakePHP url. Now, here is the line of code normally used by the script to get at the files uploaded. move_uploaded_file($_FILES['Filedata']['tmp_name'], $uploadfile) Is

Re: How to use a suffix ?

2006-09-18 Thread nate
Yes, it is possible in Cake. In fact, with Cake 1.2, these extensions have semantic meaning which you can use to build custom APIs in your application. Read more here: http://cake.insertdesignhere.com/posts/view/2 --~--~-~--~~~---~--~~ You received this

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

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,

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

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

Re: Multiple File upload Flash

2006-09-18 Thread Olivier Percebois-Garve
I use the following code to upload images. I madethe images file mandatory, so save() is invalidated if there is no images. I choose to store them in a directory named after the object's id. I dunno on what to extend the explanation, please tell. You'll find the file in

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

Future of the Internet

2006-09-18 Thread guitarclap
I am curious to see what other's think about this ... Where is the internet headed in the near future? It seems that recently there is a huge onslaught of community-based sites and digital music but it is definitely starting to fade ... why? You can thank News Corp, Time Warner and the other ad

Setting a page id for static pages?

2006-09-18 Thread Toby (The Balloon Guy) Parent
Hey, I know that I can specify a pageTitle and Layout in my view (and the PagesController doesn't upchuck it), but can I specify an ID attribute for an element outside my content_for_layout DIV? Specifically, I'd like to be able to add an ID to the page body from within the view itself.

Re: Multiple File upload Flash

2006-09-18 Thread [EMAIL PROTECTED]
Thanks for all that example code that helps to really reinforce things. So, what is the location of the file before you call the move_uploaded_file?? Is this an Apache setting? I guess I am just confused as to how it knows where to upload to on the server and then knows to retrieve it and then

Errorviews with Smarty View class ( 1.1 )

2006-09-18 Thread welja
Hello there, I am using the Smarty View class ( 1.1 ) and i really like it. But when i encounter a error, say a missing model, i get a completly different error : === No template file for view %s (expected %s), create it first' Fatal error: in

Re: Errorviews with Smarty View class ( 1.1 )

2006-09-18 Thread lloydhome
I use var $view = 'Smarty'; in app_controller.php. This doesn't do any better than your results though. I have had limited success copying cake/libs/view/templates/errors to app/views. I have not taken the time to figure it out yet (on the bottom of a long list). Hope That Helps, David

Re: Future of the Internet

2006-09-18 Thread [EMAIL PROTECTED]
Not really the place for this post, but I will answer first. I think the whole net neutrality thing is over hyped. I mean the basis of the whole argument is that the networks that maintain the cable lines that keep the internet together want reimbursement for their maintenance costs. And they

Great Trading Site!!

2006-09-18 Thread Drew L
Hi group,I have found a great site for buying, selling and trading. If you have ever used Ebay, this is a site you must check out.Not only can you buy sell stuff, but you can also barter trade stuff too! The site is http://www.mydrew.com Check it out! It's very cool!! P.S. Join my private

Re: Login renders blank page!

2006-09-18 Thread DJ Spark
I had the same problem here, with BOM bytes added to some files. Just to keep people aware, it ate my doctype declaration, thus, changing the way browsers interpreted the page, changing font sizes and all, paddings, etc. really weird. I had to open every file, since I didn't knew wich ones

Re: Re: Login renders blank page!

2006-09-18 Thread Samuel DeVore
http://www.xs4all.nl/~mechiel/projects/bomstrip/ has versions of the same thing in a ton of languages (not php thought ;) for utf8 you could do this probably if you have sed sed -i -s -e '1s/^\xef\xbb\xbf//' files On 9/18/06, DJ Spark [EMAIL PROTECTED] wrote: I had the same problem here,

Problem of using ereg_replace before saving data to database

2006-09-18 Thread andz.christian
Good day Guys n Gals. Lately I'm having a little bit problem of using ereg_replace before saving data to database. I have this category table and i want to replace white space with underscore. I have this fields on my database: Table_name: Category Fields: id, cat I've tried this code: if

Re: Problem of using ereg_replace before saving data to database

2006-09-18 Thread Larry E. Masters aka PhpNut
if (!empty($this-data)){ $this-data['Category']['cat'] = str_replace( , _, $this-data['Category']['cat']); $this-save($this-data);}ereg_replace is not a method of a class it is a php function and for what your doing it is not very good function to use anyway -- /*** @author Larry E. Masters* @var

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 option generated when I called $html-selectTag() to say