Re: XAMPP & CakePHP > Running in a sub-directory

2009-10-03 Thread Dr. Loboto

Tutorial is definitely wrong if it offers plain HTML in view. Cake
works "out of the box" on any domain/subdir/subsubdir without problems
if you use cake helpers to output anything about paths. Form action,
link href, image src, etc - and do not use hardcoded URLs at all.

On Oct 4, 9:27 am, IamJim  wrote:
>     Thank-you very much for the reply, but the tutorial (so far) is
> not wrong. (except in the SQL of one extra COMMA) that he will be
> fixing.
>
>   Changing the form, would have made it work...but made it a mess for
> portability. It did not "run out of the box" (as describe the pathing
> problem) in a subdirectory, but will on a /localhost/subdomain just
> fine. (pointing to a ROOT)
>
>   The simple resolution is some XAMPP mods to create the subdomain and
> Vhost Alias
>
> http://www.jaredhocutt.com/2009/07/adding-a-subdomain-on-localhost-in...
>
>   Again, thanks much for the reply...and looking to see how this has
> evolved...as I tried it about 2 years ago...and got flustered :-)
>
> On Oct 3, 1:19 pm, "Dr. Loboto"  wrote:
>
>
>
> > If you copied listing 9 
> > fromhttp://www.ibm.com/developerworks/opensource/tutorials/os-php-cake1/s...
> > you get what you get - it is wrong view. And, I afraid, wrong tutorial
> > at all.
>
> > Read about Form helper:http://book.cakephp.org/view/183/Creating-Forms
>
> > On Oct 3, 5:12 pm, IamJim  wrote:
>
> > >    Good day all, and this is my first post to the group and trying to
> > > get Cake to be able to run from a Sub-directory (structure) instead
> > > of /weboot in my XAMPP installation in order to keep this cleaner.
>
> > >http://localhost/myCoreRoutines/cake/
>
> > >   OR??  Maybe I just need to create a 'sub-domain'...in which I am
> > > really unsure how to to to my "localhost" ?? (not sure if I am
> > > explaining this correct, but I am NOT running my local box as a web
> > > server using a FQDN
>
> > >   I did do a 'search' first (prior to posting) ox 'xampp' and there
> > > were 16 results and none of them were really addressing what I need to
> > > accomplish
>
> > >    I am sure it is just a pathing or setting I need to
> > > change...similar to an IF/ELSE statement possibly, but I am usure how
> > > to achieve this please.
>
> > >   I have installed LOCAL as C:\xampp\htdocs\cake
>
> > > LOCAL ENVIRONMENT
> > > Win2kServer running XAMPP
> > > PHP 5.2.9 (cli) (built: Feb 25 2009 15:52:24)
> > > Copyright (c) 1997-2009 The PHP Group
> > > Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
> > >     with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by
> > > Zend Technologies
> > >     with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend
> > > Technologies
>
> > > I also (after local dev and testing) will be uploading to:
>
> > > REMOTE ENVIRONMENT
> > > CENTOS 5.3 i686 standard
> > > PHP 5.2.8 (cli) (built: Jul  8 2009 14:31:09)
> > > Copyright (c) 1997-2008 The PHP Group
> > > Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
>
> > >   For now, I have uploaded my CAKEPHP to a subdomain (created using
> > > cPanel) such as:
>
> > > cake.theWebsite.com
>
> > >   First of all, I am using this tutorial which is laid out VERY WELL
> > > for someone new to understand and is step by step:
>
> > >http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake1/i...
>
> > >   I am able to get up to page 3 of this where there is a form:
>
> > >http://cake.theWebsite.com/users/register
>
> > >   Everything works just fine !!
>
> > >   But, on my LOCAL set up...which is a "sub-directory", and not a sub-
> > > domain (aka WEBROOT) and I am able to get the FORM to load fine
>
> > > And the LOCAL URL is:
>
> > >http://localhost/myCoreRoutines/cake/users/register
>
> > >  but what is happening after FORM SUBMISSION
>
> > > Cake is PATHING this back into the "WEBROOT" of :
>
> > >http://localhost/users/register
>
> > > (Please note the removal of : myCoreRoutines/cake from the URL)
>
> > > and is tossing (of course)
>
> > > Object not found!
> > > The requested URL was not found on this server.
>
> > >   Any help would be greatly appreciated...and I would suspect a simple
> > > solutionit is just I am noew to CAKE.
>
> > >   I had no problem using this SubDir structure using /symfony at all.
>
> > >   Thank you all in advance,
>
> > > Jim
--~--~-~--~~~---~--~~
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: Excluding a node from a tree, and adding a parent node

2009-10-03 Thread Rawna

I actually solved number 1. I added my own Model function:

function excludeIdGenerateTreeList($id = null) {
if (!empty($id)) {
$treeList = $this->generatetreelist();
unset($treeList[$id]);
return $treeList;
}
}


Now I just have to figure what to do with number 2. What's the best
solution for it. Any ideas?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Excluding a node from a tree, and adding a parent node

2009-10-03 Thread Rawna

Hi, I'm using Cake's Tree bhavior and I got a couple of questions:

1. How do I exclude a node when generating a a tree list? (i.e. using
generatetreelist()) ? I'm going to use it when editing a category.

2. When adding a new category, it seems that I can't add a new parent
category. I'm not using a single parent node for everything (is this
advisable or do I really have to create a common parent node?). What I
want is to have a blank selection on my dropdown list to indicate that
the category I'm creating is a parent node.

Thanks in advance!
--~--~-~--~~~---~--~~
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: showEmpty?

2009-10-03 Thread Gonzalo Servat

On Sun, Oct 4, 2009 at 7:21 AM, gimperdan...@gmail.com
 wrote:
