Re: Scaffolding template for controllers ... ??

2009-02-15 Thread p...@otaqui.com

I haven't done, or tested, this - but a quick peak inside the "cake/"
directory shows the file:

cake/console/libs/tasks/controller.php

which is what I think you will want to customise.

Messing with Cake's core files is usually best avoided if at all
possible.  I would guess that you should try *copying* this file into
"app/vendors/shells/tasks" but I really don't knowif that is exactly
right, or if having the file anywhere else is even possible.

All else failing, just make sure that you have a pristine back up of
the original "controller.php" task file before you start editing it in
place.

Best,

Pete

On Feb 15, 12:32 am, DrGaston  wrote:
> The CakePHP manual already explains how to change the scaffolding
> template for the views, but how can you change the way controller
> functions are scaffolded? I would need to change some of the logic
> there.
>
> Thanks.
--~--~-~--~~~---~--~~
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: Rendering a view without layout

2009-02-14 Thread p...@otaqui.com


Does anyone know offhand if the ajax layout alters the Content-Type
header?


On Feb 14, 6:53 pm, "dr. Hannibal Lecter"  wrote:
> Use the ajax layout in controller, $this->layout = 'ajax', that should
> do it.
>
> On Feb 14, 4:21 pm, pavan  wrote:
>
> > Hi Friends,
>
> > I have problem in rendering a view bascially which belongs to
> > different controller without layout.This is my following code
>
> > pages/index.ctp:
>
> > element('note'); ?>
> > render('/learning/index',null,null); ?>
>
> > i am using cakephp1.2
>
> > Please help me to fix this problem.
--~--~-~--~~~---~--~~
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: How many elements are really too many??

2009-02-07 Thread p...@otaqui.com

Hi,

I haven't done any very heavy element rendering myself, but I know
that element output can be cached if suitable for your application,
which would help you out a lot.

Pete

On Feb 7, 9:36 pm, Abhimanyu Grover  wrote:
> Also, I would like to add, there is no requestAction() used in these
> helpers. They just make use of Html and Form helper to output blocks
> to the CMS.
>
> On Feb 8, 2:31 am, Abhimanyu Grover  wrote:
>
> > Hi there again,
>
> > As our application grows more and more, no. of elements used per page
> > are increasing day by day. Right now we're at avg. 5 elements per
> > page. What do you guys think of it?
>
> > Elements, for sure would slow down the app a bit, but what are your
> > views on it? How many elements are too many?
>
> > Thanks for reading!
--~--~-~--~~~---~--~~
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: How to perform Add cart using bake

2009-02-06 Thread p...@otaqui.com

Hi Maulik,

that's a really huge question and I don't think you're going to get a
very good response.

My advice would be to try and read a lot about the basics of building
with cake, to try and build your shopping cart and to come back if you
have a specific question about any smaller problem you are having.

Don't forget to search the web and this group for answers before
posting!

Good luck,

Pete

On Feb 6, 6:33 am, Maulik  wrote:
> hello
> i m new in cakephp
> i m developing shopping cart
> how do i perform add to cart process, each steps for it.
> what i have to perform.
> do i have to create a new ctp for cart process.
> or frm any other way i complete it.
> or how do i do it using bake.
> plz let me know each steps for add to cart & updataing the price & qty
> etc.
--~--~-~--~~~---~--~~
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: Calling select queries within find()

2009-02-05 Thread p...@otaqui.com

I've posted a little how-to on implementing your custom data source
driver here:

http://otaqui.com/blog/402/custom-model-and-field-result-set-in-cakephp/

Thanks for the code!

On Feb 5, 12:17 pm, grigri  wrote:
> Sure thing.
>
> This is a copy of my overridden datasource for a project I did last
> month:http://bin.cakephp.org/view/1781729779
>
> It: handles the above thingy, performs a backtrace on queries so you
> can tell which file/function generated which query (neat for
> debugging) and syntax-highlights it. Each of these functions is in a
> separate... function. So if you only want one of them then delete the
> other functions.
>
> Has anyone else overridden the datasource for other useful purposes?
>
> hth
> grigri
>
> On Feb 4, 9:56 pm, Miles J  wrote:
>
> > Awesome, can you give an example/snippet of overriding the datasource
> > to do just that?
>
>
--~--~-~--~~~---~--~~
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: __mergeHasMany causing EXTREMELY slow data retrieval

2009-01-31 Thread p...@otaqui.com

Hi Dan,

this isn't a major flaw in CakePHP, it's the price you pay for the
ease of development.  Fortunately Cake allows you very easy access to
SQL itself if you need it - although you may end up having to do some
more "old school" management of your result set rather than having
cake turn everything into handy arrays for you.

