Re: Cake 1.3 + CSS + Firefox Issues

2010-05-02 Thread John Andersen
Please provide more informations, such as the CSS code that is
applied, the HTML code as it looks in FF, and whatever other code that
you deem necessary for us to assist you in clarifying the issue :)
Enjoy,
   John

On May 2, 8:44 am, Mateo San Román sanroma...@gmail.com wrote:
 Hello,

   I've created a baked view for a controller; when I open it with IE8
 or Chrome, all view data is shown, but if I open it in Firefox the
 first CSS class applied (same name as controller) renders the data
 container hidden.

 Is there any way (besides deleting) to avoid this behavior?

 Best regards

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cake 1.3 + CSS + Firefox Issues

2010-05-02 Thread Mateo San Román
http://i855.photobucket.com/albums/ab117/mateosanroman/screenshot.png

Standard baked view, untouched.
No extra CSS or JS added.
If I remove the ads class from the container, everything is fixed.

Same on add/edit view.

Thanks,


On 2 mayo, 01:17, John Andersen j.andersen...@gmail.com wrote:
 Please provide more informations, such as the CSS code that is
 applied, the HTML code as it looks in FF, and whatever other code that
 you deem necessary for us to assist you in clarifying the issue :)
 Enjoy,
    John

 On May 2, 8:44 am, Mateo San Román sanroma...@gmail.com wrote:



  Hello,

    I've created a baked view for a controller; when I open it with IE8
  or Chrome, all view data is shown, but if I open it in Firefox the
  first CSS class applied (same name as controller) renders the data
  container hidden.

  Is there any way (besides deleting) to avoid this behavior?

  Best regards

  Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups 
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cake 1.3 + CSS + Firefox Issues

2010-05-02 Thread Mateo San Román
http://i855.photobucket.com/albums/ab117/mateosanroman/screenshot.png

Standard baked view, untouched.
No extra CSS or JS added.
If I remove the ads class from the container, everything is fixed.

Same on add/edit view.

Thanks,


On 2 mayo, 01:17, John Andersen j.andersen...@gmail.com wrote:
 Please provide more informations, such as the CSS code that is
 applied, the HTML code as it looks in FF, and whatever other code that
 you deem necessary for us to assist you in clarifying the issue :)
 Enjoy,
    John

 On May 2, 8:44 am, Mateo San Román sanroma...@gmail.com wrote:



  Hello,

    I've created a baked view for a controller; when I open it with IE8
  or Chrome, all view data is shown, but if I open it in Firefox the
  first CSS class applied (same name as controller) renders the data
  container hidden.

  Is there any way (besides deleting) to avoid this behavior?

  Best regards

  Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others 
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups 
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Selected option in select

2010-05-02 Thread WebbedIT
Glad u got it working :o)

If you change the file name to Profile.group, you should be able to
remove the 'selected' =$this-data['Profile']['group'] attribute.

P.S. to show the input without a label using form-input you just
supply label=false.  I personally much prefer using the same method
as much as possible and form-input very rarely lets me down.

HTH

Paul

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Form Tag!!!!

2010-05-02 Thread sherzo

Hi all!!!

I have the following code in my View:


?php //echo
$form-create('UsersCoupon',array('id'='update','url'=array('action'='changeStatustoUsed')));?

div class=kuponTop
div class=kuponBottom
div class=kuponCenter
ul
li class=kuponFirstp
class=ilkKUPONLARIM/ppADET/ppDEGER/pp class=sonBITIS
TARIHI/p/li
?php $usersCoupons =
$this-requestAction('users_coupons/listNotUsedCoupons'); ?
?php 

foreach($usersCoupons as $usersCoupon): 
?
li ?php //echo
$form-checkbox('cop.id.'.$usersCoupon['UsersCoupon']['id'], array('value'
= $usersCoupon['UsersCoupon']['id'])); ?
?php //echo $form-input($usersCoupon['UsersCoupon']['id'],array(
'type'='checkbox', 'label'=false,
'name'='cop['.$usersCoupon['UsersCoupon']['id'].']',   
'id'='cop_'.$usersCoupon['UsersCoupon']['id']  )); ?   
p 
class=ilk?php   echo $usersCoupon['Coupon']['title']?/p
p?php   
$m = 
$usersCoupon['UsersCoupon']['transaction_code'];

$count =
$this-requestAction('users_coupons/countUserCouponPurchasePerTime/'.$m);

echo $count;?/pp?php echo
$count*$usersCoupon['Coupon']['sale_price'];?TL/pp class=son?php  
echo $usersCoupon['Coupon']['expiration_date'];?/p/li
?php endforeach; 

?

/ul
/div

/div
/div
?php //echo 
$form-submit('kullandiklarimi-arsive-at-button.gif',
array('class'='submit'));? 

div class=pageNum

!-- Shows the page numbers --
?php 
echo $paginator-prev('«  ', null, null, array('class' = 'disabled'));
echo $paginator-numbers(); ?
!-- Shows the next and previous links --
?php

echo $paginator-next('  »', null, null, array('class' = 'disabled'));
? 
 br class=cb /
p style=font-family:Verdana;
font-size:11px;color:#c4; padding-top:15px;Lütfen önce kullandığınız
kuponları işaretleyin./p
/div

and as soon as I uncomment the form tag I will receive the following error
message!!! 

