Re: Model find() to return object; instead of array (?)

2008-04-02 Thread Grant Cox

I'm not sure of any method - but why do you think that all your rows
as arrays will use up more memory than the same amount of data wrapped
in objects?  Is it just a pass by reference vs pass by copy issue?

At the heart of it the dbo_source.php file takes the data from the
database query as an array.  You could then build some object up out
of this - but I'm not sure that it will really help any memory issues.


On Apr 3, 3:41 pm, "R. Rajesh Jeba Anbiah"
<[EMAIL PROTECTED]> wrote:
>   It's very crucial to have the find() or similar returns DB
> object instead of full array--as for any data export module, we cannot
> dump the whole array which would result in memory error. IIRC, someone
> provided how to do that in CakePHP, but I lost the link; but, when I
> google, the closest I get now 
> ishttp://jimmyzimmerman.com/blog/2007/05/why-i-prefer-ruby-on-rails-ove...
> Is there anyone who bookmarked such previous hack or can provide any
> hint? TIA
>
> --
>   
> Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Model find() to return object; instead of array (?)

2008-04-02 Thread R. Rajesh Jeba Anbiah

  It's very crucial to have the find() or similar returns DB
object instead of full array--as for any data export module, we cannot
dump the whole array which would result in memory error. IIRC, someone
provided how to do that in CakePHP, but I lost the link; but, when I
google, the closest I get now is
http://jimmyzimmerman.com/blog/2007/05/why-i-prefer-ruby-on-rails-over-cakephp.html
Is there anyone who bookmarked such previous hack or can provide any
hint? TIA

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/
--~--~-~--~~~---~--~~
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: Array of named arguments(?) - pagination related

2008-04-02 Thread R. Rajesh Jeba Anbiah

On Apr 3, 4:02 am, Lisa <[EMAIL PROTECTED]> wrote:
> maybe you mean like this?
>
> http://groups.google.com/group/cake-php/browse_thread/thread/675b44ae...

It's talking about retaining search param which is already here
http://groups.google.com/group/cake-php/web/frequent-discussions?version=122

   But, what I'm talking about is the situation where you have two