It's also possible that you'll be able to get the data you want by
turning your find() call around.  I think you might look at this as a
call on your OrderLineItem model rather than Order, so inside the
OrderLineItems Controller you could do this:

$this->OrderLineItem->recursive = -1;
$orderlineitems = $this->OrderLineItem->find('all',array
('contain'=>array('Order')));
$this->set( compact('orderlineitems') );

(or inside the model by skipping the "->OrderLineItem" bit)

That will be fast, and I think won't need any "merging".


You said you had simplifed your example so it might not work in which
case you really will have to do something like:

$this->Order->execute(' some kind of SQL in here ')

and manually manage the result set.



Hope that helps

Pete




On Jan 30, 4:47 pm, Dan  wrote:
> No one has feedback on this? It seems like a MAJOR issue if you can't
> load more than a few thousand rows from "has many" relationship tables.
--~--~-~--~~~---~--~~
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: twitter users?

2009-01-27 Thread p...@otaqui.com

I've found Hastags.org to be quite unreliable (going offline
regularly, missing tagged posts, that kind of thing).

Another option is just to search twitter itself:

http://search.twitter.com/search?q=%23cakephp



On Jan 27, 8:23 am, RichardAtHome  wrote:
> There's also a #cakephp hashtag:
>
> http://hashtags.org/search?query=cakephp&submit=Search
>
> On Jan 26, 5:42 pm, gerhardsletten  wrote:
>
> >http://www.twitter.com/gerhardsletten
>
> > A salty mix of cake, ez publish, triathlon, food and live. Code stuff
> > mostly in english, but some norwegian now and than
>
> > On Jan 25, 5:33 pm, Marcelo Andrade  wrote:
>
> > >http://twitter.com/mfandrade
>
> > > Mainly in portuguese.
>
> > > --
> > > MARCELO DE F. ANDRADE (aka "eleKtron")
> > > Belem, PA, Amazonia, Brazil
> > > Linux User #221105
>
> > > [...@pará ~]# linkshttp://pa.slackwarebrasil.org/
>
> > > For Libby's backstory be told on 
> > > Losthttp://www.petitiononline.com/libby423/petition.html
>
>
--~--~-~--~~~---~--~~
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: Which editor for Mac OS X?

2009-01-24 Thread p...@otaqui.com

Forgot to add:

Basically outside of Komodo and various java-based apps, I don't think
there is a php-friendly *free* IDE for OS X.  Would love to be proved
wrong!

Pete