[..snip..]
> This is what I have:
>
> echo $form->select('State', array('NJ' => New Jersey', 'NY' => 'New
> York'));
>
> I want to remove the empty option of this select box. According to the
> API I need to add $showEmpty = false to the code above.. but where do
> I add it? I tried in several different locations and it won't work.

The function's arguments are:

select($fieldName, $options = array(), $selected = null, $attributes =
array(), $showEmpty = '')

You only supplied the first and second arguments so if you want to
keep the defaults for the rest except for $showEmpty, you'd need to do
something like the following:

echo $form->select('State', array('NJ' => 'New Jersey', 'NY' => 'New
York'), null, array(), false)

(notice I kept the defaults "null" and "array()" for the arguments
between $options and $showEmpty)

- Gonzalo

--~--~-~--~~~---~--~~
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: XAMPP & CakePHP > Running in a sub-directory

2009-10-03 Thread IamJim

Thank-you very much for the reply, but the tutorial (so far) is
not wrong. (except in the SQL of one extra COMMA) that he will be
fixing.

  Changing the form, would have made it work...but made it a mess for
portability. It did not "run out of the box" (as describe the pathing
problem) in a subdirectory, but will on a /localhost/subdomain just
fine. (pointing to a ROOT)

  The simple resolution is some XAMPP mods to create the subdomain and
Vhost Alias

http://www.jaredhocutt.com/2009/07/adding-a-subdomain-on-localhost-in-windows-and-xampp/#more-3

  Again, thanks much for the reply...and looking to see how this has
evolved...as I tried it about 2 years ago...and got flustered :-)





On Oct 3, 1:19 pm, "Dr. Loboto"  wrote:
> If you copied listing 9 
> fromhttp://www.ibm.com/developerworks/opensource/tutorials/os-php-cake1/s...
> you get what you get - it is wrong view. And, I afraid, wrong tutorial
> at all.
>
> Read about Form helper:http://book.cakephp.org/view/183/Creating-Forms
>
> On Oct 3, 5:12 pm, IamJim  wrote:
>
> >    Good day all, and this is my first post to the group and trying to
> > get Cake to be able to run from a Sub-directory (structure) instead
> > of /weboot in my XAMPP installation in order to keep this cleaner.
>
> >http://localhost/myCoreRoutines/cake/
>
> >   OR??  Maybe I just need to create a 'sub-domain'...in which I am
> > really unsure how to to to my "localhost" ?? (not sure if I am
> > explaining this correct, but I am NOT running my local box as a web
> > server using a FQDN
>
> >   I did do a 'search' first (prior to posting) ox 'xampp' and there
> > were 16 results and none of them were really addressing what I need to
> > accomplish
>
> >    I am sure it is just a pathing or setting I need to
> > change...similar to an IF/ELSE statement possibly, but I am usure how
> > to achieve this please.
>
> >   I have installed LOCAL as C:\xampp\htdocs\cake
>
> > LOCAL ENVIRONMENT
> > Win2kServer running XAMPP
> > PHP 5.2.9 (cli) (built: Feb 25 2009 15:52:24)
> > Copyright (c) 1997-2009 The PHP Group
> > Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
> >     with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by
> > Zend Technologies
> >     with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend
> > Technologies
>
> > I also (after local dev and testing) will be uploading to:
>
> > REMOTE ENVIRONMENT
> > CENTOS 5.3 i686 standard
> > PHP 5.2.8 (cli) (built: Jul  8 2009 14:31:09)
> > Copyright (c) 1997-2008 The PHP Group
> > Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
>
> >   For now, I have uploaded my CAKEPHP to a subdomain (created using
> > cPanel) such as:
>
> > cake.theWebsite.com
>
> >   First of all, I am using this tutorial which is laid out VERY WELL
> > for someone new to understand and is step by step:
>
> >http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake1/i...
>
> >   I am able to get up to page 3 of this where there is a form:
>
> >http://cake.theWebsite.com/users/register
>
> >   Everything works just fine !!
>
> >   But, on my LOCAL set up...which is a "sub-directory", and not a sub-
> > domain (aka WEBROOT) and I am able to get the FORM to load fine
>
> > And the LOCAL URL is:
>
> >http://localhost/myCoreRoutines/cake/users/register
>
> >  but what is happening after FORM SUBMISSION
>
> > Cake is PATHING this back into the "WEBROOT" of :
>
> >http://localhost/users/register
>
> > (Please note the removal of : myCoreRoutines/cake from the URL)
>
> > and is tossing (of course)
>
> > Object not found!
> > The requested URL was not found on this server.
>
> >   Any help would be greatly appreciated...and I would suspect a simple
> > solutionit is just I am noew to CAKE.
>
> >   I had no problem using this SubDir structure using /symfony at all.
>
> >   Thank you all in advance,
>
> > Jim
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



scaffolding

2009-10-03 Thread fixzzle

hi, when i add or delete some record from the scaffolding admin panel
i get this view:

(default) 3 queries took 7 ms NrQuery   Error   AffectedNum. 
rows   Took
(ms)
1   DESCRIBE `scaffoldings` 2   2   6
2   INSERT INTO `scaffoldings` (`text`) VALUES ('New Scaffolding')  
1   1
3   SELECT LAST_INSERT_ID() AS insertID 1   1   0

Just that, without the layout or links to navigate. How can i fix
that? is that normal? thanks in advance.

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



showEmpty?

2009-10-03 Thread gimperdan...@gmail.com

I am new to cake... i have been doing a lot of reading, but somethings
i still can't figure out.

This is what I have:

echo $form->select('State', array('NJ' => New Jersey', 'NY' => 'New
York'));

I want to remove the empty option of this select box. According to the
API I need to add $showEmpty = false to the code above.. but where do
I add it? I tried in several different locations and it won't work.

Thanks

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



Advanced set up install

2009-10-03 Thread Dave Maharaj :: WidePixels.com
I have to install cake on a shared hosting server.
 
The user has 4 domains so the server looks like
 
/public_html
/css
/js
/images
..all files for the hosting master domain1
/domain2
/all site files for domain12.com
/domain3
/all site files for domain3.com
/domain4
/all site files for domain4.com
 
What is the best/most secure way to set cake up in this type of set up? Cake
is only being used for domain4 but i can easily move files/folders around to
suit the needs of cake.
 
I currently have 
 
/domain4
/cake
/app
...
 
Thanks,
 
Dave

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



Help on pagination.

2009-10-03 Thread Jorge Horacio Cué Cantú
Hello,

I need to paginate the following select.

select companies.name, purchase_orders.id, numero_orden_compra,
numero_contrato, codigo_producto, codigo_modelo, purchase_orders.created
  from purchase_orders
join contracts on contracts.id = purchase_orders.contract_id
join companies on companies.id = contracts.company_id
 where status_id = 10
  order by
 (select max(purchase_orders.created) from purchase_orders where
purchase_orders.contract_id = contracts.id and purchase_orders.status_id =
10),
 codigo_producto,
 purchase_orders.created

My problem is I don´t know how to paginate this.

Please help me.
Regards

--~--~-~--~~~---~--~~
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: unexpected T_VARIABLE

2009-10-03 Thread Miles J

Also:

$things = $this->$Thing->find('all');

Should be:

$things = $this->Thing->find('all');
--~--~-~--~~~---~--~~
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: JS/CSS automatic concatenation and compression

2009-10-03 Thread Miles J

@robust - Thanks for the link plug :]

Talking more about your point of "concatenation". I personally am
against it, mainly because certain pages use certain stylesheets. So
if you join all stylesheets into one, some of the stylesheets that
dont belong in a certain page may overwrite CSS that you do not want.
However, that wouldnt happen with JS or if you code CSS to be global.

On Oct 3, 12:37 pm, robust solution  wrote:
> Dear Davit Barbakadze,
> I think none of the suggested solutions for this problem is fair
> enough
> because the solution should do the following
> -all the css links in the head section should be concatenated and
> minified into a single file then gzipped then cached on the server
> -the same for the js links of the head section
>
> i prefer that you do this on your own if you have enough time... just
> few hours... you ill learn something new
> you can start with this 
> linkhttp://www.milesj.me/blog/read/32/CSSJSAsset-Compression-In-CakePHP
--~--~-~--~~~---~--~~
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: Session / Security

2009-10-03 Thread Bert Van den Brande
You might want to read this :
http://be2.php.net/manual/en/session.security.php

On Sat, Oct 3, 2009 at 11:35 PM, Dave Maharaj :: WidePixels.com <
d...@widepixels.com> wrote:

>  Right on.
>
> In my app nothing is passed in the url all my non-private areas are like
> /manage/profile or /manage/account as everything related to the user is
> obtained by auth ID of the logged in user and getting the info based on
> that.
>
> So i was just wondering if someone did get the session, how would they do
> it and ways to prevent it.
>
> Thanks
>
> Dave
>
>  --
> *From:* Bert Van den Brande [mailto:cyr...@gmail.com]
> *Sent:* October-03-09 6:40 PM
> *To:* cake-php@googlegroups.com
> *Subject:* Re: Session / Security
>
> I'm no expert on the subject, but I think session can be hijacked by :
> * 'stealing' a sessions id from the url. This is only possible if the user
> browser doesn't use cookies so the session id is visible in the url
> * stealing a session cookie
>
> In either cases, logging the user's ip would increase security imho.
>
> I'm interested in other opinions :)
>
> On Sat, Oct 3, 2009 at 10:08 PM, Dave Maharaj :: WidePixels.com <
> d...@widepixels.com> wrote:
>
>>  Not quite sure how this works but how does one steal a session?
>>
>> I have my session info stored in the database... if i added ip to the
>> session so it also checks that the session ip matches the user ip would that
>> increase the session sucurity? What a safe guards / good practsise to secure
>> session data?
>>
>> Thanks
>>
>> Dave
>>
>>
>>
> >
>

--~--~-~--~~~---~--~~
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: Session / Security

2009-10-03 Thread Dave Maharaj :: WidePixels.com
Right on.
 
In my app nothing is passed in the url all my non-private areas are like
/manage/profile or /manage/account as everything related to the user is
obtained by auth ID of the logged in user and getting the info based on
that.
 
So i was just wondering if someone did get the session, how would they do it
and ways to prevent it.
 
Thanks
 
Dave

  _  

From: Bert Van den Brande [mailto:cyr...@gmail.com] 
Sent: October-03-09 6:40 PM
To: cake-php@googlegroups.com
Subject: Re: Session / Security


I'm no expert on the subject, but I think session can be hijacked by :
* 'stealing' a sessions id from the url. This is only possible if the user
browser doesn't use cookies so the session id is visible in the url
* stealing a session cookie

In either cases, logging the user's ip would increase security imho.

I'm interested in other opinions :)


On Sat, Oct 3, 2009 at 10:08 PM, Dave Maharaj :: WidePixels.com
 wrote:


Not quite sure how this works but how does one steal a session?
 
I have my session info stored in the database... if i added ip to the
session so it also checks that the session ip matches the user ip would that
increase the session sucurity? What a safe guards / good practsise to secure
session data?
 
Thanks
 
Dave








--~--~-~--~~~---~--~~
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: Validator message not showing

2009-10-03 Thread Bert Van den Brande
Are you setting that flash message yourself ?

You can check if a save has been succesfull or not by looking at the
response that comes back from the $model->save() method ... either true or
false.


On Fri, Oct 2, 2009 at 4:46 PM, Cristian Cassina wrote:

>
> Hi everyone,
> I'm dealing  with a little problem that I can't simply get rid of.
> I have these validation rules in the required model:
>
>  var $validate = array(
>'name' => array(
>'rule' => 'notEmpty',
>'message' => 'Il campo codice non può essere
> lasciato vuoto'
>),
>'customer_name' => array(
>  'rule' => 'notEmpty',
>  'message' => 'Il codice cliente non può essere vuoto'
>),
>'grammatura' => array(
>  'rule' => array('notEmpty', 'numeric'),
>  'message' => 'la scheda deve avere una grammatura'
>)
>);
>
> I probably didn't get the thing right, but if I try to submit the view
> with any of these fields empty, it flashes me "Object has been saved
> correctly", while it didn't save anything.
> What am I doing wrong? Is the setFlash method totally independent from
> the error message in the validator?
> Thank you
>
> Cristian
>
> >
>

--~--~-~--~~~---~--~~
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: Deploy a cakePHP work..

2009-10-03 Thread Bert Van den Brande
1. Develop Cake app locally
2. Get a webhost
3. Use ftp to upload you Cake app

done !

On Sat, Oct 3, 2009 at 9:37 AM, Hafsal M <2haf...@gmail.com> wrote:

> Please help me,
> am a newbie to cakephp... i dont know how a cakephp application should be
> hosted, how is the deploying process is...
>
> thank u in advance.
>
> >
>

--~--~-~--~~~---~--~~
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: cakephp don't execute model trigger plugin's

2009-10-03 Thread Bert Van den Brande
Can you show some code where the save() is called ?

On Sat, Oct 3, 2009 at 7:55 PM, andrzejborkow...@gmail.com <
andrzejborkow...@gmail.com> wrote:

>
> save section is ok, but this triger beforeSave don't execute and dont
> return any value, only working trigers are in >LikecontentAppModel
> whats going one ?
>  class LikecontentSection extends LikecontentAppModel {
>public $validate = array(
>'title' => array('notempty'),
>'text' => array('notempty')
>);
>//The Associations below have been created with all possible keys,
> those that are not needed can be removed
>public $hasMany = array('Likecontent.LikecontentContent');
>
>public function beforeSave(){
>echo 'dupa';
>exit;
>if(empty($this->data['LikecontentSection']['text']) ||
> empty($this-
> >data['LikecontentSection']['url']) || $this->data
> ['LikecontentSection']['subpage'] == 0){
>$this->data['LikecontentSection']['text'] =
> '';
>$this->data['LikecontentSection']['url'] =
> '';
>}
>return true;
> >
>

--~--~-~--~~~---~--~~
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: Caching dynamic url view

2009-10-03 Thread Bert Van den Brande
Maybe it's easier in this case to perform cache reading/writing yourself ?

A simple example is given here : http://book.cakephp.org/view/766/Cache-read

On Sat, Oct 3, 2009 at 7:59 PM, brian  wrote:

>
> I misunderstood what you were looking to do.
>
> On Sat, Oct 3, 2009 at 1:16 PM, thinline  wrote:
> >
> >
> > Well most simply because It's not just the 1 page... There are
> > hundreds of these pages posts/badge/:id/size:180x150 thats what the
> > route would be. My issue is being able to use cacheAction to grab
> > dynamic urls. For instance if I wanted to cache /posts/view/* how
> > could this be done? You would not want to manually create routes and
> > cacheAction entries for each post that is created.
> >
> >
> > On Oct 3, 12:29 pm, brian  wrote:
> >> Why not just create a simplified route for that URL? Something like:
> >>
> >> '/badge',
> >> array('controlller' => 'posts', 'action' => 'your_action', 'id' => 23,
> >> 'size' => '180x150')
> >>
> >> On Fri, Oct 2, 2009 at 10:58 PM, thinline 
> wrote:
> >>
> >> > I am trying to implement full view caching for a specific method in a
> >> > controller.
> >>
> >> > First I realized that if you set $this->layout = false; then caching
> >> > will NOT happen. I have no idea why this occurs. I am not sure if this
> >> > is a bug as I had a hard time debugging out how the cache works.
> >>
> >> > Once, I turned that off I was able to get my view to cache by adding
> >> > var $cacheAction = "1 hour";
> >>
> >> > Since I don't want to cache everything in the view I need to cache
> >> > just specific methods. The URL that I would like to cache looks like
> >> > this:
> >> > /posts/badge/23/size:180x150
> >> > where 23 is the post ID and size is a named parameter (there are 2
> >> > variations of size).
> >>
> >> > So my question is what is the proper (if any) match to place in
> >> > cacheAction to cache all posts/badges/* Here are some examples that I
> >> > have tried:
> >>
> >> > var $cacheAction = array(
> >> >'badge/*' => '+1 hour',
> >> >'posts/badge/23/size:180x150' => '1 hour',
> >> >'badge/23/size:180x150' => '1 hour',
> >> >'posts/badge/:id/:size' => '1 hour',
> >> >'badge/:id/:size' => '1 hour',
> >> > );
> >>
> >> > None of these seem to match (or at least do not cache for some
> >> > reason). I do need to cache posts/badge/*/size:* and trap each of the
> >> > parameters being passed.
> >>
> >> > Again, if I set $cacheAction = "1 hour"; then the cache file is
> >> > created (the file tmp/cache/views/posts_badge_23_size_180x150.php is
> >> > created)
> > >
> >
>
> >
>

--~--~-~--~~~---~--~~
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: Install CakePHP in sub folder ? ? ? How can I ? ? ?

2009-10-03 Thread Bert Van den Brande
If my memory serves me well this is a sign that your host does not has
enabled mod_rewrite or that the .htaccess files are not allowed by Apache
config ...

On Sat, Oct 3, 2009 at 8:11 PM, Dr. Loboto  wrote:

>
> Do you have file named "default.css" in your app/webroot/css folder?
> Filename and css filder are lowecase just as href in line you posted?
>
> On Oct 3, 5:45 pm, DatacenterHellas  wrote:
> > Hello all.
> >
> > I have install the CakePHP in a sub folder in my web hosting package
> >
> > (in examplehttp://www.mydomainname.ext/subfoldername/)
> >
> > The Cake is running very cool but I have problem with CSS and propably
> > with other files (such as javascripts and images) tha I have not yet
> > try.
> >
> > From the source code inside the Firefox I see this code for the CSS
> >
> > 
> >
> > But my page is not styled
> >
> > What Can I do for ? ? ?
> >
> > Kind regards
> >
>

--~--~-~--~~~---~--~~
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: Session / Security

2009-10-03 Thread Bert Van den Brande
I'm no expert on the subject, but I think session can be hijacked by :
* 'stealing' a sessions id from the url. This is only possible if the user
browser doesn't use cookies so the session id is visible in the url
* stealing a session cookie

In either cases, logging the user's ip would increase security imho.

I'm interested in other opinions :)

On Sat, Oct 3, 2009 at 10:08 PM, Dave Maharaj :: WidePixels.com <
d...@widepixels.com> wrote:

>  Not quite sure how this works but how does one steal a session?
>
> I have my session info stored in the database... if i added ip to the
> session so it also checks that the session ip matches the user ip would that
> increase the session sucurity? What a safe guards / good practsise to secure
> session data?
>
> Thanks
>
> Dave
>
> >
>

--~--~-~--~~~---~--~~
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: unexpected T_VARIABLE

2009-10-03 Thread Pablo Viojo
¬¬
Regards,

Pablo Viojo
pvi...@gmail.com
http://pviojo.net

¿Que necesitas?
http://needish.com


On Sat, Oct 3, 2009 at 4:59 PM,  wrote:

> First line of index() is missing a semicolon
> Schreck
>
> -Original Message-
> From: Jeff 
> Date: Sat, 3 Oct 2009 13:01:48
> To: CakePHP
> Subject: unexpected T_VARIABLE
>
>
> Hi,
>
> I am just starting out with cake, making a Facebook app.  I get the
> following error:
>
> Parse error: syntax error, unexpected T_VARIABLE in /users/home/
> trompsbpbc/web/public/app/controllers/things_controller.php on line 22
>
> And here is the code:
>
>  class ThingsController extends AppController {
>var $user;
>
>/**
> * Name: beforeFilter
> * Desc: Performs necessary steps and function calls prior to
> executing
> *   any view function calls.
> */
>function beforeFilter() {
>$this->user = $this->facebook->require_login();
>}
>
>/**
> * Name: index
> * Desc: Display the friends index page.
> */
>function index() {
>// Retrieve the user's friends and pass them to the view.
>$this->loadModel('Thing')
>
>$things = $this->$Thing->find('all');
>$this->set('things', $things);
>
>$friends = $this->facebook->api_client->friends_get();
>$this->set('friends', $friends);
>}
> }
> ?>
>
> Can anyone tell me what is wrong?
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: unexpected T_VARIABLE

2009-10-03 Thread schreck84
First line of index() is missing a semicolon
Schreck

-Original Message-
From: Jeff 
Date: Sat, 3 Oct 2009 13:01:48 
To: CakePHP
Subject: unexpected T_VARIABLE


Hi,

I am just starting out with cake, making a Facebook app.  I get the
following error:

Parse error: syntax error, unexpected T_VARIABLE in /users/home/
trompsbpbc/web/public/app/controllers/things_controller.php on line 22

And here is the code:

user = $this->facebook->require_login();
}

/**
 * Name: index
 * Desc: Display the friends index page.
 */
function index() {
// Retrieve the user's friends and pass them to the view.
$this->loadModel('Thing')

$things = $this->$Thing->find('all');
$this->set('things', $things);

$friends = $this->facebook->api_client->friends_get();
$this->set('friends', $friends);
}
}
?>

Can anyone tell me what is wrong?



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



unexpected T_VARIABLE

2009-10-03 Thread Jeff

Hi,

I am just starting out with cake, making a Facebook app.  I get the
following error:

Parse error: syntax error, unexpected T_VARIABLE in /users/home/
trompsbpbc/web/public/app/controllers/things_controller.php on line 22

And here is the code:

user = $this->facebook->require_login();
}

/**
 * Name: index
 * Desc: Display the friends index page.
 */
function index() {
// Retrieve the user's friends and pass them to the view.
$this->loadModel('Thing')

$things = $this->$Thing->find('all');
$this->set('things', $things);

$friends = $this->facebook->api_client->friends_get();
$this->set('friends', $friends);
}
}
?>

Can anyone tell me what is wrong?

--~--~-~--~~~---~--~~
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: Access Classes In Layout Help??

2009-10-03 Thread brian

Put the select widget in an element. Get the select options with
requestAction(). And cache the options so you don't have to fetch them
from the DB each time.

You don't need to change the target of the AJAX call. It doesn't
matter what view you're in. It's just like any other link.

On Sat, Oct 3, 2009 at 3:06 PM, hahmadi82  wrote:
>
>
> Yea, probably much easier for me to explain what I've done and what I'd like
> to do.
>
> So basically I implemented the ajax select box using the code below:
>
> http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-using-ajax/
>
> My code set up is more less the same as the example posted in that article.
> The ajax select box I created allows a user to select a car make, then year,
> then model.  Currently, I have this working in index.ctp just like the
> example, and the ajax calls the update_select.ctp.
>
> What I would like to do, is move this ajax selector into my navigation bar
> so that the user can change is car at any point during his browsing
> experience.  This means that no matter what view he's on, he can still use
> my ajax selector through the navbar.
>
> The complication is that my code is in my car_controller "index.ctp" and
> uses "update_select.ctp" with observefield (like the example).  I want to
> somehow move this code/functionality into my default.ctp.  Perhaps you guys
> can suggest the best strategy?  Even if I move the code from index.ctp to
> default and access the set variable from the app_controller before filter
> (as suggested), I still have the issue of ajax having to call the
> update_select function which I have no idea where I would move it to
> (perhaps in the app_controller?)...
>
> I apologize for the constant questions and greatly appreciate the help you
> guys have been giving me :)
>
>
>
>
>
> And then we scroll back 15 emails :
>
>
> If this works, then I would suggest to add your layout data to the view
> inside the beforeFilter() method of AppController and then use this data in
> your layout. Might even consider creating an element for the part that uses
> this data ...
>
>
>>
>> :)
>>
>> On Sat, Oct 3, 2009 at 10:34 AM, Miles J  wrote:
>>
>>>
>>> Do it in the beforeFilter() of your AppController, that will apply it
>>> to all views and layouts.
>>>
>>> On Oct 3, 1:18 am, hahmadi82  wrote:
>>> > Now I see!  So the set variables change depending on which view is
>>> showing
>>> > within the default.ctp.  If I add this car action to the app_controller
>>> > (instead of car model) and set the variables there, will all the views
>>> have
>>> > access to that variable? How can I make a global "set" variable that
>>> comes
>>> > from a specific query?
>>> >
>>> >
>>> >
>>> > brian-263 wrote:
>>> >
>>> > > On Fri, Oct 2, 2009 at 10:55 PM, hahmadi82 
>>> wrote:
>>> >
>>> > >> Ok so I actually didn't create a layout for each view from my
>>> > >> controllers.
>>> > >> Instead, all the views use the same layout, which is the
>>> default.ctp.
>>> Is
>>> > >> that incorrect? From my understanding, the default layout is loaded
>>> by
>>> > >> every
>>> > >> view and that's why I have my navigation bar in it.  It seems that I
>>> can
>>> > >> only access those "set" variables from something like
>>> > >> views/layouts/cars/index.ctp but not views/layouts/default.ctp. Is
>>> there
>>> > >> a
>>> > >> difference between the model layouts and the default layout?
>>> >
>>> > > You *almost* have it. Once again:
>>> >
>>> > > When a controller's action is run, its render() method is called
>>> > > automatically (yes, you can call it yourself but please ignore that
>>> > > for now). When that happens, Cake will use the View class to render
>>> > > the view template for that action. These templates are in
>>> > > app/views/controller_name_ending_in_s/action_name.ctp
>>> >
>>> > > Usually, the view template contains some HTML that you have included,
>>> > > along with some variables. Those variables are passed to the View
>>> > > class through the controller's $viewVars class variable. When you
>>> call
>>> > > $this->set('foo', 'bar'), you are passing the value, 'bar' to the
>>> > > controller's $viewVars array with a key, 'foo'.
>>> >
>>> > > When the controller's $viewVars is handed off to the View class, it
>>> > > extracts them, essentially creating a var named $foo that contains
>>> the
>>> > > value 'bar'.
>>> >
>>> > > Now, after the View has finished using the view template to render
>>> > > something to output it creates a variable called,
>>> $content_for_layout.
>>> >
>>> > > It then renders the layout template. That's a file in
>>> > > app/views/layout/name_of_your_layout.ctp. If you don't specify a
>>> > > layout, Cake uses 'default'.
>>> >
>>> > > Inside the layout template is (should be) a variable named ...
>>> > > $content_for_layout. This is where the contents of your rendered view
>>> > > are written to the layout.
>>> >
>>> > > So, try this: In one of your controller actions, add
>>> $this->set('foo',
>>> > > 'bar'

Session / Security

2009-10-03 Thread Dave Maharaj :: WidePixels.com
Not quite sure how this works but how does one steal a session?
 
I have my session info stored in the database... if i added ip to the
session so it also checks that the session ip matches the user ip would that
increase the session sucurity? What a safe guards / good practsise to secure
session data?
 
Thanks
 
Dave

--~--~-~--~~~---~--~~
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: JS/CSS automatic concatenation and compression

2009-10-03 Thread robust solution

Dear Davit Barbakadze,
I think none of the suggested solutions for this problem is fair
enough
because the solution should do the following
-all the css links in the head section should be concatenated and
minified into a single file then gzipped then cached on the server
-the same for the js links of the head section

i prefer that you do this on your own if you have enough time... just
few hours... you ill learn something new
you can start with this link
http://www.milesj.me/blog/read/32/CSSJSAsset-Compression-In-CakePHP
--~--~-~--~~~---~--~~
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: Where request comes from?

2009-10-03 Thread Miles J

I never said it would work with Ajax in the way your thinking, simply
you can have the Security component enabled and the Ajax handler will
work regardless if its on or not.

Additionally, just check the referrer in the Ajax to see if it comes
from your domain, you dont need the Security tokens because most Ajax
calls wont be a full forms data.

On Oct 3, 8:00 am, Martin Westin  wrote:
> Looks like a handy Ajax handler Miles. But I can't see where it makes
> SecurityComponent work with Ajax. All I see is form security being
> disabled (lines 85-87).
>
> Making Ajax work with SecurityComponent would involve actually
> validating that an ajax post came from the correct form. As with
> session ids, the problem again is the asynchronous part of Ajax.
>
> The only half-secure alternative I find remotely practical is to set a
> hash as a global javascript variable on each "real" page load and
> store that in the session. On Ajax requests you let that hash stick
> around and you require ajax to pass that hash along each call. This
> would require the session and the last full page to be hijacked to be
> able to post data via Ajax.
>
> /Martin
>
> On Oct 2, 6:02 pm, Miles J  wrote:
>
> > Well you can use my ajax handler, it wraps the security component so
> > it works with AJAX calls.
>
> >http://www.milesj.me/resources/script/ajax-handler-component
>
> > On Oct 2, 7:12 am, Martin Westin  wrote:
>
> > > You CAN... but it is painful to say the least.
>
> > > Since you can't have your cake and eat it ;) your best bet is to look
> > > inside the Security Component to see what parts you want to use and
> > > then put that into your own component, extend the core component or
> > > something like that. You can also look at the Security class but it
> > > does not offer any turn-key solutions for you.
>
> > > At the risk of being misinterpreted, I am tempted to say that you
> > > should not care where requests comes from. Either a request is a
> > > "public" request like /posts/display/123 or a protected action like /
> > > posts/delete/123. Where the request comes from has little relevance in
> > > the first case. In the second case it really has little relevance too
> > > since you will be much more concerned about a valid session
> > > identifying an authorized user, right?
>
> > > If your security model needs to include "has been posted from exactly
> > > my form on my page" then ajax should not be used for those requests.
> > > IMHO.
>
> > > /Martin
>
> > > On Oct 1, 11:05 pm, "Dave Maharaj :: WidePixels.com"
>
> > >  wrote:
> > > > But no good for AJAX.
>
> > > > I have AJAX forms in my app so I cant use the security component.
>
> > > > Can I? I know it wont work for AJAX submitted forms. I was just curious.
>
> > > > Dave
>
> > > > -Original Message-
> > > > From: Martin Westin [mailto:martin.westin...@gmail.com]
> > > > Sent: October-01-09 5:45 PM
> > > > To: CakePHP
> > > > Subject: Re: Where request comes from?
>
> > > > The Security Component does this kind of thing for you. For example, it 
> > > > will
> > > > embed a hash value into the form which is a checksum of the form. If a 
> > > > field
> > > > is missing or added it will be captured. If a hidden value is modified 
> > > > this
> > > > will also be captured. Also sessions will be more secure and a lot 
> > > > harder to
> > > > hijack since the session id is replaced for each request.
>
> > > > And a buch more stuff.
>
> > > > /Martin
>
> > > > On Oct 1, 9:36 pm, Bert Van den Brande  wrote:
> > > > > I believe the FormHelper has some 'secure' stuff available for this
> > > > > ... best to consult the documentation ...
>
> > > > > On Thu, Oct 1, 2009 at 8:50 PM, Dave Maharaj :: WidePixels.com <
>
> > > > > d...@widepixels.com> wrote:
> > > > > >  Is there a way to determine / ensure that any requested action
> > > > > > comes from the server?
>
> > > > > > I mean more towards the aspect of forms. That when a form is
> > > > > > submitted the request is coming from the site and not someone who
> > > > > > made a form and trying to submit it to your site.
>
> > > > > > Just curious
>
> > > > > > Thanks,
>
> > > > > > Dave
--~--~-~--~~~---~--~~
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 do you install Cake PHP?

2009-10-03 Thread Miles J

Well CakePHP is a framework, its not a script like Wordpress you can
install.

All you do is move all the files and folders to a destination on your
server and setup everything manually.

The install guide is pretty straight forward: 
http://book.cakephp.org/view/32/Installation

On Oct 3, 7:19 am, Jenny Caldwell  wrote:
> Okay I'm totally new to this.  I'm taking PHP in school and I
> downloaded CakePHP.  Now what?  What do I do with it.  I looked around
> the site and can't find anything.  This is all so confusing.
>
> Thanks for your help!
--~--~-~--~~~---~--~~
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 remove query's description in footer

2009-10-03 Thread Miles J

I still find it funny that people think the query debug output will
show up on live <_<

On Oct 3, 11:00 am, brian  wrote:
> In app/config/core.php:
>
> Configure::write('debug', 0);
>
> On Sat, Oct 3, 2009 at 11:39 AM, lokesh sharma  wrote:
>
> > I'm beginner in cake PHP. After configure database, model, controller
> > & view, I got my page running but in footer I'm getting queries
> > related information which  I want to remove.
>
> > Any pointer or help will be very appreciable
> > Thanks in advance
>
> > Regards,
> > Lokesh
--~--~-~--~~~---~--~~
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: Access Classes In Layout Help??

2009-10-03 Thread hahmadi82


Yea, probably much easier for me to explain what I've done and what I'd like
to do.

So basically I implemented the ajax select box using the code below:

http://www.devmoz.com/blog/2007/04/04/cakephp-update-a-select-box-using-ajax/

My code set up is more less the same as the example posted in that article. 
The ajax select box I created allows a user to select a car make, then year,
then model.  Currently, I have this working in index.ctp just like the
example, and the ajax calls the update_select.ctp.

What I would like to do, is move this ajax selector into my navigation bar
so that the user can change is car at any point during his browsing
experience.  This means that no matter what view he's on, he can still use
my ajax selector through the navbar.

The complication is that my code is in my car_controller "index.ctp" and
uses "update_select.ctp" with observefield (like the example).  I want to
somehow move this code/functionality into my default.ctp.  Perhaps you guys
can suggest the best strategy?  Even if I move the code from index.ctp to
default and access the set variable from the app_controller before filter
(as suggested), I still have the issue of ajax having to call the
update_select function which I have no idea where I would move it to
(perhaps in the app_controller?)...

I apologize for the constant questions and greatly appreciate the help you
guys have been giving me :)  





And then we scroll back 15 emails :


If this works, then I would suggest to add your layout data to the view
inside the beforeFilter() method of AppController and then use this data in
your layout. Might even consider creating an element for the part that uses
this data ...


> 
> :)
> 
> On Sat, Oct 3, 2009 at 10:34 AM, Miles J  wrote:
> 
>>
>> Do it in the beforeFilter() of your AppController, that will apply it
>> to all views and layouts.
>>
>> On Oct 3, 1:18 am, hahmadi82  wrote:
>> > Now I see!  So the set variables change depending on which view is
>> showing
>> > within the default.ctp.  If I add this car action to the app_controller
>> > (instead of car model) and set the variables there, will all the views
>> have
>> > access to that variable? How can I make a global "set" variable that
>> comes
>> > from a specific query?
>> >
>> >
>> >
>> > brian-263 wrote:
>> >
>> > > On Fri, Oct 2, 2009 at 10:55 PM, hahmadi82 
>> wrote:
>> >
>> > >> Ok so I actually didn't create a layout for each view from my
>> > >> controllers.
>> > >> Instead, all the views use the same layout, which is the
>> default.ctp.
>> Is
>> > >> that incorrect? From my understanding, the default layout is loaded
>> by
>> > >> every
>> > >> view and that's why I have my navigation bar in it.  It seems that I
>> can
>> > >> only access those "set" variables from something like
>> > >> views/layouts/cars/index.ctp but not views/layouts/default.ctp. Is
>> there
>> > >> a
>> > >> difference between the model layouts and the default layout?
>> >
>> > > You *almost* have it. Once again:
>> >
>> > > When a controller's action is run, its render() method is called
>> > > automatically (yes, you can call it yourself but please ignore that
>> > > for now). When that happens, Cake will use the View class to render
>> > > the view template for that action. These templates are in
>> > > app/views/controller_name_ending_in_s/action_name.ctp
>> >
>> > > Usually, the view template contains some HTML that you have included,
>> > > along with some variables. Those variables are passed to the View
>> > > class through the controller's $viewVars class variable. When you
>> call
>> > > $this->set('foo', 'bar'), you are passing the value, 'bar' to the
>> > > controller's $viewVars array with a key, 'foo'.
>> >
>> > > When the controller's $viewVars is handed off to the View class, it
>> > > extracts them, essentially creating a var named $foo that contains
>> the
>> > > value 'bar'.
>> >
>> > > Now, after the View has finished using the view template to render
>> > > something to output it creates a variable called,
>> $content_for_layout.
>> >
>> > > It then renders the layout template. That's a file in
>> > > app/views/layout/name_of_your_layout.ctp. If you don't specify a
>> > > layout, Cake uses 'default'.
>> >
>> > > Inside the layout template is (should be) a variable named ...
>> > > $content_for_layout. This is where the contents of your rendered view
>> > > are written to the layout.
>> >
>> > > So, try this: In one of your controller actions, add
>> $this->set('foo',
>> > > 'bar');
>> >
>> > > In your app/views/layouts/default.ctp add this, just above
>> > > $content_for_layout
>> >
>> > > echo $foo;
>> >
>> > > You should see 'bar' in there, somewhere. View source and search for
>> > > it, because your CSS may hide it.
>> >
>> > > Anyway, perhaps you should post the relevant part of your layout file
>> > > and the controller action.
>> >
>> > --
>> > View this message in context:
>> http://www.nabble.com/Access-Classes-In-Layout-Help---tp25706283p

Re: JS/CSS automatic concatenation and compression

2009-10-03 Thread Sam Sherlock
Matt Curry Asset Pluginhttp://github.com/mcurry/asset

- S


2009/10/3 schneimi 

>
> Hi,
>
> I do this aside from CakePHP, not automatically but with one click in
> eclipse.
>
> This tutorial I wrote might be interesting for you:
>
> http://schneimi.wordpress.com/2009/04/30/speed-up-your-website-with-one-click-in-eclipse/
>
> Regards,
> Michael
>
>
> On 3 Okt., 11:29, Davit Barbakadze  wrote:
> > I wonder whether there already written plugin or component which
> > automatically concatenates all js and css files used (separately of
> > course), compresses them and places them onto corresponng place in the
> > layout?
> >
> > So that in the end, for example, no matter how many js files were
> > included, in the header only one, compressed will be referenced,
> > holding united info of all those included js files.
> >
>

--~--~-~--~~~---~--~~
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: XAMPP & CakePHP > Running in a sub-directory

2009-10-03 Thread Dr. Loboto

If you copied listing 9 from 
http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake1/section3.html
you get what you get - it is wrong view. And, I afraid, wrong tutorial
at all.

Read about Form helper: http://book.cakephp.org/view/183/Creating-Forms

On Oct 3, 5:12 pm, IamJim  wrote:
>    Good day all, and this is my first post to the group and trying to
> get Cake to be able to run from a Sub-directory (structure) instead
> of /weboot in my XAMPP installation in order to keep this cleaner.
>
> http://localhost/myCoreRoutines/cake/
>
>   OR??  Maybe I just need to create a 'sub-domain'...in which I am
> really unsure how to to to my "localhost" ?? (not sure if I am
> explaining this correct, but I am NOT running my local box as a web
> server using a FQDN
>
>   I did do a 'search' first (prior to posting) ox 'xampp' and there
> were 16 results and none of them were really addressing what I need to
> accomplish
>
>    I am sure it is just a pathing or setting I need to
> change...similar to an IF/ELSE statement possibly, but I am usure how
> to achieve this please.
>
>   I have installed LOCAL as C:\xampp\htdocs\cake
>
> LOCAL ENVIRONMENT
> Win2kServer running XAMPP
> PHP 5.2.9 (cli) (built: Feb 25 2009 15:52:24)
> Copyright (c) 1997-2009 The PHP Group
> Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
>     with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by
> Zend Technologies
>     with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend
> Technologies
>
> I also (after local dev and testing) will be uploading to:
>
> REMOTE ENVIRONMENT
> CENTOS 5.3 i686 standard
> PHP 5.2.8 (cli) (built: Jul  8 2009 14:31:09)
> Copyright (c) 1997-2008 The PHP Group
> Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
>
>   For now, I have uploaded my CAKEPHP to a subdomain (created using
> cPanel) such as:
>
> cake.theWebsite.com
>
>   First of all, I am using this tutorial which is laid out VERY WELL
> for someone new to understand and is step by step:
>
> http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake1/i...
>
>   I am able to get up to page 3 of this where there is a form:
>
> http://cake.theWebsite.com/users/register
>
>   Everything works just fine !!
>
>   But, on my LOCAL set up...which is a "sub-directory", and not a sub-
> domain (aka WEBROOT) and I am able to get the FORM to load fine
>
> And the LOCAL URL is:
>
> http://localhost/myCoreRoutines/cake/users/register
>
>  but what is happening after FORM SUBMISSION
>
> Cake is PATHING this back into the "WEBROOT" of :
>
> http://localhost/users/register
>
> (Please note the removal of : myCoreRoutines/cake from the URL)
>
> and is tossing (of course)
>
> Object not found!
> The requested URL was not found on this server.
>
>   Any help would be greatly appreciated...and I would suspect a simple
> solutionit is just I am noew to CAKE.
>
>   I had no problem using this SubDir structure using /symfony at all.
>
>   Thank you all in advance,
>
> Jim
--~--~-~--~~~---~--~~
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: Access Classes In Layout Help??

2009-10-03 Thread Bert Van den Brande
And then we scroll back 15 emails :


If this works, then I would suggest to add your layout data to the view
inside the beforeFilter() method of AppController and then use this data in
your layout. Might even consider creating an element for the part that uses
this data ...


:)

On Sat, Oct 3, 2009 at 10:34 AM, Miles J  wrote:

>
> Do it in the beforeFilter() of your AppController, that will apply it
> to all views and layouts.
>
> On Oct 3, 1:18 am, hahmadi82  wrote:
> > Now I see!  So the set variables change depending on which view is
> showing
> > within the default.ctp.  If I add this car action to the app_controller
> > (instead of car model) and set the variables there, will all the views
> have
> > access to that variable? How can I make a global "set" variable that
> comes
> > from a specific query?
> >
> >
> >
> > brian-263 wrote:
> >
> > > On Fri, Oct 2, 2009 at 10:55 PM, hahmadi82 
> wrote:
> >
> > >> Ok so I actually didn't create a layout for each view from my
> > >> controllers.
> > >> Instead, all the views use the same layout, which is the default.ctp.
> Is
> > >> that incorrect? From my understanding, the default layout is loaded by
> > >> every
> > >> view and that's why I have my navigation bar in it.  It seems that I
> can
> > >> only access those "set" variables from something like
> > >> views/layouts/cars/index.ctp but not views/layouts/default.ctp. Is
> there
> > >> a
> > >> difference between the model layouts and the default layout?
> >
> > > You *almost* have it. Once again:
> >
> > > When a controller's action is run, its render() method is called
> > > automatically (yes, you can call it yourself but please ignore that
> > > for now). When that happens, Cake will use the View class to render
> > > the view template for that action. These templates are in
> > > app/views/controller_name_ending_in_s/action_name.ctp
> >
> > > Usually, the view template contains some HTML that you have included,
> > > along with some variables. Those variables are passed to the View
> > > class through the controller's $viewVars class variable. When you call
> > > $this->set('foo', 'bar'), you are passing the value, 'bar' to the
> > > controller's $viewVars array with a key, 'foo'.
> >
> > > When the controller's $viewVars is handed off to the View class, it
> > > extracts them, essentially creating a var named $foo that contains the
> > > value 'bar'.
> >
> > > Now, after the View has finished using the view template to render
> > > something to output it creates a variable called, $content_for_layout.
> >
> > > It then renders the layout template. That's a file in
> > > app/views/layout/name_of_your_layout.ctp. If you don't specify a
> > > layout, Cake uses 'default'.
> >
> > > Inside the layout template is (should be) a variable named ...
> > > $content_for_layout. This is where the contents of your rendered view
> > > are written to the layout.
> >
> > > So, try this: In one of your controller actions, add $this->set('foo',
> > > 'bar');
> >
> > > In your app/views/layouts/default.ctp add this, just above
> > > $content_for_layout
> >
> > > echo $foo;
> >
> > > You should see 'bar' in there, somewhere. View source and search for
> > > it, because your CSS may hide it.
> >
> > > Anyway, perhaps you should post the relevant part of your layout file
> > > and the controller action.
> >
> > --
> > View this message in context:
> http://www.nabble.com/Access-Classes-In-Layout-Help---tp25706283p2572...
> > Sent from the CakePHP mailing list archive at Nabble.com.
> >
>

--~--~-~--~~~---~--~~
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: Install CakePHP in sub folder ? ? ? How can I ? ? ?

2009-10-03 Thread Dr. Loboto

Do you have file named "default.css" in your app/webroot/css folder?
Filename and css filder are lowecase just as href in line you posted?

On Oct 3, 5:45 pm, DatacenterHellas  wrote:
> Hello all.
>
> I have install the CakePHP in a sub folder in my web hosting package
>
> (in examplehttp://www.mydomainname.ext/subfoldername/)
>
> The Cake is running very cool but I have problem with CSS and propably
> with other files (such as javascripts and images) tha I have not yet
> try.
>
> From the source code inside the Firefox I see this code for the CSS
>
> 
>
> But my page is not styled
>
> What Can I do for ? ? ?
>
> Kind regards
--~--~-~--~~~---~--~~
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 remove query's description in footer

2009-10-03 Thread brian

In app/config/core.php:

Configure::write('debug', 0);

On Sat, Oct 3, 2009 at 11:39 AM, lokesh sharma  wrote:
>
> I'm beginner in cake PHP. After configure database, model, controller
> & view, I got my page running but in footer I'm getting queries
> related information which  I want to remove.
>
> Any pointer or help will be very appreciable
> Thanks in advance
>
> Regards,
> Lokesh
>
> >
>

--~--~-~--~~~---~--~~
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: Caching dynamic url view

2009-10-03 Thread brian

I misunderstood what you were looking to do.

On Sat, Oct 3, 2009 at 1:16 PM, thinline  wrote:
>
>
> Well most simply because It's not just the 1 page... There are
> hundreds of these pages posts/badge/:id/size:180x150 thats what the
> route would be. My issue is being able to use cacheAction to grab
> dynamic urls. For instance if I wanted to cache /posts/view/* how
> could this be done? You would not want to manually create routes and
> cacheAction entries for each post that is created.
>
>
> On Oct 3, 12:29 pm, brian  wrote:
>> Why not just create a simplified route for that URL? Something like:
>>
>> '/badge',
>> array('controlller' => 'posts', 'action' => 'your_action', 'id' => 23,
>> 'size' => '180x150')
>>
>> On Fri, Oct 2, 2009 at 10:58 PM, thinline  wrote:
>>
>> > I am trying to implement full view caching for a specific method in a
>> > controller.
>>
>> > First I realized that if you set $this->layout = false; then caching
>> > will NOT happen. I have no idea why this occurs. I am not sure if this
>> > is a bug as I had a hard time debugging out how the cache works.
>>
>> > Once, I turned that off I was able to get my view to cache by adding
>> > var $cacheAction = "1 hour";
>>
>> > Since I don't want to cache everything in the view I need to cache
>> > just specific methods. The URL that I would like to cache looks like
>> > this:
>> > /posts/badge/23/size:180x150
>> > where 23 is the post ID and size is a named parameter (there are 2
>> > variations of size).
>>
>> > So my question is what is the proper (if any) match to place in
>> > cacheAction to cache all posts/badges/* Here are some examples that I
>> > have tried:
>>
>> > var $cacheAction = array(
>> >        'badge/*' => '+1 hour',
>> >        'posts/badge/23/size:180x150' => '1 hour',
>> >        'badge/23/size:180x150' => '1 hour',
>> >        'posts/badge/:id/:size' => '1 hour',
>> >        'badge/:id/:size' => '1 hour',
>> > );
>>
>> > None of these seem to match (or at least do not cache for some
>> > reason). I do need to cache posts/badge/*/size:* and trap each of the
>> > parameters being passed.
>>
>> > Again, if I set $cacheAction = "1 hour"; then the cache file is
>> > created (the file tmp/cache/views/posts_badge_23_size_180x150.php is
>> > created)
> >
>

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



cakephp don't execute model trigger plugin's

2009-10-03 Thread andrzejborkow...@gmail.com

save section is ok, but this triger beforeSave don't execute and dont
return any value, only working trigers are in >LikecontentAppModel
whats going one ?
 array('notempty'),
'text' => array('notempty')
);
//The Associations below have been created with all possible keys,
those that are not needed can be removed
public $hasMany = array('Likecontent.LikecontentContent');

public function beforeSave(){
echo 'dupa';
exit;
if(empty($this->data['LikecontentSection']['text']) || 
empty($this-
>data['LikecontentSection']['url']) || $this->data
['LikecontentSection']['subpage'] == 0){
$this->data['LikecontentSection']['text'] = '';
$this->data['LikecontentSection']['url'] = '';
}
return true;
--~--~-~--~~~---~--~~
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: Caching dynamic url view

2009-10-03 Thread thinline


Well most simply because It's not just the 1 page... There are
hundreds of these pages posts/badge/:id/size:180x150 thats what the
route would be. My issue is being able to use cacheAction to grab
dynamic urls. For instance if I wanted to cache /posts/view/* how
could this be done? You would not want to manually create routes and
cacheAction entries for each post that is created.


On Oct 3, 12:29 pm, brian  wrote:
> Why not just create a simplified route for that URL? Something like:
>
> '/badge',
> array('controlller' => 'posts', 'action' => 'your_action', 'id' => 23,
> 'size' => '180x150')
>
> On Fri, Oct 2, 2009 at 10:58 PM, thinline  wrote:
>
> > I am trying to implement full view caching for a specific method in a
> > controller.
>
> > First I realized that if you set $this->layout = false; then caching
> > will NOT happen. I have no idea why this occurs. I am not sure if this
> > is a bug as I had a hard time debugging out how the cache works.
>
> > Once, I turned that off I was able to get my view to cache by adding
> > var $cacheAction = "1 hour";
>
> > Since I don't want to cache everything in the view I need to cache
> > just specific methods. The URL that I would like to cache looks like
> > this:
> > /posts/badge/23/size:180x150
> > where 23 is the post ID and size is a named parameter (there are 2
> > variations of size).
>
> > So my question is what is the proper (if any) match to place in
> > cacheAction to cache all posts/badges/* Here are some examples that I
> > have tried:
>
> > var $cacheAction = array(
> >        'badge/*' => '+1 hour',
> >        'posts/badge/23/size:180x150' => '1 hour',
> >        'badge/23/size:180x150' => '1 hour',
> >        'posts/badge/:id/:size' => '1 hour',
> >        'badge/:id/:size' => '1 hour',
> > );
>
> > None of these seem to match (or at least do not cache for some
> > reason). I do need to cache posts/badge/*/size:* and trap each of the
> > parameters being passed.
>
> > Again, if I set $cacheAction = "1 hour"; then the cache file is
> > created (the file tmp/cache/views/posts_badge_23_size_180x150.php is
> > created)
--~--~-~--~~~---~--~~
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: $form->input('') when database-field contains special characters

2009-10-03 Thread Melanie Sommer

Hello Martin
> Since the field is empty I suspect you may have Sanitize in place, or
> some other text cleaner.
No (not that I know, just the standard content that cakephp gives you
when baking)

> A simple character set problem should give you garbage but not empty strings.
This is also was I thought. But when changing the default settings of
my webhoster from latin1 (iso-something) to utf-8 everything worked
fine. Strange but impressive.

Melanie
--~--~-~--~~~---~--~~
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 do you install Cake PHP?

2009-10-03 Thread Jim C wp

Hi Jenny :-)

This will help you get started...assuming you have php/apache and the
stuff installed already..

http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake1/section2.html

Jim

www.jamesjcotton.com/ata

- Original Message - 
From: "Jenny Caldwell" 
To: "CakePHP" 
Sent: Saturday, October 03, 2009 09:19
Subject: How do you install Cake PHP?


>
> Okay I'm totally new to this.  I'm taking PHP in school and I
> downloaded CakePHP.  Now what?  What do I do with it.  I looked around
> the site and can't find anything.  This is all so confusing.
>
> Thanks for your help!
>
> >


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



How do you install Cake PHP?

2009-10-03 Thread Jenny Caldwell

Okay I'm totally new to this.  I'm taking PHP in school and I
downloaded CakePHP.  Now what?  What do I do with it.  I looked around
the site and can't find anything.  This is all so confusing.

Thanks for your help!

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



How to remove query's description in footer

2009-10-03 Thread lokesh sharma

I'm beginner in cake PHP. After configure database, model, controller
& view, I got my page running but in footer I'm getting queries
related information which  I want to remove.

Any pointer or help will be very appreciable
Thanks in advance

Regards,
Lokesh

--~--~-~--~~~---~--~~
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: Caching dynamic url view

2009-10-03 Thread brian

Why not just create a simplified route for that URL? Something like:

'/badge',
array('controlller' => 'posts', 'action' => 'your_action', 'id' => 23,
'size' => '180x150')

On Fri, Oct 2, 2009 at 10:58 PM, thinline  wrote:
>
>
> I am trying to implement full view caching for a specific method in a
> controller.
>
> First I realized that if you set $this->layout = false; then caching
> will NOT happen. I have no idea why this occurs. I am not sure if this
> is a bug as I had a hard time debugging out how the cache works.
>
> Once, I turned that off I was able to get my view to cache by adding
> var $cacheAction = "1 hour";
>
> Since I don't want to cache everything in the view I need to cache
> just specific methods. The URL that I would like to cache looks like
> this:
> /posts/badge/23/size:180x150
> where 23 is the post ID and size is a named parameter (there are 2
> variations of size).
>
> So my question is what is the proper (if any) match to place in
> cacheAction to cache all posts/badges/* Here are some examples that I
> have tried:
>
> var $cacheAction = array(
>        'badge/*' => '+1 hour',
>        'posts/badge/23/size:180x150' => '1 hour',
>        'badge/23/size:180x150' => '1 hour',
>        'posts/badge/:id/:size' => '1 hour',
>        'badge/:id/:size' => '1 hour',
> );
>
> None of these seem to match (or at least do not cache for some
> reason). I do need to cache posts/badge/*/size:* and trap each of the
> parameters being passed.
>
> Again, if I set $cacheAction = "1 hour"; then the cache file is
> created (the file tmp/cache/views/posts_badge_23_size_180x150.php is
> created)
>
> >
>

--~--~-~--~~~---~--~~
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: Access Classes In Layout Help??

2009-10-03 Thread brian

On Sat, Oct 3, 2009 at 4:18 AM, hahmadi82  wrote:
>
>
> Now I see!  So the set variables change depending on which view is showing
> within the default.ctp.  If I add this car action to the app_controller
> (instead of car model) and set the variables there, will all the views have
> access to that variable? How can I make a global "set" variable that comes
> from a specific query?

I think you're still not quite seeing it. But I'm having some
difficulty understanding what it is you're trying to do. Maybe you
should post some code.

--~--~-~--~~~---~--~~
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: Using a page outside of CakePHP

2009-10-03 Thread brian

On Sat, Oct 3, 2009 at 2:54 AM, Josh K  wrote:
>
> Thanks for the reply.  I would actually like to use the two pages
> outside of the Cake document root since I have Cake and its app files
> on a subdirectory.  For example:
>
> I would like to copy:
>
> /home/public_html/cake/app/views/forms/form1
>
> to
>
> /home/public_html/form1.php
>
> What type of php includes would I need to do this?
>

I don't follow your reasoning but, anyway, you'd need to have add some
conditions to your .htaccess file in public_html. Something like:

RewriteCond %{REQUEST_URI} !^your_form
RewriteCond %{REQUEST_URI} !^your_other_form

But I don't have much experience using Cake in a subdirectory so
someone else might know better.

--~--~-~--~~~---~--~~
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: Where request comes from?

2009-10-03 Thread Martin Westin

Looks like a handy Ajax handler Miles. But I can't see where it makes
SecurityComponent work with Ajax. All I see is form security being
disabled (lines 85-87).

Making Ajax work with SecurityComponent would involve actually
validating that an ajax post came from the correct form. As with
session ids, the problem again is the asynchronous part of Ajax.

The only half-secure alternative I find remotely practical is to set a
hash as a global javascript variable on each "real" page load and
store that in the session. On Ajax requests you let that hash stick
around and you require ajax to pass that hash along each call. This
would require the session and the last full page to be hijacked to be
able to post data via Ajax.


/Martin


On Oct 2, 6:02 pm, Miles J  wrote:
> Well you can use my ajax handler, it wraps the security component so
> it works with AJAX calls.
>
> http://www.milesj.me/resources/script/ajax-handler-component
>
> On Oct 2, 7:12 am, Martin Westin  wrote:
>
>
>
> > You CAN... but it is painful to say the least.
>
> > Since you can't have your cake and eat it ;) your best bet is to look
> > inside the Security Component to see what parts you want to use and
> > then put that into your own component, extend the core component or
> > something like that. You can also look at the Security class but it
> > does not offer any turn-key solutions for you.
>
> > At the risk of being misinterpreted, I am tempted to say that you
> > should not care where requests comes from. Either a request is a
> > "public" request like /posts/display/123 or a protected action like /
> > posts/delete/123. Where the request comes from has little relevance in
> > the first case. In the second case it really has little relevance too
> > since you will be much more concerned about a valid session
> > identifying an authorized user, right?
>
> > If your security model needs to include "has been posted from exactly
> > my form on my page" then ajax should not be used for those requests.
> > IMHO.
>
> > /Martin
>
> > On Oct 1, 11:05 pm, "Dave Maharaj :: WidePixels.com"
>
> >  wrote:
> > > But no good for AJAX.
>
> > > I have AJAX forms in my app so I cant use the security component.
>
> > > Can I? I know it wont work for AJAX submitted forms. I was just curious.
>
> > > Dave
>
> > > -Original Message-
> > > From: Martin Westin [mailto:martin.westin...@gmail.com]
> > > Sent: October-01-09 5:45 PM
> > > To: CakePHP
> > > Subject: Re: Where request comes from?
>
> > > The Security Component does this kind of thing for you. For example, it 
> > > will
> > > embed a hash value into the form which is a checksum of the form. If a 
> > > field
> > > is missing or added it will be captured. If a hidden value is modified 
> > > this
> > > will also be captured. Also sessions will be more secure and a lot harder 
> > > to
> > > hijack since the session id is replaced for each request.
>
> > > And a buch more stuff.
>
> > > /Martin
>
> > > On Oct 1, 9:36 pm, Bert Van den Brande  wrote:
> > > > I believe the FormHelper has some 'secure' stuff available for this
> > > > ... best to consult the documentation ...
>
> > > > On Thu, Oct 1, 2009 at 8:50 PM, Dave Maharaj :: WidePixels.com <
>
> > > > d...@widepixels.com> wrote:
> > > > >  Is there a way to determine / ensure that any requested action
> > > > > comes from the server?
>
> > > > > I mean more towards the aspect of forms. That when a form is
> > > > > submitted the request is coming from the site and not someone who
> > > > > made a form and trying to submit it to your site.
>
> > > > > Just curious
>
> > > > > Thanks,
>
> > > > > Dave
--~--~-~--~~~---~--~~
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: Install CakePHP in sub folder ? ? ? How can I ? ? ?

2009-10-03 Thread Cristian Cassina

Hello,

probably i didn't get it right, but if you put your CSS files in the 
webroot/css directory you shouldn't have any problem. I did the very 
same thing, putting my app in a subfolder, the tuning the routes for the 
homepage accordingly and everything works (as it should). Does your 
default.ctp call the CSS the proper way?


DatacenterHellas ha scritto:
> Hello all.
>
> I have install the CakePHP in a sub folder in my web hosting package
>
> (in example http://www.mydomainname.ext/subfoldername/)
>
> The Cake is running very cool but I have problem with CSS and propably
> with other files (such as javascripts and images) tha I have not yet
> try.
>
> From the source code inside the Firefox I see this code for the CSS
>
> 
>
> But my page is not styled
>
> What Can I do for ? ? ?
>
> Kind regards
> >
>   


--~--~-~--~~~---~--~~
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: Javascript libraries with images/css inside Cake Plugins

2009-10-03 Thread womble

Its a pain, because ideally just dumping it all under plugin_name/js/
the_lib would be ideal.  I haven't given up on it, just taken a break
from it for a while, I'll get motivated again sometime.

The only suggestion I was given was to load the library under webroot
- but this takes away the ability to package it all as the plugin.

On Oct 3, 7:27 pm, Elte Hupkes  wrote:
> Exactly. I know the paths are righ, because the css files and js libs
> do get loaded, and if I place them under the app's /webroot/ folder,
> so do the images/other files they include. Just not when they're
> inside a plugin's vendors folder (the same problem occurs with
> javascript in the normal vendors folder by the way, but that has a
> clear cause if you look at the vendors.php file in the webroot/js
> folder).
>
> So it pretty much comes down to this: when for instance I place a file
> named "upload.swf" inside the /plugins/myplugin/vendors/js/ I would
> like to be able to browse to it via url/myplugin/js/upload.swf, this
> doesn't work though. And indeed it's not preferable to change the file
> locations inside a 3rd party lib, but for swf-files the _only_
> solution is moving it to the webroot folder, because it simply gets
> ignored from anywhere inside the plugin's vendors folder.
>
> Too bad you never found a good solution..
>
> On Oct 2, 2:28 pm, womble  wrote:
>
> > I'm pretty sure its not the 'prefacing' etc.  But I may be wrong.
>
> > I basically had the same problem with ext-js.  I didn't ever find a
> > good solution.  But there has to be somewhere to change the Cake
> > settings.  My problem was that the library css was referencing
> > relative urls of images, but the images were not accessible unless
> > they were located under the plugin_name/img  folder.  And if I put the
> > whole library under the plugin_name/js folder the css and images were
> > not accessible.
>
> > If it were all my own code it wouldn't be an issue, but as they're 3rd
> > party libraries its preferable not to change paths in the css etc.
>
> > On Oct 1, 2:03 am, brian  wrote:
>
> > > How are you linking the css files? You should only need to preface the
> > > file name with 'plugin_name/css/', eg.
> > > $html->css('/plugin_name/css/css_filename');
>
> > > On Tue, Sep 29, 2009 at 6:32 PM, Elte Hupkes  wrote:
>
> > > > I'm trying to develop a small backend cms-plugin, which contains some
> > > > Javascript libraries like jQuery, jQuery-ui and TinyMCE. Doing this I
> > > > stumbled upon a problem I cannot seem to solve in a good way.
> > > > jQuery-ui and TinyMCE come bundled with themes, consisting of images
> > > > and css files. CakePHP doesn't seem to serve any other file than *.js
> > > > from the vendors/js folder inside my plugin though (as opposed to
> > > > everything in the /webroot/ folder), forcing me to create additional
> > > > folders for images and css in both the /img/ and /css/ folders. For
> > > > jquery-ui this is inconvenient, for TinyMCE it's a giant pain, and for
> > > > libraries like SwfUploader (or Uploadify in my case), this is simply
> > > > impossible because the swf-files don't get served from any of the
> > > > three (img, css, js) folders inside myplugin/webroot/.
>
> > > > So how do I bundle these libraries with my plugin without breaking
> > > > them? Is it even possible?
--~--~-~--~~~---~--~~
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: JS/CSS automatic concatenation and compression

2009-10-03 Thread schneimi

Hi,

I do this aside from CakePHP, not automatically but with one click in
eclipse.

This tutorial I wrote might be interesting for you:
http://schneimi.wordpress.com/2009/04/30/speed-up-your-website-with-one-click-in-eclipse/

Regards,
Michael


On 3 Okt., 11:29, Davit Barbakadze  wrote:
> I wonder whether there already written plugin or component which
> automatically concatenates all js and css files used (separately of
> course), compresses them and places them onto corresponng place in the
> layout?
>
> So that in the end, for example, no matter how many js files were
> included, in the header only one, compressed will be referenced,
> holding united info of all those included js files.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



XAMPP & CakePHP > Running in a sub-directory

2009-10-03 Thread IamJim

   Good day all, and this is my first post to the group and trying to
get Cake to be able to run from a Sub-directory (structure) instead
of /weboot in my XAMPP installation in order to keep this cleaner.

http://localhost/myCoreRoutines/cake/

  OR??  Maybe I just need to create a 'sub-domain'...in which I am
really unsure how to to to my "localhost" ?? (not sure if I am
explaining this correct, but I am NOT running my local box as a web
server using a FQDN

  I did do a 'search' first (prior to posting) ox 'xampp' and there
were 16 results and none of them were really addressing what I need to
accomplish

   I am sure it is just a pathing or setting I need to
change...similar to an IF/ELSE statement possibly, but I am usure how
to achieve this please.

  I have installed LOCAL as C:\xampp\htdocs\cake

LOCAL ENVIRONMENT
Win2kServer running XAMPP
PHP 5.2.9 (cli) (built: Feb 25 2009 15:52:24)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by
Zend Technologies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend
Technologies


I also (after local dev and testing) will be uploading to:

REMOTE ENVIRONMENT
CENTOS 5.3 i686 standard
PHP 5.2.8 (cli) (built: Jul  8 2009 14:31:09)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

  For now, I have uploaded my CAKEPHP to a subdomain (created using
cPanel) such as:

cake.theWebsite.com

  First of all, I am using this tutorial which is laid out VERY WELL
for someone new to understand and is step by step:

http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake1/index.html

  I am able to get up to page 3 of this where there is a form:

http://cake.theWebsite.com/users/register

  Everything works just fine !!

  But, on my LOCAL set up...which is a "sub-directory", and not a sub-
domain (aka WEBROOT) and I am able to get the FORM to load fine

And the LOCAL URL is:

http://localhost/myCoreRoutines/cake/users/register

 but what is happening after FORM SUBMISSION

Cake is PATHING this back into the "WEBROOT" of :

http://localhost/users/register

(Please note the removal of : myCoreRoutines/cake from the URL)

and is tossing (of course)

Object not found!
The requested URL was not found on this server.

  Any help would be greatly appreciated...and I would suspect a simple
solutionit is just I am noew to CAKE.

  I had no problem using this SubDir structure using /symfony at all.

  Thank you all in advance,

Jim

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



JS/CSS automatic concatenation and compression

2009-10-03 Thread Davit Barbakadze

I wonder whether there already written plugin or component which
automatically concatenates all js and css files used (separately of
course), compresses them and places them onto corresponng place in the
layout?

So that in the end, for example, no matter how many js files were
included, in the header only one, compressed will be referenced,
holding united info of all those included js files.

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



Install CakePHP in sub folder ? ? ? How can I ? ? ?

2009-10-03 Thread DatacenterHellas

Hello all.

I have install the CakePHP in a sub folder in my web hosting package

(in example http://www.mydomainname.ext/subfoldername/)

The Cake is running very cool but I have problem with CSS and propably
with other files (such as javascripts and images) tha I have not yet
try.

>From the source code inside the Firefox I see this code for the CSS



But my page is not styled

What Can I do for ? ? ?

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



Deploy a cakePHP work..

2009-10-03 Thread Hafsal M
Please help me,
am a newbie to cakephp... i dont know how a cakephp application should be
hosted, how is the deploying process is...

thank u in advance.

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



How to finish..

2009-10-03 Thread Hafsal M
am a newbie to cakephp... i dont know how a cakephp application should be
hosted, how is the deploying process is...

thank u in advance.

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



Wow Great content! worth the visit

2009-10-03 Thread Romesh Anuruddha Wanniarachchi
I found the below useful article and thought of sharing with my friends.  There
are many more articles related to the various subjects and worth to
visit

*Education is a human right.  All of us have the right to be educated at
least the primary education.  However nowadays education has become sort of
a business instead of serving the people as it used to be.  There are
countries where the education system is totally free and there are some
other countries where you need to have money to learn.  This articles
discusses how education can serve to accomplish education in a reasonable
manner*  click here to view the full
article 

Thanks and regards
Romesh

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



Caching dynamic url view

2009-10-03 Thread thinline


I am trying to implement full view caching for a specific method in a
controller.

First I realized that if you set $this->layout = false; then caching
will NOT happen. I have no idea why this occurs. I am not sure if this
is a bug as I had a hard time debugging out how the cache works.

Once, I turned that off I was able to get my view to cache by adding
var $cacheAction = "1 hour";

Since I don't want to cache everything in the view I need to cache
just specific methods. The URL that I would like to cache looks like
this:
/posts/badge/23/size:180x150
where 23 is the post ID and size is a named parameter (there are 2
variations of size).

So my question is what is the proper (if any) match to place in
cacheAction to cache all posts/badges/* Here are some examples that I
have tried:

var $cacheAction = array(
'badge/*' => '+1 hour',
'posts/badge/23/size:180x150' => '1 hour',
'badge/23/size:180x150' => '1 hour',
'posts/badge/:id/:size' => '1 hour',
'badge/:id/:size' => '1 hour',
);

None of these seem to match (or at least do not cache for some
reason). I do need to cache posts/badge/*/size:* and trap each of the
parameters being passed.

Again, if I set $cacheAction = "1 hour"; then the cache file is
created (the file tmp/cache/views/posts_badge_23_size_180x150.php is
created)

--~--~-~--~~~---~--~~
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: Javascript libraries with images/css inside Cake Plugins

2009-10-03 Thread Elte Hupkes

Exactly. I know the paths are righ, because the css files and js libs
do get loaded, and if I place them under the app's /webroot/ folder,
so do the images/other files they include. Just not when they're
inside a plugin's vendors folder (the same problem occurs with
javascript in the normal vendors folder by the way, but that has a
clear cause if you look at the vendors.php file in the webroot/js
folder).

So it pretty much comes down to this: when for instance I place a file
named "upload.swf" inside the /plugins/myplugin/vendors/js/ I would
like to be able to browse to it via url/myplugin/js/upload.swf, this
doesn't work though. And indeed it's not preferable to change the file
locations inside a 3rd party lib, but for swf-files the _only_
solution is moving it to the webroot folder, because it simply gets
ignored from anywhere inside the plugin's vendors folder.

Too bad you never found a good solution..

On Oct 2, 2:28 pm, womble  wrote:
> I'm pretty sure its not the 'prefacing' etc.  But I may be wrong.
>
> I basically had the same problem with ext-js.  I didn't ever find a
> good solution.  But there has to be somewhere to change the Cake
> settings.  My problem was that the library css was referencing
> relative urls of images, but the images were not accessible unless
> they were located under the plugin_name/img  folder.  And if I put the
> whole library under the plugin_name/js folder the css and images were
> not accessible.
>
> If it were all my own code it wouldn't be an issue, but as they're 3rd
> party libraries its preferable not to change paths in the css etc.
>
> On Oct 1, 2:03 am, brian  wrote:
>
> > How are you linking the css files? You should only need to preface the
> > file name with 'plugin_name/css/', eg.
> > $html->css('/plugin_name/css/css_filename');
>
> > On Tue, Sep 29, 2009 at 6:32 PM, Elte Hupkes  wrote:
>
> > > I'm trying to develop a small backend cms-plugin, which contains some
> > > Javascript libraries like jQuery, jQuery-ui and TinyMCE. Doing this I
> > > stumbled upon a problem I cannot seem to solve in a good way.
> > > jQuery-ui and TinyMCE come bundled with themes, consisting of images
> > > and css files. CakePHP doesn't seem to serve any other file than *.js
> > > from the vendors/js folder inside my plugin though (as opposed to
> > > everything in the /webroot/ folder), forcing me to create additional
> > > folders for images and css in both the /img/ and /css/ folders. For
> > > jquery-ui this is inconvenient, for TinyMCE it's a giant pain, and for
> > > libraries like SwfUploader (or Uploadify in my case), this is simply
> > > impossible because the swf-files don't get served from any of the
> > > three (img, css, js) folders inside myplugin/webroot/.
>
> > > So how do I bundle these libraries with my plugin without breaking
> > > them? Is it even possible?
--~--~-~--~~~---~--~~
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: Password field is automatically hashed, how to change this?

2009-10-03 Thread j0n4s.h4rtm...@googlemail.com

I am not sure, but I remember something around here solved that:
http://teknoid.wordpress.com/2008/10/08/demystifying-auth-features-in-cakephp-12/
http://book.cakephp.org/de/view/384/hashPasswords

On Oct 1, 7:56 am, Mukhamad Ikhsan  wrote:
> I have a password field that when submiting, the value is already hashed.
> before, I'm not really concider with this problem, but now i realize because
> of that, the validation for 'notEmpty' is break. Even i enter the empty,
> Cake automated hashed the empty value so i never get validation error for
> notEmpty in password field. There is some configuration for this?
>
> --
> Mukhamad Ikhsanhttp://www.diodachi.com
--~--~-~--~~~---~--~~
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: Access Classes In Layout Help??

2009-10-03 Thread Miles J

Do it in the beforeFilter() of your AppController, that will apply it
to all views and layouts.

On Oct 3, 1:18 am, hahmadi82  wrote:
> Now I see!  So the set variables change depending on which view is showing
> within the default.ctp.  If I add this car action to the app_controller
> (instead of car model) and set the variables there, will all the views have
> access to that variable? How can I make a global "set" variable that comes
> from a specific query?
>
>
>
> brian-263 wrote:
>
> > On Fri, Oct 2, 2009 at 10:55 PM, hahmadi82  wrote:
>
> >> Ok so I actually didn't create a layout for each view from my
> >> controllers.
> >> Instead, all the views use the same layout, which is the default.ctp. Is
> >> that incorrect? From my understanding, the default layout is loaded by
> >> every
> >> view and that's why I have my navigation bar in it.  It seems that I can
> >> only access those "set" variables from something like
> >> views/layouts/cars/index.ctp but not views/layouts/default.ctp. Is there
> >> a
> >> difference between the model layouts and the default layout?
>
> > You *almost* have it. Once again:
>
> > When a controller's action is run, its render() method is called
> > automatically (yes, you can call it yourself but please ignore that
> > for now). When that happens, Cake will use the View class to render
> > the view template for that action. These templates are in
> > app/views/controller_name_ending_in_s/action_name.ctp
>
> > Usually, the view template contains some HTML that you have included,
> > along with some variables. Those variables are passed to the View
> > class through the controller's $viewVars class variable. When you call
> > $this->set('foo', 'bar'), you are passing the value, 'bar' to the
> > controller's $viewVars array with a key, 'foo'.
>
> > When the controller's $viewVars is handed off to the View class, it
> > extracts them, essentially creating a var named $foo that contains the
> > value 'bar'.
>
> > Now, after the View has finished using the view template to render
> > something to output it creates a variable called, $content_for_layout.
>
> > It then renders the layout template. That's a file in
> > app/views/layout/name_of_your_layout.ctp. If you don't specify a
> > layout, Cake uses 'default'.
>
> > Inside the layout template is (should be) a variable named ...
> > $content_for_layout. This is where the contents of your rendered view
> > are written to the layout.
>
> > So, try this: In one of your controller actions, add $this->set('foo',
> > 'bar');
>
> > In your app/views/layouts/default.ctp add this, just above
> > $content_for_layout
>
> > echo $foo;
>
> > You should see 'bar' in there, somewhere. View source and search for
> > it, because your CSS may hide it.
>
> > Anyway, perhaps you should post the relevant part of your layout file
> > and the controller action.
>
> --
> View this message in 
> context:http://www.nabble.com/Access-Classes-In-Layout-Help---tp25706283p2572...
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~-~--~~~---~--~~
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: Access Classes In Layout Help??

2009-10-03 Thread hahmadi82


Now I see!  So the set variables change depending on which view is showing
within the default.ctp.  If I add this car action to the app_controller
(instead of car model) and set the variables there, will all the views have
access to that variable? How can I make a global "set" variable that comes
from a specific query?

 

brian-263 wrote:
> 
> 
> On Fri, Oct 2, 2009 at 10:55 PM, hahmadi82  wrote:
>>
>>
>> Ok so I actually didn't create a layout for each view from my
>> controllers.
>> Instead, all the views use the same layout, which is the default.ctp. Is
>> that incorrect? From my understanding, the default layout is loaded by
>> every
>> view and that's why I have my navigation bar in it.  It seems that I can
>> only access those "set" variables from something like
>> views/layouts/cars/index.ctp but not views/layouts/default.ctp. Is there
>> a
>> difference between the model layouts and the default layout?
> 
> You *almost* have it. Once again:
> 
> When a controller's action is run, its render() method is called
> automatically (yes, you can call it yourself but please ignore that
> for now). When that happens, Cake will use the View class to render
> the view template for that action. These templates are in
> app/views/controller_name_ending_in_s/action_name.ctp
> 
> Usually, the view template contains some HTML that you have included,
> along with some variables. Those variables are passed to the View
> class through the controller's $viewVars class variable. When you call
> $this->set('foo', 'bar'), you are passing the value, 'bar' to the
> controller's $viewVars array with a key, 'foo'.
> 
> When the controller's $viewVars is handed off to the View class, it
> extracts them, essentially creating a var named $foo that contains the
> value 'bar'.
> 
> Now, after the View has finished using the view template to render
> something to output it creates a variable called, $content_for_layout.
> 
> It then renders the layout template. That's a file in
> app/views/layout/name_of_your_layout.ctp. If you don't specify a
> layout, Cake uses 'default'.
> 
> Inside the layout template is (should be) a variable named ...
> $content_for_layout. This is where the contents of your rendered view
> are written to the layout.
> 
> So, try this: In one of your controller actions, add $this->set('foo',
> 'bar');
> 
> In your app/views/layouts/default.ctp add this, just above
> $content_for_layout
> 
> echo $foo;
> 
> You should see 'bar' in there, somewhere. View source and search for
> it, because your CSS may hide it.
> 
> Anyway, perhaps you should post the relevant part of your layout file
> and the controller action.
> 
> > 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Access-Classes-In-Layout-Help---tp25706283p25726631.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
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: AD7six's MiMedia plugin

2009-10-03 Thread Clare

Hi AD7six,

I'll try both of them out, many thanks for the info!


Claire

--~--~-~--~~~---~--~~
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: Auth component loop redirect

2009-10-03 Thread Bert Van den Brande
Hmm tricky stuff indeed, must remember this one !

On Fri, Oct 2, 2009 at 3:39 PM, brian  wrote:

>
> On Fri, Oct 2, 2009 at 9:36 AM, mathaios  wrote:
> >
> > Brian you nailed it...I was having a small navigation element in the
> > layout
> >
> > thank you!
> >
>
> Yeah, that one was driving me nuts once. I was so happy to find that post!
>
> >
>

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



Re: Help with Multiple Models + Single View required

2009-10-03 Thread Bert Van den Brande
Then I would loop over the incoming data inside your controller method,
create Jobs models out of them and pass the array of new Jobs models to
saveAll() .

Never have done this before but this is what I would try :)

On Sat, Oct 3, 2009 at 7:57 AM, ashok.b  wrote:

>
> I have a view (Linked to Messages Model, Table 1), which:
> 1. Displays a Message (From Table1)
> 2. Select a single/multiple Account/es (List generated from Table2)
> 3. Select a single/multiple Batch/es (List generated from Table3)
> 4. Take input date & time
>
> My problem is, upon clicking submit, the data should go into another
> model, Jobs (Table4) with multiple entries just like how it happens in
> an hasAndBelongsToMany relation...
>
> On Oct 2, 4:21 pm, Bert Van den Brande  wrote:
> > My idea is ... that's a lot of text !
> >
> > Ok j/k, what exactly are you asking for ?
> >
> > On Thu, Oct 1, 2009 at 9:28 PM, ashok.b  wrote:
> >
> > > Hi everyone, I'm new to this group and to cakephp. I'm enjoying
> > > writing code with cakephp, and most of times I'm getting help from the
> > > bakery, community and googling. But am at a roadblock now, and seems
> > > like I can't find what I am looking for. My problem is as follows:
> >
> > > Table1: tbl_messages
> > > id - integer - Auto Increment Primary Key
> > > msg - varchar - A text message
> >
> > > Table2: tbl_accounts
> > > id - integer - Auto Increment Primary Key
> > > username - varchar - User Name of the Account
> > > userpass - varchar - Password for the Account
> >
> > > Table3: tbl_batches
> > > id - integer - Auto Increment Primary Key
> > > bname - varchar - Name of the Batch
> > > bdesc - varchar - Description of the Batch
> >
> > > Table4: tbl_jobs
> > > id - integer - Auto Increment Primary Key
> > > tbl_messages_id - integer - Foreign key referring to tbl_messages
> > > tbl_accounts_id - integer - Foreign key referring to tbl_accounts
> > > tbl_batches_id - integer - Foreign key referring to tbl_jobs
> > > schedtime - datetime - Date Time when to send the message
> >
> > > The table4 contains details of jobs which will be executed using cron
> > > job. My problem now is to create a single view, which will:
> >
> > > 1. Display a Message
> > > 2. Select a single/multiple Account/es
> > > 3. Select a single/multiple Batch/es
> > > 4. Take input date & time
> >
> > > On clicking submit,
> > > Multiple entries to be inserted in tbl_jobs, depending on number of
> > > items selected in Accounts & Batches (i.e. if 2 accounts, 2 batches
> > > are selected, 4 entries to be made into tbl_jobs with values
> > > (x,msgid,accid1,batchid1,datetime)
> > > (x,msgid,accid1,batchid1,datetime)
> > > (x,msgid,accid2,batchid2,datetime)
> > > (x,msgid,accid2,batchid2,datetime)
> >
> > > The view is achieved using the Messages Model. But from there, data
> > > from the form should be sent to Job Model which should insert in above
> > > format.
> >
> > > Any ideas please... Thanks for patiently reading the lng post.
> >
> >
> >
>

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