pagination on a page (it's possible by passing Model param); but when
clicking on the pagination links on any block, it's resetting the
other---as there is only one "page" namedArg; we actually need to
retain/associate this "page" namedArg for different paging blocks.


--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/
--~--~-~--~~~---~--~~
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: Query Question

2008-04-02 Thread Dan

I figured it out

$this->Game->bindModel(
  array('hasOne' => array(
'CategoriesGame' => array(
'className' => 'CategoriesGame'
)
)), false
);
$data = $this->paginate('Game', "CategoriesGame.category_id =
'puzzle'");

--~--~-~--~~~---~--~~
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: Application Index Controller

2008-04-02 Thread jonknee

Not a problem, it just needs a route set up in config/routes.php,
something like:

Router::connect('/', array('controller'=>'home', 'action'=>'index'));

That's for 1.2, the syntax is a bit different for previous versions
but the idea is the same. Route '/' to a controller and action.
--~--~-~--~~~---~--~~
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: UTF8 monthname in date-picker

2008-04-02 Thread Elmo

Is this fixed? I am running into the same issue from the
1.2.x.x_27.03.2008 I don't want to have to upgrade if I don't have to
(and introduce other bugs).

-E

On Mar 27, 10:38 am, Molt <[EMAIL PROTECTED]> wrote:

> Anyway, now i tried the nightly of 2008-03-25 and it does not like
> this way :(
> Instead of the german März (for march) i get simply nothing, an empty
> string.
>
> Does anybody know, whats up with this? I know this is a nightly, but
> i'd like to know if i made some mistake or i just have to wait for
> some codechanges :)
>
> thanks a lot in advance!
--~--~-~--~~~---~--~~
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: Retrieve all articles from more then one categories?

2008-04-02 Thread Dan

I think you need to use findAll not findBy

$this->set('articles', $this->Category->findAll('Category',
"Category.slug IN 'tutorials', 'photoshop'"));

not sure of the exact syntax so the above probably doesn't work but I
believe findAll is what you're looking for.

--~--~-~--~~~---~--~~
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: Login redirect issue ...

2008-04-02 Thread John R

So strange .. when I hit login FROM the subdomain, this is my
$_SESSION:

Array ( [Config] => Array ( [userAgent] => XXX [time] =>
1207229748 [rand] => X [timeout] => 10 ) [Auth] => Array
( [redirect] => http://sample.domain.com/contest ) )

The [redirect] is fine ..

When I do a successful login and it goes to 
http://www.domain.com/http:/sample.domain.com/
, the $_SESSION does not have a [redirect] ...

GRR?! How is it losing a forward slash along the way? lol
--~--~-~--~~~---~--~~
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: Rendering a View manually

2008-04-02 Thread Adam Royle

Hi Matt,

A possible solution would be to use wget to do the bulk of the work
for you. I did this with cake not too long ago and it worked really
well. With the recursive option it can automatically download linked
pages, images, css, javascript, etc, and replace the links with
relative links.

Then just run a zip command over the generated files and you're
laughing.

As long as you can use exec() on your server, the above will only take
a few lines of code.

Cheers,
Adam

On Apr 3, 8:24 am, Matt <[EMAIL PROTECTED]> wrote:
> Hello group,
>
> One of my Controller methods generates a zip file containing parts of
> my application which can be viewed in a standalone mode. One of its
> key functions will be to render some of the app's pages to .html files
> and add them to the zip.
>
> I'm fairly new to Cake and not au fait with how it's internals work. I
> see that the function View::render() exists and returns a string, but
> I can't figure out how to get from my Controller or Model to it's
> corresponding View.
>
> How can I get hold of a View object and call that render() function?
>
> Many thanks,
> Matt.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



DarkAuth and HABTM Relationship

2008-04-02 Thread lirc201

Just when I thought I have CakePHP figured out, I get a curve ball.
I'm trying to integrate DarkAuth into my site.

I have a users table, group table both with "id" columns and then a
join table (HABTM) with group_id, and user_id columns.  I don't
understand why Cake believes I need to have a User.group_id column.

Query: SELECT `User`.`id`, `User`.`username`, `User`.`passwd`,
`User`.`firstname`, `User`.`lastname`, `User`.`email`,
`User`.`last_visit`, `User`.`confirmation`, `User`.`active`,
`User`.`created`, `User`.`modified`, `Group`.`id`, `Group`.`name`,
`Group`.`level`, `Group`.`redirect`, `Group`.`perm_type`,
`Group`.`created`, `Group`.`modified` FROM `users` AS `User` LEFT JOIN
`groups` AS `Group` ON (`User`.`group_id` = `Group`.`id`) WHERE
`user`.`email` = 'emmar0se' AND `user`.`passwd` =
'afb2d1ffbde69e9adce0adb33b092271' AND `user`.`active` = 1 LIMIT 1
Warning: SQL Error: 1054: Unknown column 'User.group_id' in 'on
clause' in D:\My Documents\websites\cake\cake\libs\model\datasources
\dbo_source.php on line 440

In dark_auth.php the HABTM variable is set to true
var $HABTM = true; //set to false if you don use a HABTM group
relationship.

Brian

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



Application Index Controller

2008-04-02 Thread Antonio Labriola

Hi all,

   This might sound a bit stupid, but im new to cake, and I could not
find an answer to this question in any of the documents.  I have cake
in my root directory of my app, i have configured the db info and cake
told me everything was all set.  It told me to edit that main view, i
could edit some view/layout files.  However, is there a way to either
create or modify an existing controller to perform some action when
the user enters my site.  So once they enter www.mysite.com/, i would
want that default controller to initialize some data and then send the
user to a home page.  I know cake loads the index.php file which
defines a bunch of constants and sets up the app, but what is the best
solution for me here?  Im sorry if i am not explaining it well, but
any help will be appreciated.

Thanks

  Tony

--~--~-~--~~~---~--~~
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: Rendering a View manually

2008-04-02 Thread Joel

Object::requestAction() is, in most cases, evil.  99% of the time when
you think that you need requestAction, what you really need is to take
a step back and look at what it is you are trying to accomplish.

Reasons for being evil:
1) Every time you call requestAction, a new Dispatcher cycle is
started in addition to the originating request.  If you have several
calls to requestAction, you're gobbling up additional resources.  If
you have dozens (hundreds?) of pages to zip, then you'll most likely
max out on your memory usage, or at least make every thing turn to
molasses.

2) The way most people use requestAction creates a MVC anti-pattern.
Doubly evil.

-Joel.

On Apr 2, 8:14 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> It sounds to me like what you're after is Object::requestAction. This
> will allow you to effectively grab a page that the site might produce
> and put it into a variable, which gives you the ability to collect
> those pages into your zip file.
>
> Simonhttp://www.simonellistonball.com/
--~--~-~--~~~---~--~~
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: document root in shared hosting

2008-04-02 Thread Raistlin Majere

I am hosting with StoneRocket.net

On 30 mar, 06:20, Stephen Orr <[EMAIL PROTECTED]> wrote:
> Which, so long as your RewriteBase directive takes the form of:
>
> RewriteBase /directory
>
> Will be exactly right. If this isn't working for you, I suggest
> contacting your hosting company for further support. Cake has worked
> successfully for me every time, deploying onto many different servers
> and hosting environments, in most cases without having to change a
> single line of core code.
>
> Out of interest, who are you hosting with?
>
> On Mar 30, 2:47 am, Raistlin Majere <[EMAIL PROTECTED]> wrote:
>
> > The log file says:
>
> > RewriteBase takes one argument, the base URL of the per-directory
> > context
>
> > On Mar 29, 1:03 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>
> > > Then go and read the server error log as the message suggests.
>
> > > On Sat, Mar 29, 2008 at 12:04 PM, Raistlin Majere <[EMAIL PROTECTED]> 
> > > wrote:
>
> > > >  I got:
>
> > > >  "500 Internal Server Error"
>
> > > >  "More information about this error may be available in the server
> > > >  error log."
>
> > > >  "Additionally, a 500 Internal Server Error error was encountered while
> > > >  trying to use an ErrorDocument to handle the request."
>
> > > >  On Mar 28, 7:45 pm, Галкин Николай <[EMAIL PROTECTED]> wrote:
> > > >  > I think yes! Create the file .htaccess in the root directory and 
> > > > write
> > > >  > string:
> > > >  > RewriteBase /new_root_folder
> > > >  > But in your hosting must be enabled module mod_rewrite.
> > > >  > Sorry for my English. I am from Russian.
>
> > > >  > > Can I change document root in shared hosting?
--~--~-~--~~~---~--~~
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: Rendering a View manually

2008-04-02 Thread [EMAIL PROTECTED]

It sounds to me like what you're after is Object::requestAction. This
will allow you to effectively grab a page that the site might produce
and put it into a variable, which gives you the ability to collect
those pages into your zip file.

Simon
http://www.simonellistonball.com/
--~--~-~--~~~---~--~~
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: Rendering a View manually

2008-04-02 Thread Joel

In your Controller:
$view =& ClassRegistry::getObject('view');

>From this you can call $view->render();

Matt wrote:
> Hello group,
>
> One of my Controller methods generates a zip file containing parts of
> my application which can be viewed in a standalone mode. One of its
> key functions will be to render some of the app's pages to .html files
> and add them to the zip.
>
> I'm fairly new to Cake and not au fait with how it's internals work. I
> see that the function View::render() exists and returns a string, but
> I can't figure out how to get from my Controller or Model to it's
> corresponding View.
>
> How can I get hold of a View object and call that render() function?
>
> Many thanks,
> Matt.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Please help! CakePHP + TinyMCE + MCImageManager Problems

2008-04-02 Thread 1nsane

Hey guys,

I'm having problems getting the MCImageManager to work with TinyMCE
and CakePHP. Everything works fine with CakePHP and TinyMCE, but after
installing the MCImageManager plugin (using the instructions on your
wiki), I can't seem to get the plugin working. The problem seems
fairly simple - basically, when I click on "add/edit image" and then
"browse" to launch the image manager plugin, I receive a cake error:
"Error:  JsController could not be found." It appears that clicking
the browse button is requesting the url 
http://localhost/js/tiny_mce/themes/advanced/index.php?type=im
- the problem being that an index.php file does not exist at that
path.

However, if I browse manually to 
http://localhost/js/tiny_mce/plugins/imagemanager/examples.html
- the examples are working. The image manager is launched and I am
able to browse/upload images without a hitch. So, it would appear that
there is a simple path/configuration problem that is causing the image
manager to not be launched properly. Or perhaps it has something to do
with rewrites and the way cake handles requests?

I've tried including .htaccess files in the js/tiny_mce, js/tiny_mce/
plugins, and js/tiny_mce/plugins/imagemanager folders in case it has
something to do with rewrites - but still no luck. Instead, I'm given
a 404 Not Found error (The requested URL /js/tiny_mce/themes/advanced/
index.php was not found on this server) which is what I figured was
happening. Because Cake can't find this file, it is then trying to
find a controller and performs a redirect to that Missing Controller
error page.

Any other ideas? I'm using TinyMCE 3.05 and IM version 3.0.7

I should also include my configuration options for TinyMCE init:

theme : "advanced",
theme_advanced_layout_manager : "SimpleLayout",
mode : "none",
plugins : "table,imagemanager",
convert_urls : false,
table_styles : "Header 1=header1;Header 2=header2;Header
3=header3",
table_cell_styles : "Header 1=header1;Header 2=header2;Header
3=header3;Table Cell=tableCel1",
table_row_styles : "Header 1=header1;Header 2=header2;Header
3=header3;Table Row=tableRow1",
table_cell_limit : 100,
table_row_limit : 5,
table_col_limit : 5,
theme_advanced_buttons1 :
"bold,italic,underline,separator,justifyleft,justifycenter,separator,formatselect,separator,bullist,numlist,separator,outdent,indent,separator,cut,copy,paste,undo,separator,image,code",
theme_advanced_buttons2 : "tablecontrols",
theme_advanced_buttons3 : ""

Any help would be MUCH appreciated.

Mike

--~--~-~--~~~---~--~~
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: Array of named arguments(?) - pagination related

2008-04-02 Thread Lisa

maybe you mean like this?

http://groups.google.com/group/cake-php/browse_thread/thread/675b44ae3a3a29f7/821fd9ba9e955b5f?hl=en#821fd9ba9e955b5f

--~--~-~--~~~---~--~~
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: Logical organization best practice

2008-04-02 Thread b logica

I'd say that you should put most of your logic in the controller
method that the requestAction() is calling. From there, use
$this->set('some_variable', $some_value) and then lay out your HTML in
the view.

But, without knowing the details of your situation, it's difficult to say.

On Wed, Apr 2, 2008 at 6:12 PM, Matt <[EMAIL PROTECTED]> wrote:
>
>  Hi Baz, b,
>
>  Thanks for your responses. I like the idea of using Cake's caching
>  framework - a cache is a more appropriate place to store the generated
>  data, rather than pushing it back to the database every time.
>
>  I'm still slightly confused about the logical place to put the code
>  which actually generates the HTML. The function itself is about 130
>  lines long, and does things like generate images for labels which need
>  to be vertical; it seems like that would be too heavy to go into the
>  View. But then again, it is strictly creating a visual interpretation
>  of the data from the model, which is the very definition of what a
>  view is supposed to do.
>
>  I guess at the end of the day, it doesn't really matter. But I would
>  be intrigued to hear the wiser words of someone more seasoned in the
>  MVC paradigm.
>
>  Thanks again,
>  Matt.
>
>
>
>
>  On Apr 1, 12:19 pm, "b logica" <[EMAIL PROTECTED]> wrote:
>  > I'll second that. It really seems that Cake could take care of this for 
> you.
>  >
>  > Create a view with:
>  >
>  > element('your_controller/some_method', array('cache'=>'1 day')) 
> ?>
>  >
>  > Put all of your other params in the array as well and they'll be
>  > available in the view, from where you can pass them through a
>  > requestAction() to your controller.
>  >
>  > In the controller:
>  >
>  > function afterSave()
>  > {
>  > clearCache('element_cache_your_controller_some_method', 'views', 
> '');
>  >
>  > }
>  >
>  > Or put the clearCache() wherever it makes the most sense for your 
> situation.
>  >
>  > b
>  >
>
> > On Mon, Mar 31, 2008 at 5:49 PM, Baz <[EMAIL PROTECTED]> wrote:
>  > > Not sure this will help, but here goes:
>  >
>  > > What my Cake experience has shown me is that, there was a lot of stuff 
> that
>  > > I used to do "manually" that is now made obsolete by CakePHP. I've 
> wasted a
>  > > lot of trying to to port legacy code into my Cake projects, that I later
>  > > realized that I didn't need.
>  >
>  > > Off the top of my head, CakePHP has some caching features. These may make
>  > > your database HTML snippet caching more trouble than it's worth. You 
> could
>  > > cache your "snippet" as an element and include it like that, and you 
> could
>  > > simply clearCache() for that elemet "when your parameters change".
>  >
>  > > Hope this helps
>  >
>
> > > On Mon, Mar 31, 2008 at 4:06 PM, Matt <[EMAIL PROTECTED]> wrote:
>  >
>  > > > Hi all,
>  >
>  > > > My application accepts a fairly large collection of parameters and
>  > > > uses them to generate an HTML snippet. The snippet is generated
>  > > > lazily, so that the parameters can change frequently but the HTML is
>  > > > only generated when it's needed. Once generated, the HTML is cached
>  > > > (in the database) until the parameters change again.
>  >
>  > > > I'm new to MVC, and not sure where thebestplace to put the HTML
>
>
> > > > generation code is. I would guess that the Model is thebestlogical
>  > > > place for it, since it will be updating a model reference with the
>  > > > generated HTML. What makes me wonder though, is that the generation
>  > > > code actually references other models (because the parameters can be
>  > > > logically separated).
>  >
>  > > > Would the Controller be a better place for this code, or should I
>  > > > leave it in the Model? If so, how do you access other models from
>  > > > within a Model class?
>  >
>  > > > Many thanks,
>  > > > Matt.
>  >
>

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



Rendering a View manually

2008-04-02 Thread Matt

Hello group,

One of my Controller methods generates a zip file containing parts of
my application which can be viewed in a standalone mode. One of its
key functions will be to render some of the app's pages to .html files
and add them to the zip.

I'm fairly new to Cake and not au fait with how it's internals work. I
see that the function View::render() exists and returns a string, but
I can't figure out how to get from my Controller or Model to it's
corresponding View.

How can I get hold of a View object and call that render() function?

Many thanks,
Matt.


--~--~-~--~~~---~--~~
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: Logical organization best practice

2008-04-02 Thread Matt

Hi Baz, b,

Thanks for your responses. I like the idea of using Cake's caching
framework - a cache is a more appropriate place to store the generated
data, rather than pushing it back to the database every time.

I'm still slightly confused about the logical place to put the code
which actually generates the HTML. The function itself is about 130
lines long, and does things like generate images for labels which need
to be vertical; it seems like that would be too heavy to go into the
View. But then again, it is strictly creating a visual interpretation
of the data from the model, which is the very definition of what a
view is supposed to do.

I guess at the end of the day, it doesn't really matter. But I would
be intrigued to hear the wiser words of someone more seasoned in the
MVC paradigm.

Thanks again,
Matt.



On Apr 1, 12:19 pm, "b logica" <[EMAIL PROTECTED]> wrote:
> I'll second that. It really seems that Cake could take care of this for you.
>
> Create a view with:
>
> element('your_controller/some_method', array('cache'=>'1 day')) ?>
>
> Put all of your other params in the array as well and they'll be
> available in the view, from where you can pass them through a
> requestAction() to your controller.
>
> In the controller:
>
> function afterSave()
> {
> clearCache('element_cache_your_controller_some_method', 'views', '');
>
> }
>
> Or put the clearCache() wherever it makes the most sense for your situation.
>
> b
>
> On Mon, Mar 31, 2008 at 5:49 PM, Baz <[EMAIL PROTECTED]> wrote:
> > Not sure this will help, but here goes:
>
> > What my Cake experience has shown me is that, there was a lot of stuff that
> > I used to do "manually" that is now made obsolete by CakePHP. I've wasted a
> > lot of trying to to port legacy code into my Cake projects, that I later
> > realized that I didn't need.
>
> > Off the top of my head, CakePHP has some caching features. These may make
> > your database HTML snippet caching more trouble than it's worth. You could
> > cache your "snippet" as an element and include it like that, and you could
> > simply clearCache() for that elemet "when your parameters change".
>
> > Hope this helps
>
> > On Mon, Mar 31, 2008 at 4:06 PM, Matt <[EMAIL PROTECTED]> wrote:
>
> > > Hi all,
>
> > > My application accepts a fairly large collection of parameters and
> > > uses them to generate an HTML snippet. The snippet is generated
> > > lazily, so that the parameters can change frequently but the HTML is
> > > only generated when it's needed. Once generated, the HTML is cached
> > > (in the database) until the parameters change again.
>
> > > I'm new to MVC, and not sure where thebestplace to put the HTML
> > > generation code is. I would guess that the Model is thebestlogical
> > > place for it, since it will be updating a model reference with the
> > > generated HTML. What makes me wonder though, is that the generation
> > > code actually references other models (because the parameters can be
> > > logically separated).
>
> > > Would the Controller be a better place for this code, or should I
> > > leave it in the Model? If so, how do you access other models from
> > > within a Model class?
>
> > > Many thanks,
> > > Matt.
--~--~-~--~~~---~--~~
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: Model Associations and Validations

2008-04-02 Thread Chris Hartjes

On Wed, Apr 2, 2008 at 4:55 PM, bmopro <[EMAIL PROTECTED]> wrote:
>
>  When i use the edit action in my user model i have the following to
>  grab the users info from the table...
>  $this->User->findById($id)
>  This returns an array that is HUGE!
>  It includes all my validation contained in my User model,
>  and all of the associations.  Obviously i just need the users info to
>  edit, i don't need all of the asociations.
>  I have looked at trying to use recursive but can't get it to work.

What do you mean "looked at trying to use recursive but can't get it to work".

$this->User->recursive = -1;
$this->User->findById($id);

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@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?hl=en
-~--~~~~--~~--~--~---



Model Associations and Validations

2008-04-02 Thread bmopro

When i use the edit action in my user model i have the following to
grab the users info from the table...
$this->User->findById($id)
This returns an array that is HUGE!
It includes all my validation contained in my User model,
and all of the associations.  Obviously i just need the users info to
edit, i don't need all of the asociations.
I have looked at trying to use recursive but can't get it to work.
Should i build associations on the fly? And why does it include all of
the validation?
Is there a way i can force it not to?
Thanks in advance!
Brian

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



bake not working when app is above webroot

2008-04-02 Thread twitchylegs

I changed my setup so I could run multiple applications but couldn't
get bake to work when the app files were above the webroot. Any ideas
why?

Setup was the following
-root: /var/www/app
-app1 /var/www/app/app1
-app2 /var/www/app/app2
-core: /usr/lib/cake/
www.example.com/app1/index.php
www.example.com/app2/index.php
[[index.php file is the webroot/index.php file, the root, app, and
core were updated accordingly]]

Things were working great, I could view the different applications by:
www.example.com/app1
www.example.com/app2

BUT, bake doesn't work. The interactive bake console opens up and
after being prompted to create a Project it fails to mkdir "new app"
and when trying to create a Model it states that it is writing the
file, but no file gets created.

I changed my setup so the app files are below the webroot and bake
works fine. My setup now is:
-root: /var/www/app
-app1 /var/www/www.example.com/app1
-app2 /var/www/www.example.com/app2
-core: /usr/lib/cake/







--~--~-~--~~~---~--~~
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: Discussion on cakephp-official-resources

2008-04-02 Thread Sliv

I didn't, the group owner did.

--~--~-~--~~~---~--~~
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: retrieving aggregated data from the model

2008-04-02 Thread acoustic_overdrive

Great, thanks for the tips - I will try them out and see how I get on.

Jamie

On Apr 2, 2:07 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Sun, Mar 30, 2008 at 3:51 PM,acoustic_overdrive
>
>
>
> <[EMAIL PROTECTED]> wrote:
>
> >  What's the recommended way to use aggregate functions like SUM()?
>
> >  I'm building an accounting application that so far has three models:
>
> >  - Client hasMany Transaction
> >  - Transaction hasMany TransactionItem, belongsTo Client
> >  - TransactionItem belongsTo Transaction
>
> >  The total value of a Transaction (an invoice or receipt) is the sum of
> >  its related TransactionItems, which each have a monetary value.
>
> >  When listing transactions I also want to know the total value of each
> >  and so I could do this with some SQL like this:
>
> >  SELECT
> >         SUM(TransactionItem.amount),
> >         Transaction.title
> >         FROM transaction_items AS TransactionItem
> >         LEFT JOIN transactions AS Transaction
> >         ON TransactionItem.transaction_id = Transaction.id
> >  GROUP BY Transaction.id
>
> Have you tried setting (SUM(TransactionItem.amount) as a field in the
> fields parameter?  Also, there's a little trick where you have to pass
> GROUP BY to the model via the conditions array
>
> $conditions = array('1=1 GROUP BY Transaction.id');
> $fields = array('SUM(TransactionItem.amount) as amount', 'Transaction.title'))
>
> $results = $this->TransactionItem->find('all', compact('conditions', 
> 'fields));
>
> Hope that helps.
>
> --
> Chris Hartjes
> Internet Loudmouth
> Motto for 2008: "Moving from herding elephants to handling snakes..."
> @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?hl=en
-~--~~~~--~~--~--~---



Re: Query Question

2008-04-02 Thread Dan

Thanks for the note but I can't get conditions to work because it's a
HABTM relationship.

I tried

$this->paginate('Game', "Category.name = 'puzzle'");

but it gives me

SQL Error: 1054: Unknown column 'Category.id' in 'where clause'

The query doesn't join Category to Game so it has no idea what
Category.name is.

--~--~-~--~~~---~--~~
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: Login redirect issue ...

2008-04-02 Thread [EMAIL PROTECTED]

Unfortunately not, I tried once to debug the problem, but I gave up as
I was tired I think (and that the problem wasn't major -> not acting
on production site)

Base of research : what is the behavior of $_SESSION['Auth']
['redirect'] after a successful login.

Good bughunting ;)

On 2 avr, 01:34, John R <[EMAIL PROTECTED]> wrote:
> Nope ... I am using routing and baseURL is commented out.
>
> Any other ideas here?
--~--~-~--~~~---~--~~
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: works in localhost, not works in www.toreadandtowrite.com

2008-04-02 Thread [EMAIL PROTECTED]

'host' => must point to your MySQL server ! Also check  username and
password your hostporvider gave you.

On 2 avr, 07:08, Stephen Orr <[EMAIL PROTECTED]> wrote:
> Probably.
>
> Suggestion - ask your HOST what the correct settings should be.
>
> On Apr 1, 11:23 pm, Raistlin Majere <[EMAIL PROTECTED]> wrote:
>
>
>
> > I replaced the line:
>
> > 'host' => 'localhost',
>
> > with:
>
> > 'host' => 'www.toreadandtowrite.com',
>
> > Is it wrong?
>
> > On 31 mar, 01:59, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> > wrote:
>
> > > You just seem to have an issue with the database connection, verify
> > > the file config/database.php
>
> > > cheers (and welcome to cake)
>
> > > On 30 mar, 21:35, Raistlin Majere <[EMAIL PROTECTED]> wrote:
>
> > > > My site is actually 
> > > > athttp://www.toreadandtowrite.com/CakePHP/toreadandtowrite/
>
> > > > On Mar 30, 4:28 pm, Raistlin Majere <[EMAIL PROTECTED]> wrote:
>
> > > > > What should I do to make my site that works in locahost, work 
> > > > > inwww.toreadandtowrite.comtoo?-Masquerletexte des messages précédents 
> > > > > -
>
> > > > - Afficher le texte des messages précédents -- Masquer le texte des 
> > > > messages précédents -
>
> - Afficher le texte des messages précédents -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Retrieve all articles from more then one categories?

2008-04-02 Thread Mech7

Does anybody know how i can get all results based on more then one
item with a HABTM relation. for example i have:

$this->set('articles', $this->Category->findBySlug(array('php',
'photoshop')));

But i will only get the articles from the first category:

This is the query it will make:

SELECT `Category`.`id`, `Category`.`name`, `Category`.`slug`,
`Category`.`parent_id`, `Category`.`lft`, `Category`.`rght`
FROM `scms_categories` AS `Category`
WHERE `Category`.`slug` IN ('tutorials', 'photoshop')
LIMIT 1 1   1   1

SELECT `Article`.`id`, `Article`.`title`, `Article`.`slug`,
`Article`.`article`, `Article`.`published`, `Article`.`viewed`,
`Article`.`user_id`, `Article`.`created`, `Article`.`modified`,
`ArticlesCategory`.`article_id`, `ArticlesCategory`.`category_id`
FROM `scms_articles` AS `Article`
JOIN `scms_articles_categories` AS `ArticlesCategory` ON
(`ArticlesCategory`.`category_id` IN (1)  AND
`ArticlesCategory`.`article_id` = `Article`.`id`)
ORDER BY `Article`.`id` DESC
--~--~-~--~~~---~--~~
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: ajax->updater calls wrong action

2008-04-02 Thread [EMAIL PROTECTED]

Answers : no, by default evalScript is set to false. So be careful if
you put javascript into your called pages or not.

If you do, don't forget to write your javascript functions like this :

thisIsMyJSFunction = function(arg1, arg2){

}

It's a common mistake to write it as "function myJSFunction(){...}"
which will make the function not to be "parsed".

If you're interested in using Ajax call within a form, you could also
try to use $ajax->form(etc.); Treating your ajax the Cake way :P

Cheers

On 2 avr, 13:49, da_student <[EMAIL PROTECTED]> wrote:
> and you're right with the asynchronous, thanx for that. is it
> possible, that i don't need the valScripts either? (works without
> right now, so I'll just give it a shot)
--~--~-~--~~~---~--~~
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: Anybody using html->addCrumb() html->getCrumbs?

2008-04-02 Thread [EMAIL PROTECTED]

I'm thinking the same thing as you, currently, I'm using it in a
project that uses a tree behavior to display it's content. So I like
to display the parent of the page before the page itself in the
breadcrumbs. To do this, I had to create a function into my view that
would populate the breadcrumb. But I really don't like this approach,
it's a relatively important function into a view, what the hell?

I would prefer to do this as you said, from within a controller, would
find this more MVC oriented.

Here's an exemple of the code I've made for a paginated content,
supposed recursive is set to 2 (which belongs to the controller):

the call :
populate_breadCrumb($this->params['named']['page']-1, $tutoriels,
$html, $this->pageTitle);

the function :
function populate_breadCrumb($params, &$data, &$html, $pageTitle =
null){
if(!empty($data[$params]['Tutoriel']['title'])){
if(!empty($data[$params]['Parent']['id'])){
foreach($data as $k => $tuto){
if($data[$params]['Parent']['id'] == 
$tuto['Tutoriel']['id']){
$new_param = $k;
populate_breadCrumb($new_param, $data, 
$html);
break;
}
}
}
if(!empty($data[$params]['Parent']['title'])){
if($pageTitle == $data[$params]['Tutoriel']['title']){
$link = null;
}else{
$link = '/view/page:'.($params+1);
}
$html->addCrumb($data[$params]['Tutoriel']['title'], 
$link);
}
}
}


Maybe a better way around would be to create view variable, but.. but?
Or to create a helper.. anyway, some work is necessary around this
functionnality I think. Or I didn't understood the logic behind
either ;)

On 2 avr, 19:40, aranworld <[EMAIL PROTECTED]> wrote:
> It seems most logical to me that I would want to use addCrumb() from
> within the controller -- maybe even a standard piece of overridable
> logic within the app_controller ... and then use getCrumbs() from
> within the view.
>
> Or, is this logic wrong?
>
> If you are using the HTML helper's crumb functionality, how are you
> using it?
--~--~-~--~~~---~--~~
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: WAMP and CakePHP

2008-04-02 Thread Baz
Wow Ok,

I think your best bet is Xampp Lite

http://www.apachefriends.org/en/xampp-windows.html#646

On Wed, Apr 2, 2008 at 1:50 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wrote:

>
> I like to use InstantRails (http://rubyforge.org/frs/?
> group_id=904&release_id=17517)
> as an easy, semi-portable, CakePHP
> development environment. You can delete all the rails stuff if you
> don't want it or just leave it there but it supports PHP fine and it's
> a breeze to setup.
>
> Dave
>
> On Apr 2, 11:05 am, UTDStudent <[EMAIL PROTECTED]> wrote:
> > I am a college student who is currently trying to set up a WAMP
> > installation to run a school project on. Do any of you fine folks have
> > any recommendations for a setup.
> >
> > PS - Normally I'd like to learn Linux and use a LAMP, but I am pressed
> > for time.
> >
> > 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: WAMP and CakePHP

2008-04-02 Thread [EMAIL PROTECTED]

I like to use InstantRails (http://rubyforge.org/frs/?
group_id=904&release_id=17517) as an easy, semi-portable, CakePHP
development environment. You can delete all the rails stuff if you
don't want it or just leave it there but it supports PHP fine and it's
a breeze to setup.

Dave

On Apr 2, 11:05 am, UTDStudent <[EMAIL PROTECTED]> wrote:
> I am a college student who is currently trying to set up a WAMP
> installation to run a school project on. Do any of you fine folks have
> any recommendations for a setup.
>
> PS - Normally I'd like to learn Linux and use a LAMP, but I am pressed
> for time.
>
> 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: Anybody using html->addCrumb() html->getCrumbs?

2008-04-02 Thread Zoltan

There's a few threads on breadcrumbs (addCrumb) that cover how to use
it.

http://groups.google.com/group/cake-php/browse_thread/thread/9bf3a18b1fa72fd2/2093b766d75d46d9
http://groups.google.com/group/cake-php/browse_thread/thread/21592590569f6433/56d5a3746a43e618

Zoltan
www.yyztech.ca

On Apr 2, 1:40 pm, aranworld <[EMAIL PROTECTED]> wrote:
> It seems most logical to me that I would want to use addCrumb() from
> within the controller -- maybe even a standard piece of overridable
> logic within the app_controller ... and then use getCrumbs() from
> within the view.
>
> Or, is this logic wrong?
>
> If you are using the HTML helper's crumb functionality, how are you
> using it?
--~--~-~--~~~---~--~~
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: hit counter or custom annalytics

2008-04-02 Thread Dardo Sordi Bogado

>  Hi -
>  I am trying to build a simple site tracking system to gather some simple
> analytics on a site we are using.
>  I can not use a third party analytics system like Google Analytics because
> the site is on an internal network only and we need to track some site
> specific information, such as user.
>
>  I did have a chunk of code in the app_controller inside of the
> beforeFilter() function.
>  It did just what I wanted except on some actions it was executed more than
> once, and on some controllers when it's own beforeFilter function was added
> - that bypassed my tracking code in the app_controller.

When you overwrite a beforeFilter() you *have* to call parent::beforeFilter().


>  Any ideas on how to accomplish this?
>
>
>
>  -
>
>  Sell your car easy - ForSaleSticker.com
>
>  >
>

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



Overriding IMAGES and IMAGES_URL

2008-04-02 Thread wralph

Hi,
I am on shared web hosting and I have a directory setup like so:

app/ - Frontend application
admin/ - Backend application
cake/ - Cake core

I have an add item page inside admin, which uploads images to admin/
webroot/img and I want to be able to access these from the frontend
directory with the $html->image() method, but this will by default
look inside app/webroot/img.
I can't make a symbolic link there as I am on shared hosting, is there
any other way?

Regards,
WR
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Anybody using html->addCrumb() html->getCrumbs?

2008-04-02 Thread aranworld

It seems most logical to me that I would want to use addCrumb() from
within the controller -- maybe even a standard piece of overridable
logic within the app_controller ... and then use getCrumbs() from
within the view.

Or, is this logic wrong?

If you are using the HTML helper's crumb functionality, how are you
using it?
--~--~-~--~~~---~--~~
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: Problems with Acl/Auth

2008-04-02 Thread aranworld

I agree with Dardo.  The key is to take a good look at the queries
being generated.

I am using Auth and ACL using 'crud' mode.  It works fine as
advertised.  I am also using the Acl Behavior.  I assume you are using
that, but just in case, you need to make sure you are using the Acl
Behavior in your user model and that the parentNode() function in your
User model is returning the correct value.

I believe that one of the older tutorials has outdated code in it's
parentNode() code.  If it makes you feel any better, I would say I
struggled with Auth and ACL for more than a week before I really had
it working the way I wanted it to.

-Aran


On Apr 2, 9:01 am, mbavio <[EMAIL PROTECTED]> wrote:
> I was doing exactly the same thing you want to do:
>
> function isAuthorized() {
> if ($this->Acl->check(array('foreign_key' => $this->Auth->user('id'),
> 'model' => 'User'),
> 
> inflector::camelize($this->name).'/'.$this->params['action'],
> '*')) {
> return true;
> }
> else {
> return false;
> }
>
> and it works. However, it doesnt seem like the correct aproach to Auth/
> ACL. I´m trying to change it, but in case you want to continue with
> this way, ask me if you need some help.
>
> Cheers,
> mbavio
>
> On Apr 1, 7:50 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
> > Hi,
>
> > I decided on taking a different route and cutting out the ACL all
> > together. I changed the Auth system to be based on the controller
> > rather then actions
>
> > //$this->Auth->authorize = 'actions';
> > $this->Auth->authorize = 'controller';
>
> > This allows me to roll my own system using the
> > ::isAuthorized() function in each controller. For my
> > purposes this seems to be doing the trick.
>
> > thanks for the help.
>
> > On Mar 31, 10:11 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]>
> > wrote:
>
> > > Get the SQL queries cake is making, post the here if that doesn't
> > > clarify the issue. Also check with an updated version of cake, there
> > > are some ACL related bugs that have been fixed in the branch. It will
> > > useful to help you, if  you include your Auth setup.
>
> > > On Mon, Mar 31, 2008 at 10:26 PM, Sam Sherlock <[EMAIL PROTECTED]> wrote:
> > > > AFAIK login and login are special functions, that don't require acl 
> > > > branches
> > > > (is it fair to call them that, part of a tree)
>
> > > > it won't solve the issue, are other controlers working with acl?
>
> > > > On 31/03/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi,
>
> > > > > I have spent hours and hours struggling with the ACL. It is about the
> > > > > most frustrating thing I have worked with. I have to use it because
> > > > > its inheritable permissions (if anyone has any alternatives to use I
> > > > > am all ears). Anyway, this is what my trees look like:
>
> > > > > Welcome to CakePHP v1.2.0.6311 beta Console
> > > > > ---
> > > > > Aco tree:
> > > > > ---
> > > > >   [1]ROOT
>
> > > > > [2]Users
>
> > > > >   [3]menu
>
> > > > >   [6]logout
>
> > > > > [4]Pages
>
> > > > > [5]Candidates
>
> > > > >   [8]index
>
> > > > > [7]Groups
>
> > > > > -
> > > > > Aro tree:
> > > > > -
> > > > >   [1]Admin
>
> > > > > [2]
>
> > > > > [3]
>
> > > > >   [4]Clients
>
> > > > > [5]Client1
>
> > > > >   [6]client1user
>
> > > > > [7]Client2
>
> > > > >   [8]client2user
> > > > > ---
> > > > > So far so good. Then I grant access for Clients to index, and I check
> > > > > that client1user successfully inherited permission, which it does.
>
> > > > > >cake acl grant Clients index all
> > > > > >cake acl check client1user index all
> > > > > >>>client1user is allowed.
>
> > > > > Then when I login as client1user and go to /Candidates/index, I get
> > > > > redirected because the Acl thinks I don't have permission.
>
> > > > > Does anyone have any idea why this is happening and what I can do
> > > > > about it??
>
> > > > > *frustrated*
>
> > > > > Thanks in advance!
> > > > > -Eric
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



WAMP and CakePHP

2008-04-02 Thread UTDStudent

I am a college student who is currently trying to set up a WAMP
installation to run a school project on. Do any of you fine folks have
any recommendations for a setup.

PS - Normally I'd like to learn Linux and use a LAMP, but I am pressed
for time.

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: Ajax Link Generation

2008-04-02 Thread [EMAIL PROTECTED]

Just had another thought, you could also store the result of $ajax-
>link() in a variable ($linkData= $ajax->link()) then use regular
expressions to separate the Cdata from the link data and echo them in
separate places.

On Apr 2, 11:19 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> I don't think it's possible to have the ajax helper generate the CData
> portion separately. I would do one of the following:
> 1) write the code out by hand.
> 2) create a hidden $ajax->submit button to submit your ajax call then
> create a link around your node that calls a javascript function to
> initiate a click on the hidden ajax button (ie  onClick="functionthatfindsandclicksyourajaxbutton()">stuff ).
>
> On Apr 2, 12:38 am, duncan_m <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > I have a small Ajax question that I'm hoping someone can help me with.
>
> > I'm trying to integrate the YUI (Yahoo UI) Treeview into an
> > application and I want to execute an Ajax update of a Div on the click
> > of a node in the tree. I need to attach the Ajax Update link to the
> > Treeview Node and to do that I need the HREF and CData portions of the
> > Ajax link seperately.
>
> > A call to $Ajax->link() results in a string with both the fully formed
> > HTML Link AND the CData portion (wrapped in Javascript tags).. I would
> > like to be able to retrieve these two items seperately so that I can
> > attach the link to the Node and include the CData portion in the HTML
> > document.
>
> > I understand the YUI portions etc just fine, I'm just struggling with
> > the mechanics of generating the seperate portions of the AJAX link..
>
> > I hope my question makes sense?
>
> > With thanks,
>
> > Duncan.
--~--~-~--~~~---~--~~
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: Ajax Link Generation