Fatal error: Cannot use object of type Xml as array in cakephp form

any idea?!?!
-- 
View this message in context: 
http://old.nabble.com/Form-Tag%21%21%21%21-tp28425388p28425388.html
Sent from the CakePHP mailing list archive at Nabble.com.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Embedded excel kills session with IE

2010-05-02 Thread weckmann
I found the solution in another forum... here it is:

header(Content-Disposition: attachment; filename=\export.csv\);
header(Content-type: text/csv);


The important part is the Content-Disposition.. this tells the
browser not to try to open it directly by using its plugin.

So the user still has the option to open it directly, but then a
normal Excel (or whatever other .csv editor is configured in the OS)
instance will open the file, and the session in the original window
does not get touched.

Maybe someone else has the same problem ;-)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: v1.3 App::Objects not finding controllers in app/controllers/subfolders

2010-05-02 Thread AD7six


On May 1, 10:32 pm, Jamie jamie@gmail.com wrote:
 On May 1, 1:21 pm, AD7six andydawso...@gmail.com wrote:







  On May 1, 10:19 pm, Jamie jamie@gmail.com wrote:

   On May 1, 1:17 pm, AD7six andydawso...@gmail.com wrote:

On May 1, 10:13 pm, Jamie jamie@gmail.com wrote:

 On May 1, 12:46 pm, AD7six andydawso...@gmail.com wrote:

  On May 1, 9:36 pm, Jamie jamie@gmail.com wrote:

   I read the whole thread. I'm not sure how that changes my post.

   I was just explaining to the original poster why subfolders didn't
   automatically work

  I would suggest you try and don't assume.

   , why there's no easy way to make them work, and why
   they work in other frameworks/code designs. Please explain to me 
   the
   problem you have with my post and maybe we can do something
   constructive.

   Seriously, what is with you throwing out these sarcastic comments
   lately? I can pick out more than a few examples over the past 
   little
   while. Between you and Miles this group is getting a bit hostile.

  I'm not being sarcastic - I'm giving you the opportunity to correct
  your mistake. If you /still/ can't see it - try exactly what you've
  said doesn't work before replying.

 Fine. Thanks for the opportunity. Glad you're looking out for me. I
 made this file:

 controllers/test/users.php

