Re: Will CakePHP be able to survive as the Zend Framework matures?

2007-12-17 Thread Jon Miller

On Dec 17, 2007 3:30 PM, John David Anderson (_psychic_)
<[EMAIL PROTECTED]> wrote:

> I'm also tiring of people crying about the docs. Right now, we have
> 170 completely rewritten printed pages of documentation for code that
> isn't even BETA.

I've been struggling with Cake and yesterday found the tempdocs for
1.2 and it was like a lightbulb - they're brilliant, even if
incomplete. Unlike the dreadfully sparse manual or API, they give real
examples, just like the PHP.net docs.

Unfortunately the existence of the docs is a bit of a secret. Despite
having a big link to download 1.2 on the Cake homepage, there's no
obvious link to the new docs on the Cake homepage, just to the old
Cake manual. Sure it may not look as flashy, but if it has the info,
who cares? It makes me wonder how many newbies are struggling just
because they don't even know a secret new manual exists? In my view
hiding the good docs away could really hurt takeup now that most
people will be jumping straight to 1.2

J

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



chaging default model

2007-12-16 Thread Jon Miller

Does anyone know a way to change the default model used by a page? I
need to try to 'fool' Cake into believing it's running from a
different URL in part of the page.

 My example is for classified listings. On my listings index page,
underneath the main content from the listings controller, I have a
form allowing a user to edit their personal profile at any time - and
should show a pre-filled form, as you'd get by going to
/profiles/edit/4.

I tried using RequestAction in the following but it didn't work as all
that does is return the results of that page, it doesn't change the
"this->..." info being used:

model;
// returns "Listing"

$this->data = $this->requestAction('/profiles/edit/4');

echo $this->model;

// still echoes 'Listing', not 'Profile' as hoped.

?>

Can anyone tell me how to achieve this change, as RequestAction
clearly doesn't work. I need to change it so that the form helper
(using the value function in helper.php) will populate, as it takes
its criteria from $this->data[$this->model][$this->field] and if it's
using the wrong model to start with, it's not going to populate the
form correctly.

Thanks.

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



Re: newbie question - multiple functions in a page

2007-12-03 Thread Jon Miller

Thank you very much to everyone who replied to my question, your
advice and suggestions are much appreciated and very helpful.

Jon.

On Dec 3, 2007 3:16 PM, the_woodsman <[EMAIL PROTECTED]> wrote:
>
> Yes, with your tag cloud example, the core functionality for this
> might be best placed in the model.
>
> One reason to go through requestAction to call the model functionality
> is to reuse views.
> For example, perhaps your list of top ten posts in a specified
> category should appear the same way in loads of your pages: in that
> case, it might be handy to have a controller aciton that calls the ´fat
> ´ model, and returns the completed view.
>
> If, however, you need multiple views of the same data, then as you say
> it might be better just to access the fat model in various different
> controllers, and pass this onto different views.
>
>
>
>
>
> On Dec 3, 2:42 pm, SeanW <[EMAIL PROTECTED]> wrote:
> > On Dec 2, 7:56 pm, Adam Royle <[EMAIL PROTECTED]> wrote:
> >
> > > Using elements is what you want. Inside the elements you can use
> > > requestAction to get at any data you wish to use. You can return an
> > > array of data directly, or render a view. See tutorial here for an
> > > example (and also how to cache the result)
> >
> > That tutorial certainly explains requestAction and how cool it is, but
> > I'm left thinking "what happened to the skinny controller, fat model"
> > concept?  Why am I going to wind my way (again) through the Cake
> > framework only to get at a piece of data that the model should know
> > about anyway?
> >
> > For example, tag cloud.  We have a tag model, presumably linked to
> > posts or something.  Within the tag model I'd have a function,
> > tagCloud, that would return the tag cloud in an array, something like
> >
> > $ret[0]["tag"] = "cake";
> > $ret[0]["count"] = "5";
> > $ret[1]["tag"] = "php";
> > $ret[1]["count"] = "6";
> >
> > In the controller generating the post, we'd add "Tags" to the $uses
> > array, and in the action do a
> >
> > $this->set("tagcloud", $this->Tag->tagCloud());
> >
> > The tag cloud HTML would be encapsulated in an element so that anyone
> > could use it from the view, $this->renderElement("tagcloud",
> > array("data" => $tagcloud))
> >
> > None of this precludes using requestAction...  In fact the reason I
> > arrived at this conclusion is by starting off there, realizing the job
> > of collecting the tag cloud data belongs in the model, realized we
> > need an element anyway, so why bother using requestAction when I can
> > just set() it in the controller and still be blissfully unaware about
> > how the data is constructed?
> >
> > BTW this extends to the other cases the OP mentioned, ie $this->Books-
> >
> > >getReadingList(5), etc.
> >
> > The post that opened my eyes to the fat model concept:
> >
> > http://weblog.jamisbuck.org/2006/10/18/skinny-controller-fat-model
> >
> > It's written for Ruby on Rails, but it's easy enough to translate to
> > PHP.
> >
> > Sean
> >
>

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



Re: newbie question - multiple functions in a page

2007-12-02 Thread Jon Miller

Hi,
Thanks for your help. I could use Ajax, you're right, but I'm sure
there must be a simpler way - I just want a single homepage to show a
list of my music, a list of my articles, and a list of my users, all
of which come from different DB tables and have different models and
controllers.

Actually I've just found a much better page to frame my question
around... see this one:
http://bakery.cakephp.org/

Here you have a list of recent articles, a tag cloud of popular terms,
a list of recent news items etc.

I've never seen a tutorial on how to build a page like this in Cake.
The most you get might be a page telling you how to make a page that
lists one of those elements, but not one combining them.

If I was to scaffold each of these I could go to
bakery.cakephp.org/articles, bakery.cakephp.org/news,
bakery.cakephp.org/tags etc. and get your CRUD for each of the
elements, which would give me lots of seperate views, but I've no idea
how to combine the individual views for these elements into one
homepage, as most sites on the web do, including lots that claim they
are built with Cake.

Jon.

On Dec 2, 2007 10:55 PM, ldb <[EMAIL PROTECTED]> wrote:
>
> G'day
>
> Would the Ajax helper be what you are looking for, or have I
> misunderstood? I did visit your link..;-)
>
>
>
>
> On Dec 2, 5:15 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> > Hi everyone,
> > Apologies if this is a silly question, I'm brand new to Cake (and
> > frameworks in general!).
> >
> > Every tutorial under the sun shows you how to make a view with another
> > page for editing, another page for adding etc., but nobody seems to be
> > able to show an example of an everyday web page, with lots of
> > different dynamic systems built into a single page.
> >
> > I'm thinking of how you'd extend a site wirh a basic layout that looks
> > like this one:http://www.snook.ca/archives/cakephp
> >
> > Presumably all the ads, book lists and things come from included
> > elements - I've got that far, but how to make these dynamic? What if I
> > wanted the left nav to be a list of users, with Edit and Delete links
> > next to their names, while the main content panel gives me my editable
> > list of articles. And what if at the bottom of the page I wanted to
> > display my CD list?
> >
> > I can build a full class for music, articles and users, and they can
> > work fine seperately (one view for listing my music, in the music
> > folder, another view for editing my articles, in the articles folder
> > etc.), but how does one combine them into a single view? I just can't
> > see what you're supposed to do to combine lots of interactions into a
> > single page, and where you're supposed to put view files with multiple
> > functionality. If someone can explain, or point me to a tutorial, I'd
> > be most grateful!
> >
> > Jon.
> >
>

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