2008-04-02 Thread [EMAIL PROTECTED]

I don't think it's possible to have the ajax helper generate the CData
portion separately. I would do one of the following:
1) write the code out by hand.
2) create a hidden $ajax->submit button to submit your ajax call then
create a link around your node that calls a javascript function to
initiate a click on the hidden ajax button (ie stuff ).

On Apr 2, 12:38 am, duncan_m <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a small Ajax question that I'm hoping someone can help me with.
>
> I'm trying to integrate the YUI (Yahoo UI) Treeview into an
> application and I want to execute an Ajax update of a Div on the click
> of a node in the tree. I need to attach the Ajax Update link to the
> Treeview Node and to do that I need the HREF and CData portions of the
> Ajax link seperately.
>
> A call to $Ajax->link() results in a string with both the fully formed
> HTML Link AND the CData portion (wrapped in Javascript tags).. I would
> like to be able to retrieve these two items seperately so that I can
> attach the link to the Node and include the CData portion in the HTML
> document.
>
> I understand the YUI portions etc just fine, I'm just struggling with
> the mechanics of generating the seperate portions of the AJAX link..
>
> I hope my question makes sense?
>
> With thanks,
>
> Duncan.
--~--~-~--~~~---~--~~
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: autosave implementation: using onChange to click $ajax->submit

