Bakery Woes

2006-10-06 Thread [EMAIL PROTECTED]

So that someone knows, I tried _seven_times_ to post a comment on an
article in the Bakery before getting it to work. It kept telling me I
didn't have a subject when I did, so I kept trying different subjects.
Finally, it just accepted it, I don't know why! Anyway, something to
look into...

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



Re: My Cake development environment

2006-10-06 Thread Langdon Stevenson

Thanks for that fab, there is some interesting stuff in there on unit 
testing (something else I have to implement).

Regards,
Langdon


Fabrizio Mancini wrote:
> On 10/6/06, Langdon Stevenson <[EMAIL PROTECTED]> wrote:
>>
>> Anyway, I have no experience with PHPEclipse, and wasn't trying to
>> criticize it.
>>
>> This thread is just me sharing my experience.  I don't expect that my
>> set up will work for everyone and am interested to hear what others are
>> using :-)
> 
> 
> however, if anyone not having experience with eclipse want to try it out,
> there is a site that prepare a "bundle" for every occasion.
> www.easyeclipse.org
> i'm joining to langdon in sharing my experience.
> bye to all the bakers!
> fab

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



element in forms

2006-10-06 Thread Nathan Garza

Any one know if you can't use a button element to submit an ajax form?
 I have a series of button elements, each containing an image.  When I
click on one of the buttons, I want it to submit the form, using the
value of the button element.  My button tags look like this:



When I use this set up with a normal form, it works just fine.  When I
try it with an ajax form, the form is submited, but it doesn't submit
any data (ie, it ignors the button's value attribute.) Origionally I
thought that maybe my controller code was to blame, but the fact that
no post data is being sent is making me think otherwise.  Any one have
any ideas?

-- 

Nathan Garza

AshLeaf Media | owner
_
www.ashleafmedia.com | [EMAIL PROTECTED] | 832.514.5726

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



Re: relative links

2006-10-06 Thread Troy Schmidt

If you have to use anything absolute I have found that FULL_BASE_URL .
$this->base . "/controller/action"

This works with subdomains as well which is why I throw the $this->base
in there.

On Oct 6, 1:54 pm, "MicroAngelo" <[EMAIL PROTECTED]> wrote:
> James Booker wrote:
> > use the HtmlHelper->link and HtmlHelper->image functions to get
> > everything working as you expectFor JavaScript use the 
> > JavascriptHelper->link function
> For CSS use the HtmlHelper->css function


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



Re: Multiple select selected attributes

2006-10-06 Thread lemp

Works fine, but feel a little awkward.

I'm still wondering if this a normal behavior.


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



Re: My Cake development environment

2006-10-06 Thread Fabrizio Mancini
On 10/6/06, Langdon Stevenson <[EMAIL PROTECTED]> wrote:
Anyway, I have no experience with PHPEclipse, and wasn't trying tocriticize it.This thread is just me sharing my experience.  I don't expect that myset up will work for everyone and am interested to hear what others are
using :-)however, if anyone not having experience with eclipse want to try it out, there is a site that prepare a "bundle" for every occasion.www.easyeclipse.org
i'm joining to langdon in sharing my experience.bye to all the bakers!fab

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


Re: HTML helper error messages output

2006-10-06 Thread Mikee Freedom

yes, unfortunately that function doesn't use any of the snippets from
the tags.ini.

as i mentioned in the previous email, you may have to write your own
helper and include a function that modifies the output of the
tagErrorMsg function or replicates it using different HTML.

i've written a form helper which wraps my own HTML around the current
html helper form functions. i did it so i could easily output form
elements with different naming conventions if i needed to. was fun to
do.

does that make sense?

On 06/10/06, Christiaan Ottow <[EMAIL PROTECTED]> wrote:
>
> Thanks for your help guys.
>
> However, judged from the code in html.php, the HTML helper doesn't look
> at tags. If I'm wrong, which tag should I set in my custom tags.ini.php
> for the HTML helper to use it?
>
> Thanks in advance,
>
> Chris
>
>
> >
>

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



Re: Multiple select selected attributes

2006-10-06 Thread Sohei Okamoto

The array constructed by selectTag after submit contains keys as its values,
so I believe you can just array_flip() that array for next time, which
will have keys as its keys.
No need to change the helper.

Hope this helps.

Sohei

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



Re: View caching

2006-10-06 Thread lorenzo


nate ha scritto:

> The Cache model isn't really used, and is being replacted in 1.2 with a
great :) . Is much better use only one framework that provide all
development needs.


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



Re: Multiple select selected attributes

2006-10-06 Thread lemp

> Second: when my main item is saved, the HABTM are not.

Solved no2: relationship table name was not in alphabetical order
(colors_fruits).


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



Multiple select selected attributes

2006-10-06 Thread lemp

I have a form in which a multiple select list that represent an HABTM
relationship. The select is generated with $html->selectTag() (I
started from a baked controller).