I see. so you feel that by demonstrating your own example which has
nothing to do with this thread and is based on a different framework
(since you don't follow a single convention) that somehow makes your
reply right?

   You told me to try what I said wouldn't work. And I did. Then I shared
   the results.

   I sense that this isn't going anywhere. Thanks for hijacking my
   response...

  Jamie you're taking this out of context and personal and I doubt
  anyone else in this thread is really interested in your example.

  This is what I expected you to do

  mv controllers/anything_controller.php controllers/any/subfolder/you/
  like

  firefoxhttp://mysite/anything

  and marvel at the wonder of a page that isn't a 404.

  GN

 Maybe the original poster is used to following PEAR conventions. Who
 knows? Why not give the benefit of the doubt? More importantly, why
 not let others respond to the original poster without interjection? I
 was just trying to offer a possible explanation in case he was indeed
 expecting Cake to respect the PEAR naming style. I'm not sure why that
 bothered you.

Let's start again shall we.

My name is Andy, I've used Cake since 2005 and I build applications
using Cake. I sporadically commit to cake among other supporting
activities and used to be very active on this group - but now restrict
my infrequent activities to:
* checking for interesting new topics
* correcting/preventing the spread of mis-information

My replies to you and miles fall under the second category. You
**can** put controllers in subfolders. Both of you based your answers
(in one level or another) on assumptions. I encourage you/anyone to
try + look at the docs + check the test/write a test case before
proclaiming how something works or why something's not possible.

Whenever I reply you can be sure one or all of the following is true:
* I wrote it
* I patched it
* I wrote a test case for it
* I've used it
* I've not used it but 10s ago I tried it

I don't know the reason Matthew was not able to see his controllers
but that's most likely irrelevant as it seems putting controllers in
subfolders was not the objective - just a consequence of misreading
something.

I don't understand why you are attempting to redirect my replies/this
thread to be about ZEND/PEAR naming conventions when they are not
relevant (Matthews examples do not follow these conventions), or
taking my replies to you as some kind of personal attack. My goal is
for everyone using cake to progress and learn. This is setback by
people speading information which is simply wrong.

hth,

AD

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to output UTF-8 sign?

2010-05-02 Thread sebb86
John

Thanks a lot for all your help and that you spending time on this.
If anyone else need the source code:
(additions: column number in every column header, renamed column
headers)
[code]
?php $sortable = array('id' = 'sort_none', 'hardware_unit_id' =
'sort_none', 'description' = 'sort_none'); ?
?php $viewName = array('id', 'Hardware Gerät', 'DNS Name'); ?

?php if(isset($this-params['named']['direction'])
{
  $sortable[$this-params['named']['sort']] = 'sort_'.$this-
params['named']['direction'];
}  ?

?php $colNumb=1; ?
table id=tab1 style=width:auto;
  tr
th[Optionen]/th
?php foreach($sortable as $sortFieldName = $sortCssClass): ?
  th?php echo $colNumb; ??php echo $paginator-
sort($viewName[$colNumb-1], $sortFieldName, array('class' =
$sortCssClass)); ?/th
  ?php $colNumb++; ?
?php endforeach; ?
  /tr
...
[/code]

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cake 1.3 + CSS + Firefox Issues

2010-05-02 Thread Tomek Mazur
I suppose adblock i blocking that content. Try turning it off and see
if it works.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Next Cakefest?

2010-05-02 Thread drpark
can we know more now that it is announced on cakefest.org?
Regards,
Jeremy

On 8 mar, 14:23, drpark webmas...@attractionland.com wrote:
 Hi all,
 do you have an idea for the nextcakefest'sdates?

 Hard to get approved for a business travel if we can't book 3 months
 before the event.( we have to plan current project)

 Thanks for answers,
 Regards,
 Jeremy

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cake 1.3 + CSS + Firefox Issues

2010-05-02 Thread Mateo San Román
Would not have thought of that on a million years... lucky me for
sending a screenshot!
Thank you very much.

On 2 mayo, 04:27, Tomek Mazur tmazu...@gmail.com wrote:
 Supongo Adblock i bloquear dicho contenido. Trate de apagarlo y ver
 si funciona.

 Echa un vistazo a la nueva CakePHP sitio Preguntashttp://cakeqs.orgy ayudar a 
 otros con sus preguntas relacionadas con CakePHP.

 Has recibido este mensaje porque estás suscrito a los Grupos de Google 
 CakePHP grupo.
 Para escribir en este grupo, envía un correo electrónico a 
 cake-php@googlegroups.com
 Para darse de baja de este grupo, envía un correo electrónico a
 -Php + unsubscr...@googlegroups.com torta Para obtener más opciones, visita 
 este grupo enhttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Newbie problem with 15 minute blog in Cake 1.3

2010-05-02 Thread Matt
Well, the release said stable' but I am trying to figure out if it is
me, my configuration or what.

I am using Apache2 on Windows Vista and PHP 5.2.10.  I seem to have a
possible mod_rewrite problem but I am not sure.   It is obvious that
the ID portion of the URL is not being handled correctly for some
reason (id:N).  When I go to view or delete, nothing happens because
the ID is not passed.  I have checked and double checked.  I have
followed the tutorial to the letter.

Where do I look? Any suggestions?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


The docs for Containable does not work for complex search. Complex search is 2 models away. For cake 1.3

2010-05-02 Thread Kei Simone
Hi,

i have the following for my cake 1.3:

User hasOne Merchant (so Merchant belongsTo User)
Shop hasMany Merchant (so Merchant belongsTo Shop as well.)
Shop hasMany Domain (so Domain belongsTo Shop.)

i need to use Merchant model to do a find of all 4 related data.
notice that Domain is the only one NOT directly related to Merchant.

i tried this in a method inside Merchant model:

$this-Behaviors-attach('Containable');
$this-User-Behaviors-attach('Containable');
$this-Shop-Behaviors-attach('Containable');
$this-Shop-Domain-Behaviors-attach('Containable');

$this-recursive = -1;
$this-User-recursive = -1;
$this-Shop-recursive = -1;
$this-Shop-Domain-recursive = -1;

return $this-find('first',
array(
  'contain'=array(
 'User',
 'Shop' = array('Domain' ),

),
'conditions' = $conditions
));

http://book.cakephp.org/view/1323/Containable has errors in terms of
telling you where to place the conditions. my way is correct as of 1.3
Cakephp

but there is no way to get the Domain.

I also noticed that the doc told us about using fields.

it is so vague i am not even sure what fields to put inside. they
mentioned that foreign keys but do the example like id, name, note
look like foreign key? they look like primary key and field .

another thing is it is not consistent. look at AccountSummary and
compare it with PostAttachment.

both are 2 models away from main model but AccountSummary does not
need to use fields, i wonder why PostAttachment needs it?

anyway if you have problems with complicated search, like mine, use
joins. more reliable than Containable  see 
http://book.cakephp.org/view/1047/Joining-tables

please advise me on how to use Containable so i can use it instead of
custom queries.

Thank you

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: The docs for Containable does not work for complex search. Complex search is 2 models away. For cake 1.3

2010-05-02 Thread Jon Bennett
 i need to use Merchant model to do a find of all 4 related data.
 notice that Domain is the only one NOT directly related to Merchant.

 i tried this in a method inside Merchant model:

 $this-Behaviors-attach('Containable');
 $this-User-Behaviors-attach('Containable');
 $this-Shop-Behaviors-attach('Containable');
 $this-Shop-Domain-Behaviors-attach('Containable');

 $this-recursive = -1;
 $this-User-recursive = -1;
 $this-Shop-recursive = -1;
 $this-Shop-Domain-recursive = -1;

 return $this-find('first',
                array(
                  'contain'=array(
                                         'User',
                                         'Shop' = array('Domain' ),

                                        ),
                'conditions' = $conditions
        ));

 http://book.cakephp.org/view/1323/Containable has errors in terms of
 telling you where to place the conditions. my way is correct as of 1.3
 Cakephp

return $this-find('first', array(
// conditions for the main model
'conditions'=array(),
// contain
'contain'=array(
'User'=array(
// conditions for the user model
'conditions'=array('User.status'=1),
'Other', 'Models', 'From', 'User'
),
'Shop'=array('Domain'),
)
));

hth

Jon

-- 
jon bennett - www.jben.net - blog.jben.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: HOW to use find() to EXCLUDE some datasets?

2010-05-02 Thread j0n4s.h4rtm...@googlemail.com

'conditions' = array('NOT' = array('5', '6', 7'))
- NOT IN (5,6,7)

On Apr 19, 8:42 am, mivogt-LU c...@mivogt.net wrote:
 HI there,

 I want to use find() to exlude some data on a few conditions.

 My app is built like this

 customer-request-booking-bookingposition-lodging

 with request fields: Id         Name    Customer        Date1/Date2 (date1,2
 arrival,leave requested)
 with booking fields: Id         Name    Customer        Mealclass       
 Request
 with bookingpositionfields: Id          Booking         Date1/Date2 Lodging
 (date1,2 arrival,leave booked)
 *) I use 2 times a date fieldset if a customer might ask for a period
 he want to visit but do booking only a part of it (i.e. wants to visit
 in april staying 1 week...)

 Now if I do add a booking position to a customers booking the usual
 way is getting full the lodgings list from conroller by find(list).
 My goal is to exclude those that are already in use (should be easy to
 agree I need to do so..)

 With mysql I found 'NOT IN' syntax to fit my needs if I do something
 like this
 1.) select * from bookingpositions, bookings, lodgings .. fittinng ore
 close the time of the new booking
 2.) select * from lodgings not in result of 1.)

 Is there a way to do similar using the cake built in find function?
 Some syntax help would be great as I am not realy advanced with the
 conditions array

 Thanks in advance

 Michael

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: HOW to use find() to EXCLUDE some datasets?