2008-04-02 Thread b logica

You could use setInterval() to fire the submit() (if changes have been made).

On Wed, Apr 2, 2008 at 12:50 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
>  I set up a form to autosave with ajax by using an elements onChange()
>  function to click the $ajax->submit() element. This seems like the
>  easiest to implement solution to me but will this be overtaxing the
>  server with elements like textareas which would change with each
>  keystroke? If so, any ideas on how to better implement this? I don't
>  expect more than a dozen people to use this at once.
>
>  Thanks,
>  Dave
>  >
>

--~--~-~--~~~---~--~~
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: Query Question

2008-04-02 Thread [EMAIL PROTECTED]

you set your conditions in the paginate variable. Example:
class GamesController extends AppController {
var $name = 'Games';
var $paginate = array(
'Game' => array(
'limit'=>10,
'order'=> 'Game.id ASC',
)
);
...
function someAction()
{
...
$conditions=array("your conditions");
$this->paginate['Game']['conditions']=$conditions;
$this->set('games', $this->paginate());
..
}
}
On Apr 2, 10:37 am, dan <[EMAIL PROTECTED]> wrote:
> Games HABTM Categories
>
> I need to $this->paginate('Game'); where Category.name = 'puzzle'
>
> Is this possible?  Tried using bindModel but can't figure it out.
--~--~-~--~~~---~--~~
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: Adding an extra column (sub query) to a model using associations

2008-04-02 Thread b logica

Your English is far better than my Dutch (Oranje Boven!)

I wonder if this thread will be helpful to your sutuation as well:

http://groups.google.com/group/cake-php/browse_frm/thread/f7508c11b6f785ff#