I've got two problems.

First: when a validation error occurs, the $selected array that is
passed back to the selectTag function is  not a named array, but the
selectTag expect a named array since it use array_key_exists to check
for a match. I tried replacing array_key_exists with in_array and that
solved my problem. But I'm not sure this is really a bug. Maybe it's
the data array.

Second: when my main item is saved, the HABTM are not.


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



Re: About Cake's MVC model

2006-10-06 Thread Trevor Burton
Views can directly access a model - you could, for instance reference a
static member from a model in the view (perhaps to set a key for a
button click event) - the controller could also access this static
variable and act accordingly - this is not neccesarily an inherently
*very* bad thing. I'm working on an online multiplayer game at the
moment that works very nicely using this methodology throughout the app
- which is constructed of dozens of MVCs.

Having a single point of reference for a key means that you only need
to change that key once and everything still knows what it means... it
also means you don't really need to change the key - as long as it
differs from other keys.

MVC is becoming a looser and looser term of reference - saying
something is or is not MVC is not really that important - not as
important as having something that works well and is easily
extended/adapted. If it has a Model, a View and a Controller then it
can be called MVC - but as Marcelo rightly points out it might not
necessarily adhere strictly to the GoF MVC.On 10/6/06, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> wrote:
Nate,
 
>Views should never have>direct access to models, nor should models have direct access to views.>Any direct interaction between the two is a major violation of the>separation of your tiers.


 
They don't. There's indeed a view reference on the controller
class, but the model and the view communicate through the observer
pattern: when the model gets updated, it broadcasts an event
(notifyObservers), the viewer's then get notified about the change and
can do whatever they want with the new data. There's not direct
reference between them.

 
But as I said, there are many different MVC implementations and
not all adhere strictly to the GoF blueprint and I don't think that
just becouse of that they are not MVC. 
 
 
On 10/6/06, nate <[EMAIL PROTECTED]> wrote:

> Views broadcast events to the Controller. The Controller does the associated> action, which in turn can directly access the view via a reference or update
> the Model. The Model gets updated and then broadcast onChange event to all> the Views that registered as listeners.Then it must not be MVC, because if you're talking about MVCseparation, that's a very, *very* bad thing.  Views should never have
direct access to models, nor should models have direct access to views.Any direct interaction between the two is a major violation of theseparation of your tiers.




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


Re: View caching

2006-10-06 Thread nate

The Cache model isn't really used, and is being replacted in 1.2 with a
Cache class that will support different storage engines.  The cache()
function is basics simply reads/writes a file in Cake's /tmp directory
based on the expiration of the data.  You could certainly use
Cache_Lite instead.


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



Converting a site using CakePHP

2006-10-06 Thread gmcl

Ok, I'm stuck and frustrated.  I'm trying to plan out how to convert
our static site (www.mansfield-tx.gov) into a dynamic CakePHP site.
Currently, it uses a mix of random scripts and a whole lot manual html
coding and few php includes.  I was hoping the CakePHP community could
help me Cake-ify our site.

I want to be able to:
* easily add pages to our site using a wysiwyg editor (most important)
* have breadcrumbs
* have a side contextual side navigation that is pulled somehow from
the database
* the side navigation would show global links,category links, and page
specific links
* have postings that appear in some pages
* dynamically show related pages
* pages and postings can exist in multiple categories
* would like pages to be accessed like domain.com/name_of_page if
possible

For starters, my confusion comes from designing the db.  I really can't
get started with Cake until have a good solid db design in place.
CakePHP is up and running great on my pc.

When designing the database should I have the tables: links,
link_types, pages, posts or should I have something more generic like
content, content_type (faqs,posts,pages,bids,notices,) etc?

I have yet to find a good tutorial anywhere on the web that will walk
me through building a typical site that is easy to maintain.

Although I did read:
http://wiki.cakephp.org/tutorials:beginners_only
http://wiki.cakephp.org/tutorials:building_a_cakephp_site_part_-_1
http://wiki.cakephp.org/tutorials:building_a_cakephp_site_part_-_2

The last two were great, but then leave you hanging.  It doesn't quite
take you far enough.

I would eventually like to add on apps to this site, but first I need
address the maintence problems.  Later, I would like to add some access
control, authenication, and theming.

I know this alot to ask, but I would really appreciate some help.

The Bakery looks great and I can't wait until it is filled with more
content.


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



Re: View caching

2006-10-06 Thread lloydhome

I appreciate your pointing this out to me.  Especially since I have
read everything I can find about CakePHP but I have never seen any
documentation for this.  PEAR::Cache_Lite has a 4 year history of
improvement, stability, and speed.  Other than the complete obscurity
of Cake's cache (which now I know its name a simple search reveals it
is in basics.php) are there any benefits besides being able to use in
an environment where PEAR is not allowed?  Sorry for the flame bait.  I
think the simplest workable solution is best.  So when I wanted a local
cache I loked at Cake first.  Seeing the docs for Cache model and no
reference of any other, I thought that was it.  If I had seen docs I
would have used it.  If I found NO docs on caching I would have asked.