2010-05-02 Thread j0n4s.h4rtm...@googlemail.com
Sorry... something like this should work:

'conditions' = array('NOT' = array('Model.fieldname' = array(5',
'6', 7')))
Should create something like NOT (Model.fieldname IN (5,6,7))

Lookup the book on cakephp.org for Complex Find Conditions

On Apr 19, 8:42 am, mivogt-LU c...@mivogt.net wrote:
 HI there,

 I want to use find() to exlude some data on a few conditions.

 My app is built like this

 customer-request-booking-bookingposition-lodging

 with request fields: Id         Name    Customer        Date1/Date2 (date1,2
 arrival,leave requested)
 with booking fields: Id         Name    Customer        Mealclass       
 Request
 with bookingpositionfields: Id          Booking         Date1/Date2 Lodging
 (date1,2 arrival,leave booked)
 *) I use 2 times a date fieldset if a customer might ask for a period
 he want to visit but do booking only a part of it (i.e. wants to visit
 in april staying 1 week...)

 Now if I do add a booking position to a customers booking the usual
 way is getting full the lodgings list from conroller by find(list).
 My goal is to exclude those that are already in use (should be easy to
 agree I need to do so..)

 With mysql I found 'NOT IN' syntax to fit my needs if I do something
 like this
 1.) select * from bookingpositions, bookings, lodgings .. fittinng ore
 close the time of the new booking
 2.) select * from lodgings not in result of 1.)

 Is there a way to do similar using the cake built in find function?
 Some syntax help would be great as I am not realy advanced with the
 conditions array

 Thanks in advance

 Michael

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Stuck again ...

2010-05-02 Thread calvin
That will work, but that's really not what $session is designed for;
you're not trying to store persistent data. I've used plenty of hacks
like that myself, but I generally try to avoid them because it makes
the code much less intuitive to others. And if there's a correct way
of doing the same thing for the same amount of work, you may as well
do it the standard way.

AFAIK, Controller::set() and View::set() both set variables in View::
$viewVars and Controller::$viewVars (which gets passed to View::
$viewVars). So just use the set() function like you would normally, or
you can manipulate the $viewVars property directly. There may be
another way of doing it, but that's how I did it on a previous site
when I needed to generate embedded javascript from within a helper.

And FYI, the scripts that are going to be included through
$scripts_for_layout are stored in View::__scripts.

On Apr 29, 12:01 am, Ed Propsner crotchf...@gmail.com wrote:
 8-)



 On Thu, Apr 29, 2010 at 3:00 AM, Andrei Mita andrei.m...@gmail.com wrote:
  Forget about what? :))

  On Thu, Apr 29, 2010 at 9:49 AM, Ed Propsner crotchf...@gmail.com wrote:

  LOL, I obviously need to call it quits for the day ... talk about
  over-thinking that one!  It honestly didn't even dawn on me to try session
  vars ... lol.

  What do you say we both just walk away and forget this ever happened? 8-)

  - Ed

  On Thu, Apr 29, 2010 at 2:33 AM, Andrei Mita andrei.m...@gmail.comwrote:

  Maybe I didn't get it right, but if you need a var globally available
  (controllers, views, layouts) you could use $session. Easy to set and read
  everywhere.

  Andrei

  On Thu, Apr 29, 2010 at 8:47 AM, Ed Propsner crotchf...@gmail.comwrote:

  Could someone help get me pointed in the right direction?

  I want to be able to set a variable in any one of my controllers/actions
  that is accessible
  by the default.ctp just like you would do for $page_title /
  $title_for_layout.

  I want to use it mainly for javascript so I would like to set the
  variable in the controller/action
  and the appropriate script will execute in the default.ctp when the view
  is rendered, either that
  or I could store the script in an element and have the appropriate
  element rendered in the default ???

  Anywho, I've been digging through the book and I'm not quite sure where
  I should be looking.
  Components? Bootstrapping? Heck if I  know 8-)

  Thanks,

  - Ed

   Check out the new CakePHP Questions sitehttp://cakeqs.organd help
  others with their CakePHP related questions.

  You received this message because you are subscribed to the Google
  Groups CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

   Check out the new CakePHP Questions sitehttp://cakeqs.organd help
  others with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

   Check out the new CakePHP Questions sitehttp://cakeqs.organd help
  others with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

   Check out the new CakePHP Questions sitehttp://cakeqs.organd help
  others with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are 