On Tue, Apr 1, 2008 at 5:07 PM, Maff^ <[EMAIL PROTECTED]> wrote:
>
>  First of all, thanks for your comment, the Bindable behavior is very
>  useful! Also, sorry for my very late response, I've been busy with
>  school and work.
>
>  Unfortunately the Bindable behavior doesn't help me with my problem :
>  (, although it made me think.
>  I thoughtI found a solution by using a hasOne-association in my Diner
>  model:
>
>  var $hasOne = array (
>   'Dinertotal' => array (
> 'className' => 'Diner',
> 'fields' => array (
> '(SELECT SUM(count) FROM `dinersubscriptions` WHERE diner_id =
>  `Diner`.`id`) as `totalcount`',
>
> '(SELECT SUM(amount) FROM `dinerpayments` WHERE diner_id =
>  `Diner`.`id`) as `totalamount`'
> ),
> 'foreignKey' => 'id',
>   ),
>  );
>  This creates a JOIN query which retrieves the fields i want:
>
>  "SELECT `Diner`.`id`, `Diner`.`date`, `Diner`.`title`,
>  `Diner`.`description`, `Diner`.`stats`, `Diner`.`locked`,
>  `Diner`.`bill_id`, `Diner`.`created`, `Diner`.`modified`, `Bill`.`id`,
>  `Bill`.`date`, `Bill`.`created`, `Bill`.`modified`, (SELECT SUM(count)
>  FROM `dinersubscriptions` WHERE diner_id = `Diner`.`id`) as
>
> `totalcount`, (SELECT SUM(amount) FROM `dinerpayments` WHERE diner_id
>  = `Diner`.`id`) as `totalamount` FROM `diners` AS `Diner` LEFT JOIN
>  `bills` AS `Bill` ON (`Diner`.`bill_id` = `Bill`.`id`) LEFT JOIN
>  `diners` AS `Dinertotal` ON (`Dinertotal`.`id` = `Diner`.`id`) WHERE
>  `Diner`.`id` = 499 LIMIT 1"
>
>  Array
>  (
>  [Diner] => Array
>  (
> [id] => 1851
> [date] => 2008-02-29
> [title] =>
> [description] =>
> [stats] => 1
> [locked] => 1
> [bill_id] => 11
> [created] => 2008-01-18 16:17:24
> [modified] => 2008-03-01 23:04:18
>  )
>
>  [Bill] => Array
>  (
> [id] => 11
> [date] => 2008-03-20
> [created] => 2008-03-16 16:29:18
> [modified] => 2008-03-16 16:29:18
>  )
>
>  [0] => Array
>  (
> [totalcount] => 5
> [totalamount] => 8.603814697
>  )
>  )
>
>
>  I was happy to find this working for me, until I did a Bill-
>  >find('first') (where id = 11)!
>  It didn't work because cakePHP makes a lot of queries in order to
>  retrieve the hasOne assoc. (instead of a join):
>
>  SELECT `Diner`.`id`, `Diner`.`date`, `Diner`.`title`,
>  `Diner`.`description`, `Diner`.`stats`, `Diner`.`locked`,
>  `Diner`.`bill_id`, `Diner`.`created`, `Diner`.`modified` FROM `diners`
>  AS `Diner` WHERE `Diner`.`bill_id` IN (11)
>  SELECT (SELECT SUM(count) FROM `dinersubscriptions` WHERE diner_id =
>  `Diner`.`id`) as `totalcount`, (SELECT SUM(amount) FROM
>  `dinerpayments` WHERE diner_id = `Diner`.`id`) as `totalamount` FROM
>  `diners` AS `Dinertotal` WHERE `Dinertotal`.`id` = 1839
>  SELECT (SELECT SUM(count) FROM `dinersubscriptions` WHERE diner_id =
>  `Diner`.`id`) as `totalcount`, (SELECT SUM(amount) FROM
>  `dinerpayments` WHERE diner_id = `Diner`.`id`) as `totalamount` FROM
>  `diners` AS `Dinertotal` WHERE `Dinertotal`.`id` = 1840
>  etc...
>
>  This of course doesn't work because `Diner`.`id` is unknown.
>
>
>  So my question is: is there a way to force cakePHP to do a join query
>  instead of all those separate queries (it would also be a lot faster),
>  or can I some how make cakePHP query some extra fields? (Maybe by
>  making a behavior so you could define these fields in your Model).
>
>  I hope my story is still a little bit understandable, my English is
>  quite poor :(.
>
>  Yours sincerely,
>  Ruud Bijnen
>
>
>  On Mar 15, 11:34 pm, "b logica" <[EMAIL PROTECTED]> wrote:
>  > Pancakes, yum!
>  >
>  > If you haven't already, check out Mariano's article on his Bindable
>  > behavior. I found a good way to play around with it was to put
>  > debug($my_whatever) in the view and to then play around with
>  > restrictions in the controller.
>  >
>  > http://bakery.cakephp.org/articles/view/bindable-behavior-control-you...
>
>
> >
>  >
>  >
>  > On Sat, Mar 15, 2008 at 3:26 PM, Maff^ <[EMAIL PROTECTED]> wrote:
>  >
>  > >  Hi There,
>  >
>  > >  First of all I want to state that I'm not a very advanced CakePHP
>  > >  user. I tried to find answers to my question here and with Google, but
>  > >  I'm probably not using there right keywords.
>  >
>  > >  Okay, here is my situation: I have an Diner model which has 2 hasMany
>  > >  associations (to Dinersubscription and Dinerpayment). The
>  > >  Dinersubscriprion model has a field 'count' telling how many servings
>  > >  a Resident wants. (0 meaning that person won't join diner). The
>  > >  Dinerpayment model tels who paid for the groceries and adding up all
>  > >  records for a particular diner gives you the costs for that diner.
>

Re: Help: is it feasible to use multiple .po files?

2008-04-02 Thread b logica

Yes, but you should use __d() instead of __() to translate. Look at
the method in cake/basics.php. In a nutshell, you would use it like:

__d('common', 'some string to translate')
__d('common', 'some string to translate', true)
__d('msgid_will_use_in_ctp_file1', 'some string to translate', true)

On Wed, Apr 2, 2008 at 6:33 AM, neeocis <[EMAIL PROTECTED]> wrote:
>
>  Dear all,
>  I am trying to figure out that is it possible and or feasible to use
>  multiple .po files for each language like...
>  /app/locale/eng/LC_MESSAGES/common.po
>  /app/locale/eng/LC_MESSAGES/msgid_will_use_in_ctp_file1.po
>  /app/locale/eng/LC_MESSAGES/msgid_will_use_in_ctp_file2.po
>  -
>  /app/locale/fin/LC_MESSAGES/common.po
>  /app/locale/fin/LC_MESSAGES/msgid_will_use_in_ctp_file1.po
>  /app/locale/fin/LC_MESSAGES/msgid_will_use_in_ctp_file2.po
>
>  Because, the system we are developing will must support more than 3
>  languages and the static contents are huge. So if i can use multiple
>  files rather than /app/locale/eng/LC_MESSAGES/default.po
>  than it will be more easier for me to maintain, update and develop.
>
>  Please help me on this regards..  any resource/links will be
>  appritiate.
>
>  Thanks in advance,
>  Neeocis
>
>  >
>

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



Query Question

2008-04-02 Thread dan

Games HABTM Categories

I need to $this->paginate('Game'); where Category.name = 'puzzle'

Is this possible?  Tried using bindModel but can't figure it out.

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



autosave implementation: using onChange to click $ajax->submit

2008-04-02 Thread [EMAIL PROTECTED]

I set up a form to autosave with ajax by using an elements onChange()
function to click the $ajax->submit() element. This seems like the
easiest to implement solution to me but will this be overtaxing the
server with elements like textareas which would change with each
keystroke? If so, any ideas on how to better implement this? I don't
expect more than a dozen people to use this at once.

Thanks,
Dave
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



hit counter or custom annalytics

2008-04-02 Thread For Sale Sticker
Hi -
I am trying to build a simple site tracking system to gather some simple 
analytics on a site we are using.
I can not use a third party analytics system like Google Analytics 
because the site is on an internal network only and we need to track 
some site specific information, such as user.

I did have a chunk of code in the app_controller inside of the 
beforeFilter() function.
It did just what I wanted except on some actions it was executed more 
than once, and on some controllers when it's own beforeFilter function 
was added - that bypassed my tracking code in the app_controller.

Any ideas on how to accomplish this?



-

Sell your car easy - ForSaleSticker.com 


--~--~-~--~~~---~--~~
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: Problems with Acl/Auth

2008-04-02 Thread mbavio

I was doing exactly the same thing you want to do:

function isAuthorized() {
if ($this->Acl->check(array('foreign_key' => $this->Auth->user('id'),
'model' => 'User'),

inflector::camelize($this->name).'/'.$this->params['action'],
'*')) {
return true;
}
else {
return false;
}

and it works. However, it doesnt seem like the correct aproach to Auth/
ACL. I´m trying to change it, but in case you want to continue with
this way, ask me if you need some help.

Cheers,
mbavio

On Apr 1, 7:50 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I decided on taking a different route and cutting out the ACL all
> together. I changed the Auth system to be based on the controller
> rather then actions
>
> //$this->Auth->authorize = 'actions';
> $this->Auth->authorize = 'controller';
>
> This allows me to roll my own system using the
> ::isAuthorized() function in each controller. For my
> purposes this seems to be doing the trick.
>
> thanks for the help.
>
> On Mar 31, 10:11 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]>
> wrote:
>
> > Get the SQL queries cake is making, post the here if that doesn't
> > clarify the issue. Also check with an updated version of cake, there
> > are some ACL related bugs that have been fixed in the branch. It will
> > useful to help you, if  you include your Auth setup.
>
> > On Mon, Mar 31, 2008 at 10:26 PM, Sam Sherlock <[EMAIL PROTECTED]> wrote:
> > > AFAIK login and login are special functions, that don't require acl 
> > > branches
> > > (is it fair to call them that, part of a tree)
>
> > > it won't solve the issue, are other controlers working with acl?
>
> > > On 31/03/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > I have spent hours and hours struggling with the ACL. It is about the
> > > > most frustrating thing I have worked with. I have to use it because
> > > > its inheritable permissions (if anyone has any alternatives to use I
> > > > am all ears). Anyway, this is what my trees look like:
>
> > > > Welcome to CakePHP v1.2.0.6311 beta Console
> > > > ---
> > > > Aco tree:
> > > > ---
> > > >   [1]ROOT
>
> > > > [2]Users
>
> > > >   [3]menu
>
> > > >   [6]logout
>
> > > > [4]Pages
>
> > > > [5]Candidates
>
> > > >   [8]index
>
> > > > [7]Groups
>
> > > > -
> > > > Aro tree:
> > > > -
> > > >   [1]Admin
>
> > > > [2]
>
> > > > [3]
>
> > > >   [4]Clients
>
> > > > [5]Client1
>
> > > >   [6]client1user
>
> > > > [7]Client2
>
> > > >   [8]client2user
> > > > ---
> > > > So far so good. Then I grant access for Clients to index, and I check
> > > > that client1user successfully inherited permission, which it does.
>
> > > > >cake acl grant Clients index all
> > > > >cake acl check client1user index all
> > > > >>>client1user is allowed.
>
> > > > Then when I login as client1user and go to /Candidates/index, I get
> > > > redirected because the Acl thinks I don't have permission.
>
> > > > Does anyone have any idea why this is happening and what I can do
> > > > about it??
>
> > > > *frustrated*
>
> > > > Thanks in advance!
> > > > -Eric
--~--~-~--~~~---~--~~
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: beforeSave & behaviours

2008-04-02 Thread Sam Sherlock
yep sweet!!   needs some refinement but sweet it works.

happy baking - S

On 02/04/2008, grigri <[EMAIL PROTECTED]> wrote:
>
>
> If you can assume that the settings in actsAs are valid, you can do
> this:
>
> class Photo extends AppModel {
>   var $actsAs = array(
> 'Upload' => array('some' => 'settings')
>   );
>
>
>   function save($data = null, $validate = true, $fieldList = array())
> {
>
> // Prepare new config
> $config = array_merge(
>   $this->actsAs['Upload'],
>   array(
> 'src' => array(
>
>   'dir' => '/' . $this->getEventSlug($this->data['Photo']
> ['event_id'])
>
> )
>   )
> );
> // Detach behavior
> $this->Behaviors->detach('Upload');
> // Re-attach with new params
> $this->Behaviors->attach('Upload', $config);
> // Continue saving normally
>
> return parent::save($data, $validate, $fieldList);
>   }
> }
>
>
> On Apr 2, 3:32 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> > but from where do I call the attach detach?
> >
> >  here is what I am planning to try
> >
> >- read the setting of Upload behavior to an array
> >- update the dir setting
> >- detach the set behaviour
> >- attach the modified one
> >
> > where do I use the attach / detach behaviour calls??
> >
>
> > On 02/04/2008, grigri <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > Since the introduction of the behaviors collection, I don't think the
> > > code in that article will work as it relies on the behavior objects
> > > being properties of the model, which they aren't any more.
> >
> > > Behaviors can be attached/detached at runtime with the `attach` and
> > > `detach` methods, but reconfiguring depends entirely on the behavior
> > > implementation itself.
> >
> > > On Apr 2, 2:40 pm, "[EMAIL PROTECTED]"
> >
> > > <[EMAIL PROTECTED]> wrote:
> > > > This might be useful to you. It allows you reconfigure the
> behaviours
> > > > as well.
> >
> > > >
> http://www.sanisoft.com/blog/2007/06/26/attach-detach-behaviors-at-ru...
> >
> > > > Simonhttp://www.simonellistonball.com/
> >
>

--~--~-~--~~~---~--~~
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: Is cakePHP alive?

2008-04-02 Thread mbavio

Troll fear? :)

Cheers,
mbavio

On Apr 1, 7:43 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Thanks :)
> Now I can be happy again ;)
>
> 
>
> Yes, in error report Zend Optimizer is mentioned :(
>
> On 1 Bal, 08:09, Grant Cox <[EMAIL PROTECTED]> wrote:
>
> > I'll bet that what is actually crashing apache is the Zend Optimizer
> > extension for PHP.
>
> > On Apr 1, 11:17 am, Vangel <[EMAIL PROTECTED]> wrote:
>
> > > The topic sounded like a troller post, I guess it served its purpose.
> > > Hack the cake core if you believe its messing up. Thats what Open
> > > Source is for.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Managing requirements with CakePHP

2008-04-02 Thread Sake

Hi Everyone,

I thought I'd make a specific post for this. I'm interested in
starting a CakePHP project.

I've posted the details in my cakeforge project here:
http://cakeforge.org/forum/forum.php?thread_id=16937&forum_id=790

I'm curious if anybody has any feedback on my idea and whether or not
anyone would be interested in joining.

Thanks for listening!

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



Array of named arguments(?) - pagination related

2008-04-02 Thread R. Rajesh Jeba Anbiah

When trying more than one pagination on a page, the pagination is
getting weird as it's resetting with the single named args (like page:
1). So, is there anyway to mention the array of named argument--so as
to attach it to the model? (say, model[page]:1 or so?)

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/
--~--~-~--~~~---~--~~
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: Let's help each other!