Lorenzo:  I avoided the Cache Model class because of the DB calls.
There is nothing intrinsically wrong with it.  In some situations you
may atually want that.  I just wanted a local cache that need not hit
the network or database.

Thanks,

David


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



data in invalidFields()

2006-10-06 Thread sohei

Hi everyone,

I have a question about data in invalidFields().
I mentioned this in response to other post, and I wonder if anyone have
answer.
It seems like the data is not passed around well in and between
invalidFields() and beforeValidate(). I know there are some tickets
related to this, but I don't think it answers to this one.

In the code below, after first if (empty($data)), $data would be passed
$data
or copy of $this->data.
Then at if (!empty($data)), $data is never empty because it has either
passed data or copy of $this->data at the beginning, and $data won't
change anyway.
In addition, beforeValidate() cannot change data to be invalidFields(),
since invalidFields() cares about $data, which can only be either
passed $data, or copy of $this->data before beforeValidate().

function invalidFields($data = array()) {
   if (empty($data)) {
   $data = $this->data;
   }

   if (!$this->beforeValidate()) {
   return false;
   }

   if (!isset($this->validate)) {
   return true;
   }

   if (!empty($data)) {
   $data = $data;
   } elseif (isset($this->data)) {
   $data = $this->data;
   }

Populating $this->data for beforeValidate() is mentioned in here, but
at the end, nate
mentioned that "We will no longer support calling Model::validates or
Model::invalidFields with parameters. You should set( ) the data, then
call validates( ) or invalidFields( )."
https://trac.cakephp.org/ticket/1040

So I guess we are not supposed to pass data, but set before call.
Still, changes in $this->data in beforeValidate() won't affect in
invalidFields().

I think the fix of using array_merge in here is still needed.
https://trac.cakephp.org/ticket/781
It said it is fixed, but I don't see the array_merge in the fix.

I think changes in $this->data should be reflected in
invalidFields(). Am I thinking wrong, or is this a bug?

I've been wondering about this for a while, so please let me know of
your opinion.
Thank you.

Sohei


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



Re: relative links

2006-10-06 Thread MicroAngelo

James Booker wrote:

> use the HtmlHelper->link and HtmlHelper->image functions to get
> everything working as you expect

For JavaScript use the JavascriptHelper->link function
For CSS use the HtmlHelper->css function


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



Re: View caching

2006-10-06 Thread jitka

Just for those who don't use Cache_Lite:

in 'pure' ;-) CakePHP code similar funcionality looks like (without
need to customize AppModel):

class Revenue extends AppModel {
  function getRevenue( $country, $region, $year ) {
$cache_name = "revenue-$country-$region-$year";
$cache_expires = '+15 hours';

$cache_data = cache($cache_name, null, $cache_expires);
if (empty($cache_data)) {
  $revenue = array();
  // do big query here 
  // populate $revenue with results optimized for reuse
  cache($cache_name, serialize($revenue), $cache_expires);
} else {
  $revenue = unserialize($cache_data);
}

return $revenue;
  }

}


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



Re: About Cake's MVC model

2006-10-06 Thread Marcelo de Moraes Serpa
Nate,
 
>Views should never have>direct access to models, nor should models have direct access to views.>Any direct interaction between the two is a major violation of the>separation of your tiers.

 
They don't. There's indeed a view reference on the controller class, but the model and the view communicate through the observer pattern: when the model gets updated, it broadcasts an event (notifyObservers), the viewer's then get notified about the change and can do whatever they want with the new data. There's not direct reference between them.

 
But as I said, there are many different MVC implementations and not all adhere strictly to the GoF blueprint and I don't think that just becouse of that they are not MVC. 
 
 
On 10/6/06, nate <[EMAIL PROTECTED]> wrote:
> Views broadcast events to the Controller. The Controller does the associated> action, which in turn can directly access the view via a reference or update
> the Model. The Model gets updated and then broadcast onChange event to all> the Views that registered as listeners.Then it must not be MVC, because if you're talking about MVCseparation, that's a very, *very* bad thing.  Views should never have
direct access to models, nor should models have direct access to views.Any direct interaction between the two is a major violation of theseparation of your tiers.
--~--~-~--~~~---~--~~
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  -~--~~~~--~~--~--~---


Re: About Cake's MVC model

2006-10-06 Thread nate

> Views broadcast events to the Controller. The Controller does the associated
> action, which in turn can directly access the view via a reference or update
> the Model. The Model gets updated and then broadcast onChange event to all
> the Views that registered as listeners.

Then it must not be MVC, because if you're talking about MVC
separation, that's a very, *very* bad thing.  Views should never have
direct access to models, nor should models have direct access to views.
 Any direct interaction between the two is a major violation of the
separation of your tiers.


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