On Jan 24, 4:50 pm, "p...@otaqui.com"  wrote:
> This discussion is covering both editors (like TextMate) to IDEs (like
> Eclipse, Komodo and emacs).
>
> Nothing wrong with that of course, but the two kinds of software tend
> to have quite different goals.
>
> If what you really want a project-wide features like code
> introspection, debugging and completion, then an IDE is the way to
> go.  As rogwei mentioned, the project management side of the more
> heavywight IDEs like eclipse is painful if you're no used to it - and
> by the same token, everything can feel bare naked in TextMate if you
> are used to an IDE.
>
> There is one app that's somewhere between an Editor and an IDE that
> hasn't been mentioned, it's not free, called skEdit:
>
> http://skti.org/skedit/
>
> skEdit is pure os x software - so it doesn't suffer from the java-ness
> of eclipse, and it looks a bit like Textmate too, but the project
> management is all baked in and doesn't need any plugins (same with SVN
> support).  I don't think it's as awesome as TextMate, but if TM leaves
> you feeling like you're wearing the emporer's new clothes it might be
> the one for you.  I must admit I wasn't overly impressed with it's
> Code Completion in a CakePHP project, since it doesn't seem to inspect
> your classes, but for that level you'd really have to go for eclipse.
>
> By the way - on an eclipse tip, if you have a fairly serious chunk of
> cash lying around, you might try Zend Studio, which is built on top of
> it.  Studio's PHP debugging is, in my experience, peerless; not only
> can you set breakpoints and step through your code you can even step
> *backward*.
>
> http://www.zend.com/products/studio/
>
> If you really REALLY want free, then have a look at TextWrangler, from
> the BBEdit folks:
>
> http://www.barebones.com/products/TextWrangler/
>
> And also Smultron from Tuppis
>
> http://tuppis.com/smultron/
>
> If you want to try emacs but don't like Terminal.app, try Xemacs:
>
> http://www.xemacs.org/
>
> Or, if you're more a Vi kind of guy, there is also MacVim:
>
> http://code.google.com/p/macvim/
>
> (there's an older macvim.org site, but that isn't maintained any more)
>
> Phew!  That was more than I had planned on writing :)
>
> Pete
>
> On Jan 24, 1:53 pm, hellfish  wrote:
>
> > Coda really rocks, I've been using the demo version and I'm seriously
> > thinking about purchasing the complete version.
>
> > On Jan 24, 12:31 pm, rogwei  wrote:
>
> > > Emacs is the bomb. Free, cross-platform, extendable, and butters your
> > > toast. I have been pleasantly surprised to find that several other Mac
> > > applications respond to the same cursor movement keyboard shortcuts.
> > > It's like...a
>
> > > I too tried Eclipse and NetBeans and found them seriously flawed (on
> > > the Mac platform at least) and I am using state of the art quad core
> > > intel hardware. My beefs were not so much with performance, duh, but
> > > with the heavy handed project paradigm in Eclipse and the bugginess of
> > > NetBeans code completion. Both were show stoppers for me.
>
> > > Emacs is included in Leopard through the Terminal application, but you
> > > might want to set up MacPorts and install the X version. There is a
> > > PHP mode for Emacs, also available through MacPorts, that provides
> > > some useful features for PHP development.
>
> > > On Jan 23, 6:01 am, leo  wrote:
>
> > > > Having spent months trying to find an adequate editor for Windows, I
> > > > eventually settled on Komodo. Now I'm working on a Mac and Komodo is
> > > > available, but version 5 is so slow it's unusable. I reverted to v4,
> > > > but while it is a little quicker it is also a little unstable. It is
> > > > still slow enough  to be irritating - 2 seconds to switch tabs;
> > > > sometimes it doesn't load the plugins, sometimes it will not maximise
> > > > properly.
>
> > > > Okay, I'm not using a cutting edge Intel Mac, I'm on a G4 / Leopard,
> > > > but it's still a reasonably powerful machine (it'll run Photoshop and
> > > > Illustrator simultaneously without grinding to a halt).
>
> > > > Can anybody suggest a non-java based editor (I do not like Eclipse or
> &

Re: Which editor for Mac OS X?

2009-01-24 Thread p...@otaqui.com

This discussion is covering both editors (like TextMate) to IDEs (like
Eclipse, Komodo and emacs).

Nothing wrong with that of course, but the two kinds of software tend
to have quite different goals.

If what you really want a project-wide features like code
introspection, debugging and completion, then an IDE is the way to
go.  As rogwei mentioned, the project management side of the more
heavywight IDEs like eclipse is painful if you're no used to it - and
by the same token, everything can feel bare naked in TextMate if you
are used to an IDE.

There is one app that's somewhere between an Editor and an IDE that
hasn't been mentioned, it's not free, called skEdit:

http://skti.org/skedit/

skEdit is pure os x software - so it doesn't suffer from the java-ness
of eclipse, and it looks a bit like Textmate too, but the project
management is all baked in and doesn't need any plugins (same with SVN
support).  I don't think it's as awesome as TextMate, but if TM leaves
you feeling like you're wearing the emporer's new clothes it might be
the one for you.  I must admit I wasn't overly impressed with it's
Code Completion in a CakePHP project, since it doesn't seem to inspect
your classes, but for that level you'd really have to go for eclipse.

By the way - on an eclipse tip, if you have a fairly serious chunk of
cash lying around, you might try Zend Studio, which is built on top of
it.  Studio's PHP debugging is, in my experience, peerless; not only
can you set breakpoints and step through your code you can even step
*backward*.

http://www.zend.com/products/studio/


If you really REALLY want free, then have a look at TextWrangler, from
the BBEdit folks:

http://www.barebones.com/products/TextWrangler/

And also Smultron from Tuppis

http://tuppis.com/smultron/



If you want to try emacs but don't like Terminal.app, try Xemacs:

http://www.xemacs.org/


Or, if you're more a Vi kind of guy, there is also MacVim:

http://code.google.com/p/macvim/

(there's an older macvim.org site, but that isn't maintained any more)



Phew!  That was more than I had planned on writing :)

Pete