2008-04-02 Thread Sake

Thanks for approving my project!

Basically, here is the details: 
http://cakeforge.org/forum/forum.php?thread_id=16937&forum_id=790

If anybody is interested to help, it would be much appreciated. I'd
also like some feedback on my idea.

On Apr 1, 6:30 pm, Sake <[EMAIL PROTECTED]> wrote:
> That's wierd, can't find anything in my email... I guess when we find
> it (i'll keep asking in the IRC channel) I'll post the link to
> actually see if anybody's interested.
>
> On Apr 1, 6:14 pm, Gwoo <[EMAIL PROTECTED]> wrote:
>
>
>
> > irc://irc.freenode.net/cakephp
> > There are currently no projects awaiting approval on cakeforge.- Hide 
> > quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Discussion on cakephp-official-resources

2008-04-02 Thread R. Rajesh Jeba Anbiah

Off topic, but I'm just interested to know how have you made this
sticky?
--~--~-~--~~~---~--~~
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: beforeSave & behaviours

2008-04-02 Thread grigri

If you can assume that the settings in actsAs are valid, you can do
this:

class Photo extends AppModel {
  var $actsAs = array(
'Upload' => array('some' => 'settings')
  );

  function save($data = null, $validate = true, $fieldList = array())
{
// Prepare new config
$config = array_merge(
  $this->actsAs['Upload'],
  array(
'src' => array(
  'dir' => '/' . $this->getEventSlug($this->data['Photo']
['event_id'])
)
  )
);
// Detach behavior
$this->Behaviors->detach('Upload');
// Re-attach with new params
$this->Behaviors->attach('Upload', $config);
// Continue saving normally
return parent::save($data, $validate, $fieldList);
  }
}

On Apr 2, 3:32 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> but from where do I call the attach detach?
>
>  here is what I am planning to try
>
>- read the setting of Upload behavior to an array
>- update the dir setting
>- detach the set behaviour
>- attach the modified one
>
> where do I use the attach / detach behaviour calls??
>
> On 02/04/2008, grigri <[EMAIL PROTECTED]> wrote:
>
>
>
> > Since the introduction of the behaviors collection, I don't think the
> > code in that article will work as it relies on the behavior objects
> > being properties of the model, which they aren't any more.
>
> > Behaviors can be attached/detached at runtime with the `attach` and
> > `detach` methods, but reconfiguring depends entirely on the behavior
> > implementation itself.
>
> > On Apr 2, 2:40 pm, "[EMAIL PROTECTED]"
>
> > <[EMAIL PROTECTED]> wrote:
> > > This might be useful to you. It allows you reconfigure the behaviours
> > > as well.
>
> > >http://www.sanisoft.com/blog/2007/06/26/attach-detach-behaviors-at-ru...
>
> > > Simonhttp://www.simonellistonball.com/
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Pagination within a model

2008-04-02 Thread rikdc

Hello,

This is more a conceptual question. I thought the "best" place to
perform a search on the database would have been within a model so a
findBySearch() method exists. But this isn't too hot with linking in
with the controller and pagination.

Unless I had a Model->constructSearchParameters() or even Model-
>findBySearch($controller) .. but yik.

Any thoughts or inspiration from people here?

Cheers,
R
--~--~-~--~~~---~--~~
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: beforeSave & behaviours

2008-04-02 Thread Sam Sherlock
but from where do I call the attach detach?

 here is what I am planning to try


   - read the setting of Upload behavior to an array
   - update the dir setting
   - detach the set behaviour
   - attach the modified one

where do I use the attach / detach behaviour calls??

On 02/04/2008, grigri <[EMAIL PROTECTED]> wrote:
>
>
> Since the introduction of the behaviors collection, I don't think the
> code in that article will work as it relies on the behavior objects
> being properties of the model, which they aren't any more.
>
> Behaviors can be attached/detached at runtime with the `attach` and
> `detach` methods, but reconfiguring depends entirely on the behavior
> implementation itself.
>
> On Apr 2, 2:40 pm, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > This might be useful to you. It allows you reconfigure the behaviours
> > as well.
> >
>
> > http://www.sanisoft.com/blog/2007/06/26/attach-detach-behaviors-at-ru...
> >
> > Simonhttp://www.simonellistonball.com/
>
> >
>

--~--~-~--~~~---~--~~
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: beforeSave & behaviours

2008-04-02 Thread grigri

Since the introduction of the behaviors collection, I don't think the
code in that article will work as it relies on the behavior objects
being properties of the model, which they aren't any more.

Behaviors can be attached/detached at runtime with the `attach` and
`detach` methods, but reconfiguring depends entirely on the behavior
implementation itself.

On Apr 2, 2:40 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> This might be useful to you. It allows you reconfigure the behaviours
> as well.
>
> http://www.sanisoft.com/blog/2007/06/26/attach-detach-behaviors-at-ru...
>
> Simonhttp://www.simonellistonball.com/
--~--~-~--~~~---~--~~
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: beforeSave & behaviours

2008-04-02 Thread [EMAIL PROTECTED]

This might be useful to you. It allows you reconfigure the behaviours
as well.

http://www.sanisoft.com/blog/2007/06/26/attach-detach-behaviors-at-run-time-in-cakephp-models/

Simon
http://www.simonellistonball.com/
--~--~-~--~~~---~--~~
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: beforeSave & behaviours

2008-04-02 Thread Sam Sherlock
thanks for the information guys.

On 02/04/2008, grigri <[EMAIL PROTECTED]> wrote:
>
>
> Another thing, the actsAs array is only queried when the behavior
> collection is created. Changing it won't (AFAIK) affect the already-
> created behavior. Not 100% sure of the official method of configuring
> at runtime.
>
> How about overriding the save method directly?
>
> class Photo extends AppModel {
>   function save($data = null, $validate = true, $fieldList = array())
> {
> $this->Behaviors->Upload->settings[$this->alias]['src']['dir'] =
>
> '/' . $this->getEventSlug($this->data['Photo']['event_id']);
>
> return parent::save($data, $validate, $fieldList);
>   }
> }
>
> (Note that depending on the behavior you use, you might need to use
> $this->name instead of $this->alias - check how the config is keyed in
> the behavior setup method)
>
> On Apr 2, 1:35 pm, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > Another way to do it is to write a behaviour which does the alteration
> > and include that in the actsAs array before the upload behaviour. They
> > are run in order, so the upload behaviour will see what your behaviour
> > did. That way you don't need to mess with the 3rd party code.
> >
>
> > Simonhttp://www.simonellistonball.com/
>
> >
> > On Apr 2, 1:30 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> >
> > > yep just seen that.  Guess that means no then can't be done.
> >
> > > Unless customise the behaviour.
> >
> > > I guess there is a reason for behaviors beforeSave being called before
> the
> > > models beforeSave
> >
> > > On 02/04/2008, grigri <[EMAIL PROTECTED]> wrote:
> >
> > > > Behavior beforeSave() callbacks are called before the Model's
> > > > beforeSave() callback.
> >
> > > > On Apr 2, 12:43 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> > > > > I have and Event Model that hasMany Photos
> >
> > > > > I am using an upload behaviour and wish to save photos in a
> directory by
> > > > the
> > > > > event Slug
> >
> > > > > the below code is in the photo model the actsAs infor is updated
> but the
> > > > new
> > > > > information is ignored
> >
> > > > > function beforeSave() {
> > > > > $this->actsAs['Upload']['src']['dir'].= '/' .
> > > > > $this->getEventSlug($this->data['Photo']['event_id']);
> > > > > return true;
> > > > > }
> >
> > > > > how can I get this to work?
> >
> > > > > - S
> >
>

--~--~-~--~~~---~--~~
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: retrieving aggregated data from the model

2008-04-02 Thread Chris Hartjes

On Sun, Mar 30, 2008 at 3:51 PM, acoustic_overdrive
<[EMAIL PROTECTED]> wrote:
>
>  What's the recommended way to use aggregate functions like SUM()?
>
>  I'm building an accounting application that so far has three models:
>
>  - Client hasMany Transaction
>  - Transaction hasMany TransactionItem, belongsTo Client
>  - TransactionItem belongsTo Transaction
>
>  The total value of a Transaction (an invoice or receipt) is the sum of
>  its related TransactionItems, which each have a monetary value.
>
>  When listing transactions I also want to know the total value of each
>  and so I could do this with some SQL like this:
>
>  SELECT
> SUM(TransactionItem.amount),
> Transaction.title
> FROM transaction_items AS TransactionItem
> LEFT JOIN transactions AS Transaction
> ON TransactionItem.transaction_id = Transaction.id
>  GROUP BY Transaction.id

Have you tried setting (SUM(TransactionItem.amount) as a field in the
fields parameter?  Also, there's a little trick where you have to pass
GROUP BY to the model via the conditions array

$conditions = array('1=1 GROUP BY Transaction.id');
$fields = array('SUM(TransactionItem.amount) as amount', 'Transaction.title'))

$results = $this->TransactionItem->find('all', compact('conditions', 'fields));

Hope that helps.

-- 
Chris Hartjes
Internet Loudmouth
Motto for 2008: "Moving from herding elephants to handling snakes..."
@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?hl=en
-~--~~~~--~~--~--~---



Re: beforeSave & behaviours

2008-04-02 Thread grigri

Another thing, the actsAs array is only queried when the behavior
collection is created. Changing it won't (AFAIK) affect the already-
created behavior. Not 100% sure of the official method of configuring
at runtime.

How about overriding the save method directly?

class Photo extends AppModel {
  function save($data = null, $validate = true, $fieldList = array())
{
$this->Behaviors->Upload->settings[$this->alias]['src']['dir'] =
'/' . $this->getEventSlug($this->data['Photo']['event_id']);
return parent::save($data, $validate, $fieldList);
  }
}

(Note that depending on the behavior you use, you might need to use
$this->name instead of $this->alias - check how the config is keyed in
the behavior setup method)

On Apr 2, 1:35 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Another way to do it is to write a behaviour which does the alteration
> and include that in the actsAs array before the upload behaviour. They
> are run in order, so the upload behaviour will see what your behaviour
> did. That way you don't need to mess with the 3rd party code.
>
> Simonhttp://www.simonellistonball.com/
>
> On Apr 2, 1:30 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
>
> > yep just seen that.  Guess that means no then can't be done.
>
> > Unless customise the behaviour.
>
> > I guess there is a reason for behaviors beforeSave being called before the
> > models beforeSave
>
> > On 02/04/2008, grigri <[EMAIL PROTECTED]> wrote:
>
> > > Behavior beforeSave() callbacks are called before the Model's
> > > beforeSave() callback.
>
> > > On Apr 2, 12:43 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> > > > I have and Event Model that hasMany Photos
>
> > > > I am using an upload behaviour and wish to save photos in a directory by
> > > the
> > > > event Slug
>
> > > > the below code is in the photo model the actsAs infor is updated but the
> > > new
> > > > information is ignored
>
> > > > function beforeSave() {
> > > > $this->actsAs['Upload']['src']['dir'].= '/' .
> > > > $this->getEventSlug($this->data['Photo']['event_id']);
> > > > return true;
> > > > }
>
> > > > how can I get this to work?
>
> > > > - S
--~--~-~--~~~---~--~~
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: beforeSave & behaviours

2008-04-02 Thread [EMAIL PROTECTED]

Another way to do it is to write a behaviour which does the alteration
and include that in the actsAs array before the upload behaviour. They
are run in order, so the upload behaviour will see what your behaviour
did. That way you don't need to mess with the 3rd party code.

Simon
http://www.simonellistonball.com/

On Apr 2, 1:30 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> yep just seen that.  Guess that means no then can't be done.
>
> Unless customise the behaviour.
>
> I guess there is a reason for behaviors beforeSave being called before the
> models beforeSave
>
> On 02/04/2008, grigri <[EMAIL PROTECTED]> wrote:
>
>
>
> > Behavior beforeSave() callbacks are called before the Model's
> > beforeSave() callback.
>
> > On Apr 2, 12:43 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> > > I have and Event Model that hasMany Photos
>
> > > I am using an upload behaviour and wish to save photos in a directory by
> > the
> > > event Slug
>
> > > the below code is in the photo model the actsAs infor is updated but the
> > new
> > > information is ignored
>
> > > function beforeSave() {
> > > $this->actsAs['Upload']['src']['dir'].= '/' .
> > > $this->getEventSlug($this->data['Photo']['event_id']);
> > > return true;
> > > }
>
> > > how can I get this to work?
>
> > > - S
--~--~-~--~~~---~--~~
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: beforeSave & behaviours

2008-04-02 Thread Sam Sherlock
yep just seen that.  Guess that means no then can't be done.

Unless customise the behaviour.

I guess there is a reason for behaviors beforeSave being called before the
models beforeSave


On 02/04/2008, grigri <[EMAIL PROTECTED]> wrote:
>
>
> Behavior beforeSave() callbacks are called before the Model's
> beforeSave() callback.
>
>
> On Apr 2, 12:43 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> > I have and Event Model that hasMany Photos
> >
> > I am using an upload behaviour and wish to save photos in a directory by
> the
> > event Slug
> >
> > the below code is in the photo model the actsAs infor is updated but the
> new
> > information is ignored
> >
> > function beforeSave() {
> > $this->actsAs['Upload']['src']['dir'].= '/' .
> > $this->getEventSlug($this->data['Photo']['event_id']);
> > return true;
> > }
> >
> > how can I get this to work?
> >
> > - S
>
> >
>

--~--~-~--~~~---~--~~
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: mutliple domains on 1 site

2008-04-02 Thread TWIOF

Might be easier to do it in the app_controller with a statement to
setect the appropriate layour via:

var $layout = 'layout_name';

On Apr 2, 12:03 pm, Barry <[EMAIL PROTECTED]> wrote:
> How do I set a different layout in the bootstrap.php file?
>
> On Apr 1, 1:02 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>
> > >  Another more elegant, and much more Cakey approach would be to set the
> > >  viewPaths in the bootstrap based on the $_SERVER['HTTP_HOST'].
>
> > Or (still based on $_SERVER['HTTP_HOST']) set a different layout, or
> > use ThemeView with the same trick again.
--~--~-~--~~~---~--~~
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: beforeSave & behaviours

2008-04-02 Thread grigri

Behavior beforeSave() callbacks are called before the Model's
beforeSave() callback.

On Apr 2, 12:43 pm, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> I have and Event Model that hasMany Photos
>
> I am using an upload behaviour and wish to save photos in a directory by the
> event Slug
>
> the below code is in the photo model the actsAs infor is updated but the new
> information is ignored
>
> function beforeSave() {
> $this->actsAs['Upload']['src']['dir'].= '/' .
> $this->getEventSlug($this->data['Photo']['event_id']);
> return true;
> }
>
> how can I get this to work?
>
> - S
--~--~-~--~~~---~--~~
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: ajax->updater calls wrong action

2008-04-02 Thread da_student

and you're right with the asynchronous, thanx for that. is it
possible, that i don't need the valScripts either? (works without
right now, so I'll just give it a shot)

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



Help: is it feasible to use multiple .po files?

2008-04-02 Thread neeocis

Dear all,
I am trying to figure out that is it possible and or feasible to use
multiple .po files for each language like...
/app/locale/eng/LC_MESSAGES/common.po
/app/locale/eng/LC_MESSAGES/msgid_will_use_in_ctp_file1.po
/app/locale/eng/LC_MESSAGES/msgid_will_use_in_ctp_file2.po
-
/app/locale/fin/LC_MESSAGES/common.po
/app/locale/fin/LC_MESSAGES/msgid_will_use_in_ctp_file1.po
/app/locale/fin/LC_MESSAGES/msgid_will_use_in_ctp_file2.po

Because, the system we are developing will must support more than 3
languages and the static contents are huge. So if i can use multiple
files rather than /app/locale/eng/LC_MESSAGES/default.po
than it will be more easier for me to maintain, update and develop.

Please help me on this regards..  any resource/links will be
appritiate.

Thanks in advance,
Neeocis

--~--~-~--~~~---~--~~
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: ajax->updater calls wrong action

2008-04-02 Thread da_student

hey,
thanks for your answer.
but it didn't work either.
I found out, that it has something to do with the variables, I'm
handing over (like: controller/action/var). If I don't have a var, the
link doesn't work, if I have one, it works. So my solution right now
is to just call "\'../tasktable/1\'", and just ignore the var in the
action. The same with "tasklist" (which is the action/view with the
tasktable-div inside) also with a var. that works fine right now...
well, thanks again.


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



Setup Cake on Windows IIS server with other non-Cake sites

2008-04-02 Thread joeB

My company has just launched a new Cake website and things worked well
(using Helicon ISAPI_rewrite on Windows 2003 server running IIS 6.0).

Problem is we have legacy sites that also need to run on this server
until I can get them implemented in Cake.  I'm having problems setting
up these non-cake sites to run in tandem with the Cake site.

Directory structure is setup as follows:

C:\webapps
\cake<-  Cake core files here
\website<-  app files here (\config,
\controllers, \models, etc)

C:\Inetpub\wwwroot
\website<-  webroot here (\css, \img,
\js, etc)
\portfolio<- non Cake legacy PHP
website


Rewrite rules in httpd.ini file are:
RewriteCond URL (?!/js/|/img/|/files/|/css/|/portfolio/).*
RewriteRule (.*?\.php)(\?[^/]*)?/([^/]*)/(.*) $1(?2$2&:\?url=/
$3/$4)
RewriteCond URL (?!/js/|/img/|/files/|/css/|/portfolio/).*
RewriteRule ^/(.*) /webapp/index.php?url=/$1 [L]
RewriteRule /(.*) /webapp/$1

I've setup a virtual directory webapp that points to C:\webapps
\website folder.

Trying to access Cake website via http://www.mysite.com/website  while
also being able to access non-Cake site at http://www.mysite.com/portfolio

I'm new to Cake (and rewrite for that matter) and I've tried banging
my head on this for days.  Anybody have an ideas or can tell me what
I'm doing wrong?

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



beforeSave & behaviours

2008-04-02 Thread Sam Sherlock
I have and Event Model that hasMany Photos

I am using an upload behaviour and wish to save photos in a directory by the
event Slug

the below code is in the photo model the actsAs infor is updated but the new
information is ignored

function beforeSave() {
$this->actsAs['Upload']['src']['dir'].= '/' .
$this->getEventSlug($this->data['Photo']['event_id']);
return true;
}


how can I get this to work?

- S

--~--~-~--~~~---~--~~
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: SSL enable for some site sections

2008-04-02 Thread djiize

you can setup a callback with:
$this->Security->blackHoleCallback = 'switch2secure';

and in your controller:
function switch2secure($param) { // param will be array('secure') in
your case
  // redirect to https
}

On 2 avr, 11:49, Kusok <[EMAIL PROTECTED]> wrote:
> I need to enable https for some site sections. I am using the
> SecurityComponent::requireSecure to define the actions I need to be
> secured. The question now is how to switch from http to https when
> that action is triggered.
> So I have a login controller and an index action, when that action is
> hit with http I want it to switch to https. How could this be done?
--~--~-~--~~~---~--~~
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: break the code for controller file

2008-04-02 Thread [EMAIL PROTECTED]

You can't just include procedural functions in the middle of a class
and expect them to be methods. Includes are not a pre-compiler
directive. What you'll need to do is to define every function at least
in your controller class file, then you could in theory include the
contents of that function. However, this would be slightly crazy, and
lead to a lot of includes (one per function that you extracted).

Also, if the code really can't be moved to the models / refactored to
generalize into a superclass, or reusable methods then there is
probably something wrong with your design. The main reason to split
things like controllers up would be to allow for reuse (see
components).

Bear in mind as well that you have to have a pretty compelling reason
to split the file up. Every include you use will increase the parse
time, and add overhead to your application. PHP is not after all a
compiled language. If your problem is code manageability you may be
better served by getting an editor that folds functions (eg eclipse
pdt).

Simon
http://www.simonellistonball.com/
--~--~-~--~~~---~--~~
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: mutliple domains on 1 site

2008-04-02 Thread Barry

How do I set a different layout in the bootstrap.php file?

On Apr 1, 1:02 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> >  Another more elegant, and much more Cakey approach would be to set the
> >  viewPaths in the bootstrap based on the $_SERVER['HTTP_HOST'].
>
> Or (still based on $_SERVER['HTTP_HOST']) set a different layout, or
> use ThemeView with the same trick again.
--~--~-~--~~~---~--~~
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: break the code for controller file

2008-04-02 Thread manuj bansal
I have tried it down by making simple php file (quality.php) and
then add functions in quality.php from animals controller
then i use include("quality.php") in animals controller
but it doesn't work

On Wed, Apr 2, 2008 at 4:12 PM, Adam Royle <[EMAIL PROTECTED]> wrote:

>
> Well, CakePHP is just regular PHP, so you can still do includes or
> whatever you want. What is your controller code doing that takes so
> many lines of code?
>
> Adam
>
> On Apr 2, 8:28 pm, mans <[EMAIL PROTECTED]> wrote:
> > but these functions are not reusable and I am also not interesting in
> > making components.
> > Is their not some solution like (as in simple php we use include or
> > require) we made some file and include it in controller ?
> >
> > On Apr 1, 5:21 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> >
> > > Well, two things:
> >
> > > 1. Fat models, skinny controllers.
> > > 2. Create and use components.
> >
> > > On Tue, Apr 1, 2008 at 9:07 AM, mans <[EMAIL PROTECTED]> wrote:
> >
> > > >  My controller files code has gone very long. I want to break it in
> > > >  different files.
> > > >  thanks in advance
> >
>

--~--~-~--~~~---~--~~
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: break the code for controller file

2008-04-02 Thread Adam Royle

Well, CakePHP is just regular PHP, so you can still do includes or
whatever you want. What is your controller code doing that takes so
many lines of code?

Adam

On Apr 2, 8:28 pm, mans <[EMAIL PROTECTED]> wrote:
> but these functions are not reusable and I am also not interesting in
> making components.
> Is their not some solution like (as in simple php we use include or
> require) we made some file and include it in controller ?
>
> On Apr 1, 5:21 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>
> > Well, two things:
>
> > 1. Fat models, skinny controllers.
> > 2. Create and use components.
>
> > On Tue, Apr 1, 2008 at 9:07 AM, mans <[EMAIL PROTECTED]> wrote:
>
> > >  My controller files code has gone very long. I want to break it in
> > >  different files.
> > >  thanks in advance
--~--~-~--~~~---~--~~
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: mutliple domains on 1 site

2008-04-02 Thread TWIOF

Thanks Simon,

I was arriving at this conclustion myself.

I guess I'd use $_SERVER(http_host) to select $useDbConfig in the app
model, and set a default files path in app controller.

Managing the whole thing from a "root" user controll panel might be
tricky. Unless when loged in as root you could pass relevant database
selector via a url to the app model.

Does this all  make sense, or could I be missing a better solution?

TWIOF

On Apr 2, 10:28 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Another thing we use here is dirty hack includes in config files:
>
> This is my standard database.php file:
>  switch (strtolower($_SERVER['SERVER_NAME'])) {
> case 'site.local':
> case 'site':
> include APP . DS . 'config' . DS . 'database_local.php';
> break;
> case 'test.site.example.com':
> include APP . DS . 'config' . DS . 'database_test.php';
> break;
> default:
> include APP . DS . 'config' . DS . 'database_live.php';
> break;}
>
> ?>
>
> Which we use to save having to mess about with config on deployment. A
> similar solution would work for TWIOF's case, and may be the simplest
> option.
>
> Simonhttp://www.simonellistonball.com/
--~--~-~--~~~---~--~~
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: break the code for controller file

2008-04-02 Thread mans

but these functions are not reusable and I am also not interesting in
making components.
Is their not some solution like (as in simple php we use include or
require) we made some file and include it in controller ?


On Apr 1, 5:21 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> Well, two things:
>
> 1. Fat models, skinny controllers.
> 2. Create and use components.
>
> On Tue, Apr 1, 2008 at 9:07 AM, mans <[EMAIL PROTECTED]> wrote:
>
> >  My controller files code has gone very long. I want to break it in
> >  different files.
> >  thanks in advance
--~--~-~--~~~---~--~~
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: mutliple domains on 1 site

2008-04-02 Thread Stephen Orr

For the database side all I use is a constructor DATABASE_CONFIG(),
which checks whether or not the site is running on localhost. If it
is, I use the settings I've previously defined in the file (following
the same convention as the default setup).

I'm working on expanding my overall concept at this point - the sites
have become plugins, which gives me the separation of functionality
while allowing me to share some simple core functionality. I just need
to figure out a way to get Cake to route to the different plugins
based on the domain name. At this point I'm thinking this would be
something easiest done via AppController, maybe I could reuse the
component code. I'm just not sure yet how that works with routing.

I'll post my existing (now abandoned) code up in the bin later on, I
just need to get my head round this bit first.

Steve

On Apr 2, 10:28 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Another thing we use here is dirty hack includes in config files:
>
> This is my standard database.php file:
>  switch (strtolower($_SERVER['SERVER_NAME'])) {
> case 'site.local':
> case 'site':
> include APP . DS . 'config' . DS . 'database_local.php';
> break;
> case 'test.site.example.com':
> include APP . DS . 'config' . DS . 'database_test.php';
> break;
> default:
> include APP . DS . 'config' . DS . 'database_live.php';
> break;}
>
> ?>
>
> Which we use to save having to mess about with config on deployment. A
> similar solution would work for TWIOF's case, and may be the simplest
> option.
>
> Simonhttp://www.simonellistonball.com/
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



SSL enable for some site sections

2008-04-02 Thread Kusok

I need to enable https for some site sections. I am using the
SecurityComponent::requireSecure to define the actions I need to be
secured. The question now is how to switch from http to https when
that action is triggered.
So I have a login controller and an index action, when that action is
hit with http I want it to switch to https. How could this be done?
--~--~-~--~~~---~--~~
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: retrieving aggregated data from the model

2008-04-02 Thread grigri

> When listing transactions I also want to know the total value of each
> and so I could do this with some SQL like this:
>
> SELECT
> SUM(TransactionItem.amount),
> Transaction.title
> FROM transaction_items AS TransactionItem
> LEFT JOIN transactions AS Transaction
> ON TransactionItem.transaction_id = Transaction.id
> GROUP BY Transaction.id
>
> but I'm not sure how to go about this using cake model methods.

$this->Transaction->bindModel(array('hasOne' =>
array('TransactionItem')));
$data = $this->Transaction->find('all', array(
  'recursive' => 0,
  'fields' => array('Transaction.title', 'SUM(TransactionItem.amount)
AS total'),
  'conditions' => '1=1 GROUP BY Transaction.id'
));

> Should I be putting something in finderQuery in the hasMany
> association?

No. This is unrelated to what you want to do.

> Or I could use this custom SQL in a Model->query() - not sure if this
> is the ideal?

You can do, but it's not necessary.

> Or should I simply sum the values using PHP and not ask the database
> to do this?

This would be easier except when you need to paginate and order by the
aggregate. Might as well make the database work for a living.

> Also, when I tested the above as SQL in a Model->query(), I noticed
> that the SUM() column was orphaned in the result array. Is there any
> way to make it become part of the Transaction key of the result array?
> "SUM(TransactionItem.amount) AS Transaction.total" doesn't seem to
> work.

Depends on your database. If you're using postgres, you can do

'SUM(TransactionItem.amount) AS Transaction__total'

Since you're only returning 2 fields, just use Set::combine() to
return an associative array:

$data = Set::combine($data, '{n}.Transaction.title', '{n}.0.total');

If you really want to rename the field in-place, see the links in this
thread:

http://groups.google.com/group/cake-php/browse_thread/thread/9c024a328b182a26/

hth
grigri

--~--~-~--~~~---~--~~
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: mutliple domains on 1 site

2008-04-02 Thread [EMAIL PROTECTED]

Another thing we use here is dirty hack includes in config files:

This is my standard database.php file:


Which we use to save having to mess about with config on deployment. A
similar solution would work for TWIOF's case, and may be the simplest
option.

Simon
http://www.simonellistonball.com/
--~--~-~--~~~---~--~~
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: mutliple domains on 1 site

2008-04-02 Thread [EMAIL PROTECTED]

We did something a bit like this in the past. It wasn't actually based
on host name, but could easily be adapted. Basically, we had a
reporting application based on an externally populated database
(proving Cake can even work - sort of - without the convention part
and still be helpful).

Each customer had to have their own database. We create a generic,
empty template database containing only the table definitions, which
Cake used to create models, we then had a component to replace the
current default database connection with the customer specific one
based on the user (Auth->user()):
 $db = ConnectionManager::getDataSource('default');
 $db->reconnect('customerDatabase');

Each customer database was then defined in app/config/database.php's
DATABASE_CONFIG.

This worked, but is not optimal (additional unnecessary database
connections, and not the quickest solution, technically we could get
around that with a lazy connection patch on the DESCRIBE methods,
allowing cake's model caching to take over, and avoid the additional
'template database' connection, but this would mean a fair amount of
messing).

If anyone can think of a better way of doing it that would be great to
hear. I suppose a custom datasource might be the answer, but it would
probably make more sense for my proposed patch to enable something
like the router to control the config path and well as, say views. At
which point it starts to look more like a virtual host system for
cake.

Anyone have any comments? It seems like this could be a useful
addition for a number of cases.

Simon
http://www.simonellistonball.com/
--~--~-~--~~~---~--~~
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: RSS feeds in cake

2008-04-02 Thread anupom

Hi Novice,

The method 1 should work fine as well. Which Cake version are you
using?

On Mar 28, 2:35 am, "Novice Programmer" <[EMAIL PROTECTED]>
wrote:
> Hello Anupom,
>
> i tried this tutorial only.. method 2 works for me.. but i can't get method
> 1 to work.. though finally i decided that method 2 is the way i want to go
> so my problem resolved itself.. :)
>
> thanks.
>
>
>
> On Thu, Mar 27, 2008 at 10:54 PM, Anupom <[EMAIL PROTECTED]> wrote:
> > You can try out this tutorial
> >http://anupom.wordpress.com/2008/03/12/rss-in-cakephp-12/
>
> > On Thu, Mar 27, 2008 at 8:13 PM, Samuel DeVore <[EMAIL PROTECTED]> wrote:
>
> > > is your rss view in a folder like /views/entities/rss/view.ctp
> > > and did you make a rss layout like
> > > /views/layouts/rss/default.ctp
>
> > > Sam D
>
> > > On Wed, Mar 26, 2008 at 11:43 PM, Novice Programmer
> > > <[EMAIL PROTECTED]> wrote:
> > > > Hello Tarique,
>
> > > > its the error that cake throws when it is not able to find layout and
> > > tries
> > > > to use default layout.
>
> > > > Thanks.
>
> > > > On 3/27/08, Dr. Tarique Sani <[EMAIL PROTECTED]> wrote:
>
> > > > > On Thu, Mar 27, 2008 at 9:26 AM, Novice Programmer
> > > > > <[EMAIL PROTECTED]> wrote:
>
> > > > > > but i get cake parser error.
>
> > > > > What is the parse error?
>
> > > > > Tarique
>
> > > > > --
> > > > > =
> > > > > Cheesecake-Photoblog:http://cheesecake-photoblog.org
> > > > > PHP for E-Biz:http://sanisoft.com
> > > > > =
>
> > > > --
> > > > Thanks & Regards,
> > > > Novice (http://ishuonweb.wordpress.com/).
>
> > > --
> > > --
> > > (the old fart) the advice is free, the lack of crankiness will cost you
>
> > > - its a fine line between a real question and an idiot
>
> > >http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
> > >http://blog.samdevore.com/cakephp-pages/my-cake-wont-bake/
> > >http://blog.samdevore.com/cakephp-pages/i-cant-bake/
>
> > --
> > Anupom Syam
> > TrippertLabs, Dhaka
> >http://www.anupom.wordpress.com/
>
> --
> Thanks & Regards,
> Novice (http://ishuonweb.wordpress.com/).
--~--~-~--~~~---~--~~
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: mutliple domains on 1 site

2008-04-02 Thread TWIOF

I'm after a similar solution, however insted of a different look and
feel for different sub-domains I have the following:

One CMS managing similar mini sites (all same functionality), each
with it's own db and static files (images, styles etc..).

So using a separate apps dirs seems a little exessive, would loading
separate config files dependent on $_SERVER['HTTP_HOST'] make sense?

Also being abale to use a "root" user to add/remove/manage all sites
would be usefull (could this user have a separate db, two at once?).

Any thoughts much appreciated.

Cheers

TWIOF

--~--~-~--~~~---~--~~
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: mutliple domains on 1 site

2008-04-02 Thread Barry

Thanks for all the help. The more I'm getting into cake the more I'm
liking it.
Would very much appreciate it if I could get hold of this code.

Barry

On Apr 1, 10:43 pm, Stephen Orr <[EMAIL PROTECTED]> wrote:
> Sure thing. I'm pretty certain my method isn't optimal, but it does
> work (and as a bonus, because I'm using a model to represent the
> Sites, you can add them dynamically).
>
> It relies on the ThemeView at the minute, because that's how I'm
> representing each of the different site designs. I ran into the
> sticking point where each of the sites needs different functionality,
> and that's as far as I've gotten.
>
> Either way, I'll stick the code up somewhere tomorrow (it's at work,
> and I'm at home).
>
> Steve
>
> On Apr 1, 4:09 pm, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > If you could share that code, I'll happily look at creating a patch to
> > tart it up a bit.
>
> > simonhttp://www.simonellistonball.com/
>
> > On Apr 1, 3:09 pm, Stephen Orr <[EMAIL PROTECTED]> wrote:
>
> > > I'd love to see this sort of functionality in there - I've just built
> > > a component to handle that side of things, it's not perfect but it
> > > does work.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---