Re: Model with Dynamic Data Fields

2009-05-24 Thread oliver.pra...@googlemail.com

@DanielMedia

Why not just ad the field document_number [INT] to documents (with
maybe NUL as possible value).
Its just one more field, and your setup would require a join etc. (a
lot more db querying than needed)

With the fact being a Document only can have 1 number ... which would
sound sane to me -.-

documents
--
id
number
title
body
created
modified

document_attachments
---
id
document_id
attachment
created
modified

On May 23, 7:39 pm, DanielMedia  wrote:
> How about creating a multiple table setup? This would let you have
> many attachments, etc per document. Then all you would have to do is
> check the sub-tables for any data relating to the document's ID.
>
> documents
> --
> id
> title
> body
> created
> modified
>
> document_attachments
> ---
> id
> document_id
> attachment
> created
> modified
>
> document_numbers (Just an example based on your message above)
> -
> id
> document_id
> number
> created
> modified
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: api.cakephp.org still broken

2009-05-15 Thread oliver.pra...@googlemail.com

"http://api.cakephp.org/view_source/model/#line-1820";  Fails by me as
stated

Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.10) Gecko/
2009042316 Firefox/3.0.10

Oliver

On May 15, 12:27 pm, John Andersen  wrote:
> Hi Burzum
>
> Can you open the following location in FF 3.0.10 (which I have), as I
> do have the problem that the code disappears after that line!
>
> "http://api.cakephp.org/view_source/model/#line-1820";
>
> Then return and tell me what you got!
>    John
>
> On May 15, 12:18 pm, burzum  wrote:
>
> > I agree with AD7six, the tickets are bad, you don't even mention the
> > exact version number of the browsers. That's how i expect end users to
> > report a bug, not a developer. ;) I never had any problems with the
> > API documentation and i regularly update FF, my current version is
> > 3.0.10, it works also in Opera 9.64 and every version i used before.
> > Also the IE8 shipped with the Win7 RC does its job. I guess that you
> > can't see the source view is caused by a bad extension that filters or
> > manipulates something.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Run an action with out a view? Is it possible?

2009-04-15 Thread oliver.pra...@googlemail.com

Well what also works is just calling another action in the controller
at the last line ... e.g. $this->index(); etc. ... just make sure that
action is defined with a view.
Its not listed, but it works (it might also not be the cake way of
doing things)

On Apr 15, 12:45 am, "Mark (Germany)" 
wrote:
> oh, i just relized that this was your first point here^^ my mistake,
> overread that one
>
> On 15 Apr., 00:44, "Mark (Germany)" 
> wrote:
>
> > you forgot one:
>
> > $this->redirect()
>
> > as it always ends with exit() anyway
>
> > but the proper way without redirect would be:
>
> > $this->autoRender = false (anywhere inside that method in the
> > controller)
>
> > On 15 Apr., 00:08, Miles J  wrote:
>
> > > You can either do the following:
>
> > > - Have the delete action redirect once the logic is finished
> > > - Put $this->autoRender = false; at the top of the action
> > > - Put an exit() at the end of the action
>
> > > I personally would do the 1st or 2nd.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: MVC best practice advice needed

2009-03-23 Thread oliver.pra...@googlemail.com

I dont get why you even have that process of marking them (or how you
Mark them).
Just add a function that checks expiration and put it in the
beforeFilter ...

On Mar 23, 8:20 am, aman batra  wrote:
> I think it is a good practice to have a function in User model that
> should serve the required purpose than any other approach.
>
> On Mar 22, 2:22 pm, mattalexx  wrote:
>
> > Thank you.
>
> > On Mar 21, 11:51 pm, mscdex  wrote:
>
> > > Sorry, I half-misread your situation.
> > > In my opinion, I would probably add a deactivateExpired function in
> > > the User model that would do the necessary checking and saving.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: get method validation

2009-01-19 Thread oliver.pra...@googlemail.com

It should be noted that the GET Request is not designed for this ;-)

Hypertext Transfer Protocol (HTTP)
Request methods
GET
Requests a representation of the specified resource. Note that GET
should not be used for operations that cause side-effects, such as
using it for taking actions in web applications. One reason for this
is that GET may be used arbitrarily by robots or crawlers, which
should not need to consider the side effects that a request should
cause.