On Jan 24, 1:53 pm, hellfish  wrote:
> Coda really rocks, I've been using the demo version and I'm seriously
> thinking about purchasing the complete version.
>
> On Jan 24, 12:31 pm, rogwei  wrote:
>
> > Emacs is the bomb. Free, cross-platform, extendable, and butters your
> > toast. I have been pleasantly surprised to find that several other Mac
> > applications respond to the same cursor movement keyboard shortcuts.
> > It's like...a
>
> > I too tried Eclipse and NetBeans and found them seriously flawed (on
> > the Mac platform at least) and I am using state of the art quad core
> > intel hardware. My beefs were not so much with performance, duh, but
> > with the heavy handed project paradigm in Eclipse and the bugginess of
> > NetBeans code completion. Both were show stoppers for me.
>
> > Emacs is included in Leopard through the Terminal application, but you
> > might want to set up MacPorts and install the X version. There is a
> > PHP mode for Emacs, also available through MacPorts, that provides
> > some useful features for PHP development.
>
> > On Jan 23, 6:01 am, leo  wrote:
>
> > > Having spent months trying to find an adequate editor for Windows, I
> > > eventually settled on Komodo. Now I'm working on a Mac and Komodo is
> > > available, but version 5 is so slow it's unusable. I reverted to v4,
> > > but while it is a little quicker it is also a little unstable. It is
> > > still slow enough  to be irritating - 2 seconds to switch tabs;
> > > sometimes it doesn't load the plugins, sometimes it will not maximise
> > > properly.
>
> > > Okay, I'm not using a cutting edge Intel Mac, I'm on a G4 / Leopard,
> > > but it's still a reasonably powerful machine (it'll run Photoshop and
> > > Illustrator simultaneously without grinding to a halt).
>
> > > Can anybody suggest a non-java based editor (I do not like Eclipse or
> > > NetBeans or anything Java come to that)? I've tried Xcode, but it
> > > seems really clunky and not at all geared to PHP. It needs to have
> > > project handling like Komodo, code intelligence and above all, it must
> > > be free.
>
> > > Maybe a Macport of Bluefish - anybody tried that?
>
>
--~--~-~--~~~---~--~~
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: Help with website architecture...

2009-01-24 Thread p...@otaqui.com

Hi Jesse,

If you look at the .htaccess file in the webroot you'll notice that
the rules check the existence of a file before rerouting to the
index.php file and letting it manage things.

I think you could try applying the same kind of thing in the root
directory's htaccess ... that is: only use cake if the file doesn't
already exist.

I'm not sure what extra overhead this would have, so serious load
testing and keeping an eye on server would be a must here.  Probably
your first thought - specifically routing to cake with a fixed set of
url's, or at least fixed rules based on controller names - would be
less trouble for your server to handle.




On Jan 23, 9:01 pm, Jesse  wrote:
> I need some advice on some architecture for a website.
>
> I am in charge of running a pretty significantly high traffic sites (3
> sites that get around 400+ req. per sec at peek hours). The site was
> started a long time and and the architecture was not maintained very
> well throughout the years. There is no framework in place as of now.
> It's all static.
>
> We have decided to try out using a cake framework for a couple project
> to see if this will provide the speed we are looking for.
>
> The problem develops when trying to "integrate" cake with the current
> website. The website as of now is static.http://www.example.com/story
> - There is a folder "story" in the root of htdocs. There is a lot of
> dynamic database calls with parameters, but the entire site (thousands
> and thousands of pages) is developed this way.
>
> I would like to start integrating cake in, but I don't see a way of
> doing this without causing a problem with the current site
> architecture.
>
> All of our servers are in house so having a "custom" install of cake
> is not a big deal. Basically I'm looking for a way to have 
> http:/www.example.com/onsaleuse cake, without touching the root, or other
> directories (http://www.example.com/story) that are not written in
> cake.
>
> One idea I had was creating a new user and setting up a subdomain
> (http://cake.example.com). Then using .htaccess to rewrite 
> (http://www.example.com/onsale) to (http://cake.example.com/onsale). If this
> was all done through mod_rewrite I could keep the (http://
> cake.example.com) url's private... but I'm not sure.
>
> Any other suggestions?
--~--~-~--~~~---~--~~
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: twitter users?

2009-01-24 Thread p...@otaqui.com

http://twitter.com/pete_otaqui

On Jan 23, 10:03 pm, Miles J  wrote:
> I thought it would be good idea to follow some other CakePHP users on
> Twitter.
> So if you have one and are willing to put it up, heres mine:
>
> http://twitter.com/gearvosh
--~--~-~--~~~---~--~~
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: Can i compile the PHP webpage instead of leaving the source code on the server?

2009-01-05 Thread p...@otaqui.com

Hi Aus,

sorry if this is obvious, but it's worth noting that your source code
on the server will not be viewable by any casual user.  Someone would
have to be have either FTP or shell access on the server to be able to
get the source code.

Best,

Pete

On Jan 5, 11:10 am, Aus  wrote:
> I've designed a PHP webpage, but i don't want to keep it on the server
> as a source code,
> is there any way to compile it?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---