Re: How to tell which element triggered an ajax call?

2006-10-06 Thread nate

Why not just use the POST data?  It should automatically get send, and
you can see exactly which field is getting updated.


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



Re: My Cake development environment

2006-10-06 Thread Langdon Stevenson

Daniel, you are quite right.  Too many late nights for me ...

> It only states that PHPeclipse is based on Eclipse. And it is not
> likely that PHPeclipse is based on the PHP IDE, because the PHPEclipse
> project exists longer than the PHP IDE project.

Anyway, I have no experience with PHPEclipse, and wasn't trying to 
criticize it.

This thread is just me sharing my experience.  I don't expect that my 
set up will work for everyone and am interested to hear what others are 
using :-)

Regards,
Langdon
--
Linden Row Pty Ltd

NSW  : +61 2 8215 0570
Victoria : +61 3 9013 9423
Fax  : +61 2 8215 0571

Mobile   : +61 416 118 037

http://www.lindenrow.com.au

---
Buy fine chocolate online
http://www.chocolatereview.com.au

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



Re: View caching

2006-10-06 Thread lorenzo


lloydhome ha scritto:


> so closed deals changes rarely (less than once a day) but the query is
> real harsh:
Simple & Nice :)
I'd integrate  that Model  overloading method;
But have you test advantage or script speed up comparing to Cake Model
Cache?


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



Re: View caching

2006-10-06 Thread lloydhome

For lengthy operations I create a method in the model and cache the
results.  Say I have sale people whose main portal page contains action
items, deals about to close, closed deals, and current prospect status.
 This data is referenced slightly different ways in various parts of
the app.  Also, this main page is shown repeatedly through the session
when the user is navigating.  Parts of the data can update alot, others
rarely.

so closed deals changes rarely (less than once a day) but the query is
real harsh:

class Revenue extends AppModel {
  function getRevenue( $country, $region, $year ) {
$cache =& $this->getCache();  // constructs Cache_Lite object
$cachedata = $cache->get("$country-$region-$year",'revenue');
if ($cachedata === false) {
  $revenue = array();
  // do big query here 
  // populate $revenue with results optimized for reuse
  $cache->save( serialize($revenue) );
} else {
  $revenue = unserialize($cachedata);
}
// allow getCache to not reconstruct
// if needed again soon
$this->releaseCache($cache);

return $revenue;
  }
}

Part of my AppModel:

define('_APPMODEL_CACHE_DEFAULT_TIME_', HOUR * 15);

class AppModel extends Model{
  var $_cache = null;

  const CACHE_DEFAULT_TIME = _APPMODEL_CACHE_DEFAULT_TIME_;

  function & getCache() {
if (!$this->_cache) {
  $cache = $this->createCache();
} else {
  $cache = $this->_cache;
}
$this->_cache = null;
return $cache;
  }

  function & createCache($lifetime=AppModel::CACHE_DEFAULT_TIME) {
$options = array(
'cacheDir' => APP.'tmp/cache/persistent/',
'lifeTime' => $lifetime,
'pearErrorMode' => CACHE_LITE_ERROR_DIE,
'fileNameProtection' => false
);
$cache = new Cache_Lite($options);
return $cache;
  }

  function releaseCache(&$cache) {
$this->_cache = & $cache;
  }
}

and you can do the same with other data on the page.  ALL of my simple
lookups that are database tables that change rarely are cached and
retrieved this way so no form has to do constant DB lookups just to get
a list of product codes, countries, whatever.  Stay off of your
database as much as possible and yor scalability soars.

HTH,

David


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



Re: About Cake's MVC model

2006-10-06 Thread Chris Hartjes

On 10/6/06, Trevor Burton <[EMAIL PROTECTED]> wrote:
>
> in order for them both to received updates (each 'tick' of the clock) from
> the model they would 'register' with the model
>
> the model would hold a list of all it's observers and when a
> notifyObservers() method is called on the model it would send an update to
> all the views in it's list telling them about it's current state.

Ah, I understand now.  This is necessary for a statefull application
(like a desktop app) but won't work without jumping through a lot of
hoops in a stateless application like a web page.  Of course, you
could start talking about Comet but I think that's a topic for another
mailing list.

(Comet is the concept of "streaming AJAX" where you create long-lived
XmlHTTPRequest connections and push updates from the server to the
client)


-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@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
-~--~~~~--~~--~--~---



Re: About Cake's MVC model

2006-10-06 Thread Marcelo de Moraes Serpa
Hi Chris...
 
Well, I guess it's becouse I'm more used to client-side MVC implementations (read Flash Platform). 
On my current flash project for example, I'm using a MVC library that works like this:
 
Views broadcast events to the Controller. The Controller does the associated action, which in turn can directly access the view via a reference or update the Model. The Model gets updated and then broadcast onChange event to all the Views that registered as listeners. 

 
In sum, when you update the Model, all the views that listen (are registered) to this model, get notified and can do whatever they want with the new data :)
 