Re: Offline Documentation Mirror

2010-05-02 Thread calvin
I'd offer to create a CHM or PDF version of the cookbook (I know it's
always changing, but CHM/PDF are better formats for ebooks IMO), but
the Cookbook is released under a no-derivatives CC license...

On Apr 28, 6:32 pm, Graham Weldon gra...@grahamweldon.com wrote:
 I think I have seen this request come up in the past. I can definitely see
 how this would be useful to users that are offline frequently, and still
 need to refer to documentation.

 I'll bring this up with the development and bakery teams, and see what the
 best solution is to get something like this available.
 Not making any promises at this stage, but a weekly automated export might
 be possible.

 Cheers,
 Graham Weldon (aka. Predominant)



 On Thu, Apr 29, 2010 at 3:11 AM, luckysmack luckysm...@gmail.com wrote:
  While in irc at #cakephp i was talking to a few people that would like
  to have an offline version of the 1.3 documentation from
  book.cakephp.org . I was looking for the same thing as well, as I am
  frequently off line and would like to be able to refer to the docs.
  And viewing them on a phone can be done, but leaves much to be
  desired. Anywho, so last night i tested out pulling the documentation
  from the site, making sure to keep bandwidth throttled and to only
  grab documentation. Adding filters to block the download of anything
  else.

  So currently i would use this for personal use, but I would like to
  ask permission to host this offline documentation for others to see
  and be able to download for their own offline use as well. I would
  possibly add the files to a github repo for others to get. But before
  I do so I want to make sure that is ok with the top brass as so to
  stay on your good sides. :D

  I would only update the documentation periodically and at night when
  it is off peak hours for the site as to not bog it down. And would
  most likely only do it every few weeks or so. So If you are ok with
  this please let me know.

  Thanks

  Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
  with their CakePHP related questions.

  You received this message because you are subscribed to the Google Groups
  CakePHP group.
  To post to this group, send email to cake-php@googlegroups.com
  To unsubscribe from this group, send email to
  cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: v1.3 App::Objects not finding controllers in app/controllers/subfolders

2010-05-02 Thread Miles J
Hence why I said just use plugins, cause the conventions are
automatic.

On May 2, 1:56 am, AD7six andydawso...@gmail.com wrote:
 On May 1, 10:32 pm, Jamie jamie@gmail.com wrote:



  On May 1, 1:21 pm, AD7six andydawso...@gmail.com wrote:

   On May 1, 10:19 pm, Jamie jamie@gmail.com wrote:

On May 1, 1:17 pm, AD7six andydawso...@gmail.com wrote:

 On May 1, 10:13 pm, Jamie jamie@gmail.com wrote:

  On May 1, 12:46 pm, AD7six andydawso...@gmail.com wrote:

   On May 1, 9:36 pm, Jamie jamie@gmail.com wrote:

I read the whole thread. I'm not sure how that changes my post.

I was just explaining to the original poster why subfolders 
didn't
automatically work

   I would suggest you try and don't assume.

, why there's no easy way to make them work, and why
they work in other frameworks/code designs. Please explain to 
me the
problem you have with my post and maybe we can do something
constructive.