http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol

Or at least it should be seen as Best Pratice not to do so.

On Jan 19, 1:53 am, Webweave  wrote:
> Not sure I do, looks like you got a partial post. The validate
> 'numeric' for id, will validate the data for your id column as
> numeric.
>
> You don't even need that if the field is numeric as there wouldn't be
> allowed automatically.
>
> IF on the other hand you are asking how do I detect if a value was
> passed by GET or POST, that's an entirely different thing.
>
> POST data is passed in $this->data, GET data is passed in $this-
>
> >passedArgs or $this->params['url'].
>
> Seehttp://book.cakephp.org/view/55/The-Parameters-Attribute-params
>
> On Jan 18, 11:43 am, Delirium tremens  wrote:
>
> > Are you still not understanding the question?
>
> > On 18 jan, 15:38, Delirium tremens  wrote:
>
> > > How come nobody knows???
>
> > > On 18 jan, 13:30, Delirium tremens  wrote:
>
> > > > How to validate an id passed not by post, but by get? I do not have to
> > > > output an error message to hackers and crackers, do I? I tested using /
> > > > ^[0-9]{1,10}$/ as rule, nothing as message and passing an "a", but it
> > > > did not output an error message.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Call static function in bootstrap.php

2009-01-06 Thread oliver.pra...@googlemail.com

Might also be of interest to create a component that will handle this
for you, which you just need to add to your app_controller ...

On Jan 6, 11:52 am, cyberscorp  wrote:
> Thank you so much. I'll test these proposals and report back.
>
> On Jan 6, 9:16 am, gearvOsh  wrote:
>
> > It will work fine in your AppController beforeFilter().
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: HTML 4 specific CakePHP?

2008-12-28 Thread oliver.pra...@googlemail.com

@gearvOsh - Thanks for pointing this out. I finally came to reading it
all, and I now personally find that this issue is to be seen as a
weakness of the CakePHP framework. I sadly do not possess the
knowledge at the moment to think up a good performance friendly simple
solution to solve the problem, but the generation of not valid code
can not be seen as positive!

On Dec 27, 11:50 pm, gearvOsh  wrote:
> @Arthur Pemberton - Yeah but then if I set my Doctype as HTML 4 im
> riddled with markup errors which isnt good for me or the client.
>
> @Marcelo Andrade - Yeah thats what I was hoping was in the system, but
> I guess not. Ill see if I can extend it in some way.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: HTML 4 specific CakePHP?

2008-12-27 Thread oliver.pra...@googlemail.com

Well I personally would say that having the taglist in XHTML / XML is
of a more global advantage ...

Since if you want to spit out XML for other Documents eg. AJAX, RSS,
and so on you need tags that confirm to XML for it to even work. And
as far as I know RSS Readers etc. wont let you get away with faulty
markup as the browsers of today are ... read the first paragraphs and
it seems to me that he is once again complaining about just how bad
the support (following of clear standards) is by the browsers of
today, and the resulting facts that developers then have to fight
endless hours to get a some what good result in most browsers and OS.
Where more than often Developers have to break with the standards to
do so, which makes the standards more sloppy! (his main complaint is
to the sloppyness of the Developers to the standards)

So if you personally want it to be clean HTML 4 strict and the taglist
is stopping you write the helper as suggested, and give it to the
community if you want.

I should note that I am in no way affiliated with the CakePHP
projects,
and I speak solely for and represent only myself.

On Dec 27, 11:22 am, gearvOsh  wrote:
> No thats the thing, XHTML is not supported.
>
> You would need to put the content-type as application/xhtml+xml which
> in most cases breaks the layout and always breaks IE. Everyone usually
> puts it as text/html which then renders the browser as regular HTML
> and NOT XHTML. Im not telling you XHTML is bad, all im saying is that
> in the end the browser outputs any type of XHTML as HTML 4.
>
> In CakePHP you can "choose" the Doctypes of XHTML or HTML but the
> taglist is all XHTML, which then causes markup errors.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---