>A Model returns you data in a format you need>A controller gets data from a model and passes it to a view>A view displays the data that's been passed to it.
 
Yep, there's a concept difference here. The MVC model I use on my flash app, the model acts just as a data holder. The server data is obtained via commands (command pattern) and stored on the model which notifies the views.

 
FYI, if you also work on Flash, I'm using Pixlib's MVC implementation using the FrontController strategy.
 
I guess nor implementation is wrong, it's just a matter of taste and enviroment... in the end, both are very valid MVC's implementations. There's isn't such thing as a universal all-mighty MVC implemenation I guess...

 
Cheers,
 
Marcelo.
 
On 10/6/06, Chris Hartjes <[EMAIL PROTECTED]> wrote:
On 10/6/06, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> wrote:
> From what I can see, the main purpose of Cake's MVC is to separate things,> but you can't for example register Views on a model and the model doesn't> automatically notifies the Views.>
I don't understand what you mean by "you can't for example registerViews on a model."  Why would you want a view to modify your model?That violates all sorts of rules about coupling code and defeats the
whole purpose of MVC in my opinion.A Model returns you data in a format you needA controller gets data from a model and passes it to a viewA view displays the data that's been passed to it."Registering" is a concept I have not heard of and would like an
explanation as to better understand it.   Why would you want a modelto notify a view about something?  Obviously, there is some concepthere I'm not aware of.--Chris Hartjes"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf@TheBallpark - http://www.littlehart.net/attheballpark@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  -~--~~~~--~~--~--~---


Re: About Cake's MVC model

2006-10-06 Thread Trevor Burton
Think about it like this:Imagine a clock - the ClockModel would contain information about the current timeyou could have 2 seperate views - Analog and Digital in order for them both to received updates (each 'tick' of the clock) from the model they would 'register' with the model
the model would hold a list of all it's observers and when a notifyObservers() method is called on the model it would send an update to all the views in it's list telling them about it's current state.a view might also contain user interface controls (for instance, to start and stop the clock) - button might dispatch an event to the controller which checks with the model to see whether the clock is running or not, if it's running, it stops the clock - if it's stopped it starts the clock. the model changes state and broadcasts an update to it's views etc etc. etc.
this is how it works in Actionscript - which i'm familiar with - and in this situation you would certainly want a model to notify a view about things - you might also want the controller to tell the view about things rather than bother the model with it unnecessarily.
On 10/6/06, Chris Hartjes <[EMAIL PROTECTED]> wrote:
On 10/6/06, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> wrote:> From what I can see, the main purpose of Cake's MVC is to separate things,> but you can't for example register Views on a model and the model doesn't
> automatically notifies the Views.>I don't understand what you mean by "you can't for example registerViews on a model."  Why would you want a view to modify your model?That violates all sorts of rules about coupling code and defeats the
whole purpose of MVC in my opinion.A Model returns you data in a format you needA controller gets data from a model and passes it to a viewA view displays the data that's been passed to it."Registering" is a concept I have not heard of and would like an
explanation as to better understand it.   Why would you want a modelto notify a view about something?  Obviously, there is some concepthere I'm not aware of.--Chris Hartjes"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf@TheBallpark - http://www.littlehart.net/attheballpark@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  -~--~~~~--~~--~--~---


Re: About Cake's MVC model

2006-10-06 Thread Chris Hartjes

On 10/6/06, Marcelo de Moraes Serpa <[EMAIL PROTECTED]> wrote:
> From what I can see, the main purpose of Cake's MVC is to separate things,
> but you can't for example register Views on a model and the model doesn't
> automatically notifies the Views.
>

I don't understand what you mean by "you can't for example register
Views on a model."  Why would you want a view to modify your model?
That violates all sorts of rules about coupling code and defeats the
whole purpose of MVC in my opinion.

A Model returns you data in a format you need
A controller gets data from a model and passes it to a view
A view displays the data that's been passed to it.

"Registering" is a concept I have not heard of and would like an
explanation as to better understand it.   Why would you want a model
to notify a view about something?  Obviously, there is some concept
here I'm not aware of.

-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@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
-~--~~~~--~~--~--~---



Re: Mutually exclusive associations

2006-10-06 Thread Martin Schapendonk

On 10/6/06, AD7six <[EMAIL PROTECTED]> wrote:
> Going from a Person/Organisation to an address should be fairly easy:
> Person/Org
>var $hasMany = array(
>'Comment'=>array(
>"foreignKey"=>"foreign_id",
>
> "conditions"=>"`Comment`.`class`='person'",
>"dependent"=>true,
>)
>);

How nice! I overlooked that I can specify $conditions on an association.

However, strictly speaking it does not provide any way to prevent an
Address to belong to a Person and an Organization at the same time.

Maybe I should implement a "type" attribute after all... but I didn't
want to do that, since I considered it a derived column (person_id
filled --> type = "person", organization_id filled --> type =
"organization").