Seriously, what is with you throwing out these sarcastic 
comments
lately? I can pick out more than a few examples over the past 
little
while. Between you and Miles this group is getting a bit 
hostile.

   I'm not being sarcastic - I'm giving you the opportunity to 
   correct
   your mistake. If you /still/ can't see it - try exactly what 
   you've
   said doesn't work before replying.

  Fine. Thanks for the opportunity. Glad you're looking out for me. I
  made this file:

  controllers/test/users.php

 I see. so you feel that by demonstrating your own example which has
 nothing to do with this thread and is based on a different framework
 (since you don't follow a single convention) that somehow makes your
 reply right?

You told me to try what I said wouldn't work. And I did. Then I shared
the results.

I sense that this isn't going anywhere. Thanks for hijacking my
response...

   Jamie you're taking this out of context and personal and I doubt
   anyone else in this thread is really interested in your example.

   This is what I expected you to do

   mv controllers/anything_controller.php controllers/any/subfolder/you/
   like

   firefoxhttp://mysite/anything

   and marvel at the wonder of a page that isn't a 404.

   GN

  Maybe the original poster is used to following PEAR conventions. Who
  knows? Why not give the benefit of the doubt? More importantly, why
  not let others respond to the original poster without interjection? I
  was just trying to offer a possible explanation in case he was indeed
  expecting Cake to respect the PEAR naming style. I'm not sure why that
  bothered you.

 Let's start again shall we.

 My name is Andy, I've used Cake since 2005 and I build applications
 using Cake. I sporadically commit to cake among other supporting
 activities and used to be very active on this group - but now restrict
 my infrequent activities to:
 * checking for interesting new topics
 * correcting/preventing the spread of mis-information

 My replies to you and miles fall under the second category. You
 **can** put controllers in subfolders. Both of you based your answers
 (in one level or another) on assumptions. I encourage you/anyone to
 try + look at the docs + check the test/write a test case before
 proclaiming how something works or why something's not possible.

 Whenever I reply you can be sure one or all of the following is true:
 * I wrote it
 * I patched it
 * I wrote a test case for it
 * I've used it
 * I've not used it but 10s ago I tried it

 I don't know the reason Matthew was not able to see his controllers
 but that's most likely irrelevant as it seems putting controllers in
 subfolders was not the objective - just a consequence of misreading
 something.

 I don't understand why you are attempting to redirect my replies/this
 thread to be about ZEND/PEAR naming conventions when they are not
 relevant (Matthews examples do not follow these conventions), or
 taking my replies to you as some kind of personal attack. My goal is
 for everyone using cake to progress and learn. This is setback by
 people speading information which is simply wrong.

 hth,

 AD

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To 

Re: Cake Console Baking Model displayField?

2010-05-02 Thread calvin
Baking views has nothing to do with it. Whether you bake the views or
not, Cake needs to know which field to display the record as. If
there's no displayField, it will likely just use the ID column.

When you display the data from a model with a foreign key, do you want
that field to show up as the foreign ID, or do you want Cake to
display the associated username/post title/category name/etc. instead?
When you're creating a new record, and you need to select an
associated record for a belongsTo relationship, do you want to see a
drop-down list full of ID numbers or something that is human-readable?

On Apr 28, 12:12 pm, Johnathan Iannotti jo...@blueclover.com wrote:
 Thanks John for your input!

 What is the point in declaring a displayField though if you are going to bake 
 the views and it adds the columns anyway?

 Thanks,
 -John

 -Original Message-
 From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf 
 Of John Andersen
 Sent: Wednesday, April 28, 2010 1:57 PM
 To: CakePHP
 Subject: Re: Cake Console Baking Model displayField?

 The CakePHP usually assumes that a table column named name or
 title is the display field, but if you don't have one, it will ask
 you what to do, as you have discovered :) So if you have a column that
 you would like to be displayed by default, then define one.
 Enjoy,
    John

 On Apr 28, 9:50 pm, Johnathan Iannotti jo...@blueclover.com wrote:
  I'm doing some baking on the console with 1.3 and perhaps I didn't setup my 
  database correctly because I've never seen this message before:

  A displayField could not be automatically detected would you like to choose 
  one? (y/n)

  I am then presented with a list of options from the database table I am 
  trying to make my model from.  Is displayField supposed to be the primary 
  key?  Any input would be appreciated, thanks!

  -John

 [snip]

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

 Homepage:http://www.blueclover.com |  Blog:http://www.blue-ings.com |  
 Twitter:http://twitter.com/bluecloverusa |  
 Facebook:http://www.facebook.com/blueclover | 
 YouTube:http://www.youtube.com/user/bluecloverstudios| Join Our Mailing 
 List:http://visitor.constantcontact.com/manage/optin?v=001ti8yLLtrqgo7unTQ...

 -

 This email transmission, including any attachments thereto, may contain 
 information that is proprietary and confidential. The information is intended 
 only for the use of the individual(s) or entity to whom this email has been 
 addressed. If you are not the intended recipient, or the person responsible 
 for delivering it to the intended recipient, you are hereby notified that any 
 disclosure, copying, distribution or use of any of the information is 
 strictly prohibited. If you have received this transmission in error, please 
 let us know immediately and delete the email, including any attachments 
 thereto, from your computer.

 Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with 
 their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Newbie problem with 15 minute blog in Cake 1.3

2010-05-02 Thread Don Drake
The controller has the 'params' property. If you output this:
debug($this-params); //from your view
I believe you should see your id showing in the 'pass' array if everything
is working. If it's there, this will confirm the value is getting all the
way in to your controller or not. If it's there, then to problem isn't in
the mod-rewrite or anything early in the process.

Don

On Sat, May 1, 2010 at 5:40 PM, Matt mattlavin...@gmail.com wrote:

 Well, the release said stable' but I am trying to figure out if it is
 me, my configuration or what.

 I am using Apache2 on Windows Vista and PHP 5.2.10.  I seem to have a
 possible mod_rewrite problem but I am not sure.   It is obvious that
 the ID portion of the URL is not being handled correctly for some
 reason (id:N).  When I go to view or delete, nothing happens because
 the ID is not passed.  I have checked and double checked.  I have
 followed the tutorial to the letter.

 Where do I look? Any suggestions?

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Newbie problem with 15 minute blog in Cake 1.3

2010-05-02 Thread Matt
 The controller has the 'params' property. If you output this:
 debug($this-params); //from your view
 I believe you should see your id showing in the 'pass' array if everything
 is working. If it's there, this will confirm the value is getting all the
 way in to your controller or not. If it's there, then to problem isn't in
 the mod-rewrite or anything early in the process.

 Don

Thanks for the tip.  Added the debug code and pasting the output
below.   ID is in the named element but not the pass element.  Is
that a problem?

Array
(
[controller] = posts
[action] = view
[named] = Array
(
[id] = 3
)

[pass] = Array
(
)

[plugin] =
[form] = Array
(
)

[url] = Array
(
[url] = posts/view/id:3
)

[models] = Array
(
[0] = Post
)

)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Newbie problem with 15 minute blog in Cake 1.3