Martin

-- 
  Martin Schapendonk, [EMAIL PROTECTED]

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



About Cake's MVC model

2006-10-06 Thread Marcelo de Moraes Serpa
From what I understand, the MVC pattern works like this:
 
You have a Model, a View and a Controller (duh!)
 
* The Controller is responsible for user inputs and for updating the model based on these inputs;
* Once a method on the controller is called, the model gets changed and the Views registered are notified by the model (observer pattern);
* The Views updates themselves to reflect the new model;
 
Cake MVC model doesn't adhere strictly to this paradigm, right? 
 
From what I can see, the main purpose of Cake's MVC is to separate things, but you can't for example register Views on a model and the model doesn't automatically notifies the Views.
 
Just a moment of ispiration as I go through my research on design patterns and their implementations :)
 
Thanks in advance,
 
Marcelo.

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


Faking OO on RDBMS

2006-10-06 Thread [EMAIL PROTECTED]

Hi,

I have been Googling for methodologies to 'fake' OO database
arrangements using a standard RDBMS without much success.

At least I think I need to fake it :-)

I'm using MySQL as my database backend (the RDBMS) and, obviously,
cakePHP (the OO bit) as the application language.

My application data setup has this kind of arrangement:

class Run extends AppModel
{
  var $belongsTo = array(
 'Exec' =>
 array('className' => 'Exec',
   'foreignKey' => 'exec_id',
   ), // ... and others
}

Now there are many types of exec, with varying, non-overlapping sets of
data. For example, execType1 may have 3 fields, whereas execType2 may
have 50 fields all completely different from those in execType1.

But from a Run's point of view they are handled exactly the same.
(Well, for data structure purposes they are, obviously the view
handling is very different.)

So whay I have done is to make a table for the Exec class that contains
the name of the table that contains the real exec data along with the
index into that table, e.g.:

entry 1
  tablename: "exectype1"
  index: 45

entry 2
  tablename: "exectype2"
  index: 3

etc.

So when a Run asks for the information about the Exec, the Exec
controller just finds the name of the relevant table and redirects to
that controller:

  function view($id) {
$data = $this->Exec->read(null, $id);

$table = $data['Exec']['table'];
$index = $data['Exec']['table_idx'];

$this->redirect("/$table/view/$index");
  }

[It's not *exactly* like that but close enough]

So this all works but it looks like a dodgy design decision, especially
now that I have to start searching through the list of Execs to find
failures before showing the Runs that have failures.

Does anyone else have any experiences with this type of design? Even of
the 'Aaagh, whatever you do, don't do THAT" type.

Allan


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



Re: Postgres Sequence ID

2006-10-06 Thread pgDev

Hi gus,

I ran into the same problem and ended up just renaming the field...

OB


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



Re: Having an issue with baking a controller

2006-10-06 Thread dkarlson

Thanks for your help, guys. I figured out the problem. I did bake the
testcase model, but some of the other models that had relationships to
testcase incorrectly listed the model as testcases. So, when I went to
build the testcase controller, I had a problem. Fixing the incorrect
model relationships allowed me to build the controllers without a
problem.

I don't know if this is a bug in bake.php, or a user error. I know I
used the right naming conventions on my tables and their respective
link tables, etc.

Anyhow -- thanks again.

D


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



Re: save the whole querystring in db

2006-10-06 Thread lorenzo


[EMAIL PROTECTED] ha scritto:


> How can I do that?
$querystring = $_SERVER['QUERY_STRING'];
// query string is: url=CONTROLLER/ACTION/ARG
Example:
the query string  of /products/view/1?params=1¶ms=2 is:
url=products/view/1¶ms=1¶ms=2


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



IDE integration

2006-10-06 Thread VS.Php

Guys,

I'm the product designer for VS.Php, a Php IDE for Windows based on
Visual Studio. We are looking at integrating our IDE with one or more
Php frameworks. We have a poll running at our website
(www.jcxsoftware.com) to let you decide which frameworks we integrate
to.

If you are interested in IDE integration for CakePhp please vote in our
poll.

Thanks,

Juan


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



save the whole querystring in db

2006-10-06 Thread [EMAIL PROTECTED]

Hi there,

my adress looks like this:
http://website/index.php?param1=1¶m2=2

I would like to save the whole querystring ("param1=1¶m2=2") as one
string in the database where the column is called "querystring".

How can I do that?


Thanks
Felix


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



Re: Session problems in IE

2006-10-06 Thread MJ Ray

RosSoft <[EMAIL PROTECTED]> wrote:
> I had a similar problem, I was using a subdomain with strange chars
> like 'my_subdomain.domain.com'. The character '_' is not allowed in
> cookies for IE, then the session is not set. After changing the domain
> to mysubdomain.domain.com, sessions worked

I'm pretty sure that _ is forbidden in any ordinary hostname (probably 
can be done with internationalised domain names), but lots of computers 
running Microsoft Windows claim to have _ in their names.

Hope that helps,
-- 
MJ Ray <[EMAIL PROTECTED]>  www.ttllp.co.uk  +44-870-4321-9-10
Web, localisation, koha, databases, GNU/Linux and statistics.
Registered in England and Wales, partnership number OC303457

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



Re: Can a model have a relationship with itself?

2006-10-06 Thread steven7

May be I'm wrong, but I think you should also set the "foreignKey"
keyword in this array so that cakephp nows which key to use for the
hasMany relationship.
Something like :
var $hasMany = array(
 'Kids'=>array('className' => 'Human', 'foreignKey'=>'parent_id'),
 'Friends'=>array('className' => 'Human', 'foreignKey'=>'friend_id')
);

AD7six wrote:
> There are no restrictions on self joins, and the search function for
> the google group (and the cakeSearch page) works quite well:
> http://groups.google.com/group/cake-php/search?group=cake-php&q=hasMany+self&qt_g=1&searchnow=Search+this+group
>
> The ONLY thing to bear in mind is that the name you give to an
> association must be unique or the generated SQL becomes ambiguous.
>
> By that I mean:
> class Human extends Object {
> var $hasMany = array(
> 'Kids'=>array('className' => 'Human'),
> 'Friends'=>array('className' => 'Human')
> );
> }
> 
> HTH,
> 
> AD7six


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



Re: HTML helper error messages output

2006-10-06 Thread Christiaan Ottow

Thanks for your help guys.

However, judged from the code in html.php, the HTML helper doesn't look
at tags. If I'm wrong, which tag should I set in my custom tags.ini.php
for the HTML helper to use it?

Thanks in advance,

Chris


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



Re: My Cake development environment

2006-10-06 Thread Daniel Hofstetter

Hey Langdon,

It only states that PHPeclipse is based on Eclipse. And it is not
likely that PHPeclipse is based on the PHP IDE, because the PHPEclipse
project exists longer than the PHP IDE project.

-- 
Daniel Hofstetter
http://cakebaker.42dh.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
-~--~~~~--~~--~--~---



Re: Modifying model data in afterFind - and across associations.

2006-10-06 Thread andru

I have exactly the same problem:
http://groups.google.com/group/cake-php/browse_frm/thread/2d386cf3045b4281

For now I just manually run the model's afterFind method after getting
the data into the controller - but I'm not very happy with this method,
as it means the afterFind which should be being called first is now
being called last.  It also means the afterFind method has to be more
complex to iterate through the data array and find any instances of
it's own data.

If anyone could provide a better solution than this, I'd be greatful.


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



Re: Can a model have a relationship with itself?

2006-10-06 Thread Trevor Burton
many, thanks, i'll not be so lazy and do a more thorough search next time ;)thanksOn 10/6/06, AD7six <
[EMAIL PROTECTED]> wrote:I meant extends AppModel of course..

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


Re: Multiple models, one table

2006-10-06 Thread CraigFisher

Nate, Excellent - that's bang on the money... just what I was after.
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
-~--~~~~--~~--~--~---



Re: Can a model have a relationship with itself?

2006-10-06 Thread AD7six

I meant extends AppModel of course..


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



Re: Can a model have a relationship with itself?

2006-10-06 Thread AD7six

There are no restrictions on self joins, and the search function for
the google group (and the cakeSearch page) works quite well:
http://groups.google.com/group/cake-php/search?group=cake-php&q=hasMany+self&qt_g=1&searchnow=Search+this+group

The ONLY thing to bear in mind is that the name you give to an
association must be unique or the generated SQL becomes ambiguous.

By that I mean:
class Human extends Object {
var $hasMany = array(
'Kids'=>array('className' => 'Human'),
'Friends'=>array('className' => 'Human')
);
}

HTH,

AD7six


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



Can a model have a relationship with itself?

2006-10-06 Thread [EMAIL PROTECTED]

This may well be a devastatingly obvious one but i have a project for
an online shopping site and i thought i'd use it as an opportunity to
get to grips with cakephp - my problem is this:

i have a table with products and a table with related products - at the
moment the related products table holds two columns - each containing
product_ids so if i'm viewing a product i can look at it's id and
lookup any related products in the related products table.

Now, how do i do this with cakephp? surely i can't create a $hasMany
relationship in the products model saying the products model has a
$hasMany relationship with the products model? Or can i?

haven't had a chance to try it out as i'm at work so thought i'd post a
message here on the group.


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



Re: My Cake development environment

2006-10-06 Thread kabturek


hypercubed wrote:
> Can anyone read polish?
> http://www.radzaw.one.pl/2006/07/10/PHPEclipse+Vs+PHP+IDE+Kolejne+Kr%C3%B3tkie+Starcie.aspx

yes :)
It's a short comparision of the two important ( for the bloger)
functions - 1.finding of the occurence of the variable and 2.properly
showing the pairing brackets.
1st function PHPEclipse wins couse it shows the occurence of the var
and on the left - where elese the var occurs.
2.PHP IDE handles it better - it shows that the bracket was already
closed. Also PHP Eclipse inserts the pairing bracket when Enter is
pressed after an opening bracket ( he is annoyed about this ; )


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Session problems in IE