2010-05-02 Thread Sam Sherlock
you can access it

$this-params['named']['id']


your view action may take it as argument (in controller)
..
function view($id) {
...
}
..



You can alter posts routes should you want to use slugs rather than ids with
Syrup.Sluggable  (syrup is a cake plugin that has a few behaviours)

- S



On 2 May 2010 23:27, Matt mattlavin...@gmail.com wrote:

  The controller has the 'params' property. If you output this:
  debug($this-params); //from your view
  I believe you should see your id showing in the 'pass' array if
 everything
  is working. If it's there, this will confirm the value is getting all the
  way in to your controller or not. If it's there, then to problem isn't in
  the mod-rewrite or anything early in the process.
 
  Don

 Thanks for the tip.  Added the debug code and pasting the output
 below.   ID is in the named element but not the pass element.  Is
 that a problem?

 Array
 (
[controller] = posts
[action] = view
[named] = Array
(
[id] = 3
)

[pass] = Array
(
)

[plugin] =
[form] = Array
(
)

[url] = Array
(
[url] = posts/view/id:3
)

[models] = Array
(
[0] = Post
)

 )

 Check out the new CakePHP Questions site http://cakeqs.org and help others
 with their CakePHP related questions.

 You received this message because you are subscribed to the Google Groups
 CakePHP group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


AJAX Pagination for more commments style functionality

2010-05-02 Thread Eric Anderson
Hi everyone,

I'm having a problem getting AJAX Pagination to work when adding
additional content to an unordered list.

So, what I want to set up is something along the lines of a Twitter
more comments AJAX loading system. When you click more
comments (the only pagination control element that will display) it
loads the next X many comments into the UL as LI elements.

So, here is my original code:

?php
$paginator-options(array('url'=$this-passedArgs));
$paginator-options(array('update' = 'comment-list', 'indicator' =
'spinner', 'position' = 'bottom'));
?
p?php $session-flash(); ?/p
ul id=comment-list
?php foreach ($comments as $comment): ?
li?php echo $comment['Comment']['body']; ?
br /
On ?php echo $comment['Comment']['created']; ? by ?php echo
$comment['User']['username']; ?
/li
?php endforeach; ?
/ul
?php echo $paginator-next('More comments', null, null, array('class'
= 'disabled')); ?

However, when you click more comments it ALSO loads all the controls
as well as the UL all over again. How can I get it to NOT display the
controls, as well as the UL when loading the next set of comments?

Thanks in advance!

Eric

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Multiple Undo/Redo!!

2010-05-02 Thread paws_galuten
Hey everyone. I've written some code that I'd love to get some
feedback on. I have posted an article here:

http://www.galuten.com/jason/Undo.rtf

It's a bit involved but I think it could be very useful if developed
further!

Thanks for your attention...
Jason

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Model problem with Cake Bake All underscores

2010-05-02 Thread Josh
I hope someone can help me. I am thoroughly getting irritated with
cake bake all.

I have a table named members. In inside this table I have a field
ref_membership_id.

I have a table ref_memberships.

When I do a cake bake all Member I get this error:

Error: Missing database table 'refs' for model 'Ref'

When I do a cake bake, and manually bake my model, it asks me if
Member belongsTo RefMembership? which I say yes, but then it prompts
me Member hasAndBelongsToMany Ref? which I say no. Then the model is
created.

I know I can manually create my models; however I want to figure out
how to get cake bake all to work. I like having the underscores as
described in the CakePHP naming conventions, and I don't think that I
should have to remove them. I am using a singular word 'ref' so it
shouldn't be registering as a HABTM situation. I would prefer not to
have to edit cake source either if possible.

I even tried renaming my table to resource_memberships, in case ref
was some kind of reserved word, but I still get Error: Missing
database table 'resources' for model 'Resource'.

This maybe a bug with cake, but if you see something I am doing wrong
please let me know.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Version 1.3 Routing Vanity URLs

2010-05-02 Thread CharlesTMunger
In my 1.2x app I have vanity URLs from the base.  I.e., a user named
munger can have his page located at:

www.mysite.com/munger

Accomplishing this was pretty straightforward -- in my routes.php I
had this line at the end:

 Router::connect('(?!admin|users|posts)(.*)', array('controller'='users', 
 'action'='view'));

Then, in the view method of my users_controller, I simply did a find
based on user name. I tried upgrading to 1.3 and this doesn't work
anymore  -- I assume it has something to do with not supporting regex
anymore.

So -- any ideas on how to go about accomplishing this in 1.3?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: The docs for Containable does not work for complex search. Complex search is 2 models away. For cake 1.3

2010-05-02 Thread Kei Simone
Hi i did this

$this-Behaviors-attach('Containable');
$this-User-Behaviors-attach('Containable');
$this-Shop-Behaviors-attach('Containable');
$this-Shop-Domain-Behaviors-attach('Containable');

$this-recursive = -1;
$this-User-recursive = -1;
$this-Shop-recursive = -1;
$this-Shop-Domain-recursive = -1;