2006-10-06 Thread RosSoft

I had a similar problem, I was using a subdomain with strange chars
like 'my_subdomain.domain.com'. The character '_' is not allowed in
cookies for IE, then the session is not set. After changing the domain
to mysubdomain.domain.com, sessions worked


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



Re: Mutually exclusive associations

2006-10-06 Thread AD7six

Hi Martin,

For the given example, grant pointed out that it is easy/difficult
depending on the direction you are retrieving the data.


Going from a Person/Organisation to an address should be fairly easy:
Person/Org
var $hasMany = array(
'Comment'=>array(
"foreignKey"=>"foreign_id",

"conditions"=>"`Comment`.`class`='person'",
"dependent"=>true,
)
);

Going from address to Person/Org is slightly more tricky but quite
achievable.
if you make use of the afterFind method in your address model, you
could then bindModel the appropriate owner class and "attach" results
to the returned data set. That is if you really needed to ;).

HTH,

AD7six


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



Re: delete cascades not after upload to isp!

2006-10-06 Thread [EMAIL PROTECTED]

I just tried the nightly build! And it is working now :)

Best regards.
Asbjørn Morell.

On Oct 5, 4:07 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> development site was using mysql5 and php5 - ISP has mysql4 and php5- :/


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



Re: View caching

2006-10-06 Thread lorenzo


lloydhome ha scritto:

> I agree that smarty is a great drop in view replacement for cake and it
> is what I use.  However, for user specific differences, my best bang
> for the buck has been long term model caching.  I use Pear's Cache_Lite
> in my model classes where I know a lengthy operation can be cached.  I
Interesting lloydhome.
What's your way to use Cache_Lite ... overloading model function or
using that in controller?


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



Re: cannot find model

2006-10-06 Thread Gus

I just figured it out. i have an extra space after the quote.
' Model2' and 'Model2' are diff.


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



Re: image in link problem

2006-10-06 Thread [EMAIL PROTECTED]

this is how i do it:

echo
$html->link($html->image("image.png",array('alt'=>$title)),'/images/view/'.$image['id'],null,false,false);

the important piece is the 2nd-last "false" which means this:
$escapeTitle Whether or not the text in the $title variable should be
HTML escaped.

more info -> http://api.cakephp.org/class_html_helper.html


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



Re: IE not responding to observeForm nor observeField?

2006-10-06 Thread Grant Cox

Totally guessing here, but check that you have

charset('UTF-8')?>

in the head of your layout.  I seem to remember IE needing this when
using prototype.


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



Re: image in link problem

2006-10-06 Thread Grant Cox

The 5th parameter of $html->link is $escapeTitle.  Set this to false,
and you'll see your image.


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



Modifying model data in afterFind - and across associations.

2006-10-06 Thread Grant Cox

My problem is that afterFind only executes on the first level
associations of a found model, not on any further.  So if I have
[Campaign hasMany Group] [Group HABTM User] and I find a Campaign
(recursive 2), afterFind runs on the Group, but not the User (this is
using the latest 1.2.x.x branch).

Rather than modify the core, I thought there might be a better way to
do what I want - which is just modify the loaded data.  For example, I
currently have AppModel beforeSave() and afterFind() functions, which
can encode and decode the model data.  I use this for the odd occasion
that I want to store more complex data in a field (say CSV in the
database, but an array on my model).  I'm also using the afterFind to
generate some "meta fields", so Users get a "full_name" field, which is
just a mix of "salutation", "first_name" and "surname".

So, is there a better/alternative place to put these functions?  Or
should I look at modifying the core to ensure the afterFind callback is
run on every model included in the current recursive level?


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



cannot find model

2006-10-06 Thread Gus

Hi guy,

I am trying to use 4 models together. Let say Model1 is the caller
model.
When I go to URL/Model1Controller/
It said missing Model2 but Model2 is actually there.
When I go to URL.Model2Controller/
There is no problem.

Can anyone help explaining this to me?


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



Re: My Cake development environment

2006-10-06 Thread Langdon Stevenson

Hi hypercubed

> As far as I can tell PHPEclipse is NOT built on PHP IDE Project (for
> Eclipse).  Does it say that somewhere on their site?  If so I can't
> find it.  

I saw a note on the home page:  http://www.phpeclipse.de

"The PHPeclipse project aims to create a full featured PHP IDE with 
features like internal PHP parser, debugger, code formatter, outline 
view, templates and much more. The PHPeclipse plugins are based on the:
Eclipse IDE Framework"

About a third of the way down the page in the left hand column.

Regards,
Langdon

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