return $this-find('first', array(
// conditions for the main model
'conditions'=array('Merchant.owner'=1),
// contain
'contain'=array(
'User'=array(
// conditions for the user model

'conditions'=array('User.group_id'=MERCHANTS,
'User.email' = 
'a...@a.com',),

),
'Shop'=array(
'conditions'=array('Shop.web_address' 
= 'http://
abc.myspree2shop.com',),
  'Domain'),
)
));


i got this in the sql query log

SELECT `Merchant`.`id`, `Merchant`.`owner`, `Merchant`.`shop_id`,
`Merchant`.`user_id`, `Shop`.`id`, `Shop`.`theme_id`, `Shop`.`name`,
`Shop`.`web_address`, `Shop`.`created_on`, `Shop`.`modified_on`,
`Shop`.`status`, `User`.`id`, `User`.`email`, `User`.`password`,
`User`.`group_id`, `User`.`full_name`, `User`.`name_to_call`,
`User`.`last_login_on`, `User`.`status`, `User`.`created_on`,
`User`.`modified_on` FROM `merchants` AS `Merchant` LEFT JOIN `shops`
AS `Shop` ON (`Merchant`.`shop_id` = `Shop`.`id` AND
`Shop`.`web_address` = 'http://abc.myspree2shop.com') LEFT JOIN
`users` AS `User` ON (`Merchant`.`user_id` = `User`.`id` AND
`User`.`group_id` = 3 AND `User`.`email` = 'a...@a.com') WHERE
`Merchant`.`owner` = 1 LIMIT 1


SELECT `Shop`.`id`, `Shop`.`theme_id`, `Shop`.`name`,
`Shop`.`web_address`, `Shop`.`created_on`, `Shop`.`modified_on`,
`Shop`.`status` FROM `shops` AS `Shop` WHERE `Shop`.`id` = 1 AND
`Shop`.`web_address` = 'http://abc.myspree2shop.com'

SELECT `User`.`id`, `User`.`email`, `User`.`password`,
`User`.`group_id`, `User`.`full_name`, `User`.`name_to_call`,
`User`.`last_login_on`, `User`.`status`, `User`.`created_on`,
`User`.`modified_on` FROM `users` AS `User` WHERE `User`.`id` = 1 AND
`User`.`group_id` = 3 AND `User`.`email` = 'a...@a.com'



i got this result

Array
(
[Merchant] = Array
(
[id] = 1
[owner] = 1
[shop_id] = 1
[user_id] = 1
)

[Shop] = Array
(
[id] =
[theme_id] =
[name] =
[web_address] =
[created_on] =
[modified_on] =
[status] =
)

[User] = Array
(
[id] =
[email] =
[password] =
[group_id] =
[full_name] =
[name_to_call] =
[last_login_on] =
[status] =
[created_on] =
[modified_on] =
)

)




When i changed your recommendation to

return $this-find('first',
array(
  'contain'=array(
   'User',
   'Shop' = 
array('Domain'
),


   ),
  'conditions' = 
array('User.group_id'=MERCHANTS,
'User.email' = 
'a...@a.com',
 
'Shop.web_address' = 'http://abc.myspree2shop.com',
   )
  )
);


all i did was to move all the conditions to the main model.

i got this in my sql query log:
SELECT `Merchant`.`id`, `Merchant`.`owner`, `Merchant`.`shop_id`,
`Merchant`.`user_id`, `Shop`.`id`, `Shop`.`theme_id`, `Shop`.`name`,
`Shop`.`web_address`, `Shop`.`created_on`, `Shop`.`modified_on`,
`Shop`.`status`, `User`.`id`, `User`.`email`, `User`.`password`,
`User`.`group_id`, `User`.`full_name`, `User`.`name_to_call`,
`User`.`last_login_on`, `User`.`status`, `User`.`created_on`,
`User`.`modified_on` FROM `merchants` AS `Merchant` LEFT JOIN `shops`
AS `Shop` ON (`Merchant`.`shop_id` = `Shop`.`id`) LEFT JOIN `users` AS
`User` ON (`Merchant`.`user_id` = `User`.`id`) WHERE `User`.`group_id`
= 3 AND `User`.`email` = 'a...@a.com' AND `Shop`.`web_address` =
'http://abc.myspree2shop.com' LIMIT 1

SELECT `Shop`.`id`, `Shop`.`theme_id`, `Shop`.`name`,
`Shop`.`web_address`, 

need help

2010-05-02 Thread chandrasekhar reddy
hi all,

i am new to cake php can any 1 help me plz,


1).. $rsProfile = pg_exec($conn,SELECT strprofilename FROM tblmusicprofiles
WHERE lngprofile = $PROFILE_ID);


$rsProfile = $this-Tblmusicprofiles-find(
'all',
array(
 'conditions' = array(
 'Tblmusicprofiles.lngprofile' = $PROFILE_ID
 ),
 'fields' = array(
   'Tblmusicprofiles.strprofilename'
 )
)
);


2).  $intProfileCnt = pg_numrows($rsProfile);


$rsProfile = $this-set('rsProfile', $rsProfile);

$intProfileCnt = $this-Tblmusicprofiles-find(
 'count',
 array('conditions' = array(
   'Tblmusicprofiles.lngprofile' = $PROFILE_ID
  ),
  'fields' = array(
'Tblmusicprofiles.strprofilename'
  )
 )
);

 i am trying the above two statements , i got the out put of first , but i
am unable to find out the number of rows in a particular table with
particular colom . as write the above 2nd statement.


plz help out

thanks in advance,

regards,
chandu

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en