Re: Using Email component in another component

2009-03-06 Thread Dr. Loboto

Add init method in your component:
public function initialize(&$controller) {
$this->controller =& $controller;
}

Use set() everywhere you need:
$this->controller->set()

On Mar 7, 9:24 am, Miles J  wrote:
> So I recently build a Mailer Component that would deal with all the
> emails. But then I ran into the issue, which I forgot about, is that
> set() only works in the controller. So now since im doing it in a
> component, I cant pass any variables to the email.
>
> Is there a work around to this, to not have to do it within a
> controller?
--~--~-~--~~~---~--~~
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: Recursive Count ?

2009-03-06 Thread mscdex

On Mar 7, 2:13 am, weckmann  wrote:
> Unfortunately it stops joining tables after ModelB... so ModelB gets
> correctly joined, but ModelC is ignored, even if I set the 'recursive'
> parameter to 3... as far as I understood the whole thing, this should
> find the link in ModelB to ModelC... but it does not.

Post your models.
--~--~-~--~~~---~--~~
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: Recursive Count ?

2009-03-06 Thread weckmann

I am already working a lot with linking models together, but not in
that recursive way, mostly only with one belongsTo relation.


But your hint "specifing the count in the 'fields' array" was a good
step in the right direction, I finally got the correct SELECT
statement created by cake ;-)


The other thing is the JOINS... they do not work correctly yet...

Now here is what I was doing fist:

Since I am calling the ModelA, I thought it would be enough to define
the following model linkings:

On ModelA: belongsTo ModelB
On ModelB: belongsTo ModelC
On ModelC: belongsTo ModelD

Thats it.

Unfortunately it stops joining tables after ModelB... so ModelB gets
correctly joined, but ModelC is ignored, even if I set the 'recursive'
parameter to 3... as far as I understood the whole thing, this should
find the link in ModelB to ModelC... but it does not.

Do I have to use the backwards links with hasMany from ModelD to
ModelC, ModelC to ModelB, ModelB to ModelA to get this working? Or do
I have to set up some kind of link in ModelA directly to ModelC and
ModelD?

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



ACL Scenario

2009-03-06 Thread Dave

Wondering if I could get some general feed back on what would be the
best way to set up ACL with a situation like this.
Education site basically.

A User signs up and during registration they select they teaching
professional level ( Pre-School thru Grade 12 each with a value in the
database 1-13 or such)

In the site the User can add a article(Post or whatever) but the only
people who can see the messages/articles would be the people in the
same professional level. So a grade 3 teacher can only see content
added by other grade 3 teachers and so on like that.

Now I was wondering how would I set something like that up? Would I
just set all the teachers up in 1 group then in the controller, based
on the professional level set up the restrictions and filtering of the
content? So when the teacher logs in use their level to run a query to
pull the data related to them?

Ideas, thoughts, suggestions?

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: Routes - got it figured

2009-03-06 Thread Dave Maharaj :: WidePixels.com
I figured it right afterwards
 
thanks 
 
Dave

  _  

From: Dave Maharaj :: WidePixels.com [mailto:d...@widepixels.com] 
Sent: March-07-09 1:26 AM
To: cake-php@googlegroups.com
Subject: Routes


Can someone provide a simple way to configure routes? Been trying this to no
avail.
 
What I want is to remove the view/1 from the URL so it looks like
www.site/posts/1 and not www.site/posts/view/1
 
Router::connect('/posts/*', array('controller' => 'posts', 'action' =>
'view', 'view'));
 
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
-~--~~~~--~~--~--~---



Routes

2009-03-06 Thread Dave Maharaj :: WidePixels.com
Can someone provide a simple way to configure routes? Been trying this to no
avail.
 
What I want is to remove the view/1 from the URL so it looks like
www.site/posts/1 and not www.site/posts/view/1
 
Router::connect('/posts/*', array('controller' => 'posts', 'action' =>
'view', 'view'));
 
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: Recursive Count ?

2009-03-06 Thread mscdex

On Mar 6, 5:13 pm, weckmann  wrote:
> How would I need to link the models together and how do I need to form
> the count?

I would suggest taking a look here about associating models:
http://book.cakephp.org/view/78/Associations-Linking-Models-Together
The count can be specified in the 'fields' array of a $this->Model-
>find call. However, you may run into the issue where the calculated
value is stored in results as the 0th index of the model you're
counting on (no pun intended).

> I've tried a lot of things in quiet a lot of hours and googled around
> for days but was not able to find a working solution. So this is my
> last hope.. *crossing fingers*

Post here what you've tried. Have you already read through the Cake
manual (http://book.cakephp.org) thoroughly?
--~--~-~--~~~---~--~~
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: More than one level chained hasmany association

2009-03-06 Thread mscdex

On Mar 6, 12:57 pm, "miguelarc...@gmail.com" 
wrote:
> I have the following Model/table associations:
>
> Feedback hasmany Competency
> Competency hasmany Questions
>
> Is saveAll the way to go? and if so, how do I do it?

saveAll currently does not support saving of deep relationships like
this. So far it only supports the one (the first) level.

There is currently a ticket on this issue (https://trac.cakephp.org/
ticket/5937).
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Using Email component in another component

2009-03-06 Thread Miles J

So I recently build a Mailer Component that would deal with all the
emails. But then I ran into the issue, which I forgot about, is that
set() only works in the controller. So now since im doing it in a
component, I cant pass any variables to the email.

Is there a work around to this, to not have to do it within a
controller?
--~--~-~--~~~---~--~~
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: Accordion

2009-03-06 Thread Dave Maharaj :: WidePixels.com

 Still no luck. I need the scriptaculous.js in there for other elements on
the page.

In the view file:
link(array('prototype', 'scriptaculous', 'effects',
'accordion'));
?>






  
  
  Title Bar

  Well i listened to all you guys out there in my forum and my blog
and now all those wishes have been granted!
  

  Open/Close functionality added (Click on an active
accordion).
  Nested Vertical Accordions
  Accordions will dynamically resize on content added REAL
TIME!
  ...lots of bug fixes!

  


Title Bar
   
  Well i listened to all you guys out there in my forum and my blog
and now all those wishes have been granted!
  

  Open/Close functionality added (Click on an active
accordion).
  Nested Vertical Accordions
  Accordions will dynamically resize on content added REAL
TIME!
  ...lots of bug fixes!

  


Title Bar
   
  
  Well i listened to all you guys out there in my forum and my blog
and now all those wishes have been granted!
  

  Open/Close functionality added (Click on an active
accordion).
  Nested Vertical Accordions
  Accordions will dynamically resize on content added REAL
TIME!
  ...lots of bug fixes!

  

  





Event.observe(window, 'load',
loadAccordions, false);

function loadAccordions() {

var bottomAccordion = new
accordion('vertical_container');
}





-Original Message-
From: Stu [mailto:greenmushroo...@gmail.com] 
Sent: March-06-09 4:58 PM
To: CakePHP
Subject: Re: Accordion


Not sure if you need the scriptaculous script for anything else, but you
don't need it for this.  Also you're missing effects.js which is specified
on the website.

You might wanna take out some of that code too, you don't need all of that,
for instance:

> var topAccordion = new 
> accordion('horizontal_container', {
> classNames : {
> toggle :
> 'horizontal_accordion_toggle',
> toggleActive :
> 'horizontal_accordion_toggle_active',
> content :
> 'horizontal_accordion_content'
> },
> defaultSize : {
> width : 525
> },
> direction : 'horizontal'
> });


> var nestedVerticalAccordion = new 
> accordion('vertical_nested_container', {
>   classNames : {
> toggle :
> 'vertical_accordion_toggle',
> toggleActive :
> 'vertical_accordion_toggle_active',
> content :
> 'vertical_accordion_content'
> }
> });



> // Open second one
> 
> topAccordion.activate($$('#horizontal_container
> .horizontal_accordion_toggle')[2]);
> }


All of that is if you wanted to use the nested accordion or the horizontal
accordions.

try that and post whatever happens next.


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



Re: Newbie to MVC and CakePHP question on CRUD / Associations

2009-03-06 Thread Xoubaman

Whit the console, specifically with the bake shell, you can set up the
database configuration, generate the models automatically from the
tables, the controllers with crud actions and the views for this
actions.

Look at http://book.cakephp.org/view/108/the-cakephp-console,
http://book.cakephp.org/view/113/Code-Generation-with-Bake
and http://www.archive.org/details/SettingUpTheCakephpConsoleOnWindows
if you are in windows.


On Mar 7, 12:11 am, A Summer  wrote:
> Thank you for your response.
>
> Do you mean use the cake bake scaffold thingy to generate a scaffold?
>
> On Fri, Mar 6, 2009 at 11:17 AM, Xoubaman  wrote:
> > Use the console to generate basic crud actions for your models. You
> > can generate the models also. The code will be simple enough to get a
> > idea about how cake works.
>
> > On Mar 6, 4:53 pm, a_summer  wrote:
> > > Good Day,
>
> > > Thank you for taking the time to read this discussion.
>
> > > I am new to MVC design, and I need to understand how to create a view/
> > > controller that will insert records into a model that uses the hasMany
> > > association.
>
> > > The table layout and code for the models is below:
>
> > > MySQL DB Create Table
> > > [solutions]
>
> > > CREATE TABLE `solutions`
> > > (
> > >              `id` int(11) NOT NULL
> > > auto_increment,
> > >              `title` varchar(255) default
> > > NULL,
> > >              `teaser`
> > > text,
> > >              `user_id` int(11) default
> > > NULL,
> > >              `status_id` int(11) default
> > > NULL,
> > >              `created` datetime default
> > > NULL,
> > >              `modified` datetime default
> > > NULL,
> > >              PRIMARY KEY
> > > (`id`)
> > >            ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
> > > CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC
>
> > > [sections]
>
> > > CREATE TABLE `sections` (
> > >             `id` int(11) NOT NULL auto_increment,
> > >             `title` text,
> > >             `content` text,
> > >             `solution_id` int(11) default NULL,
> > >             `created` datetime default NULL,
> > >             `modified` datetime default NULL,
> > >             PRIMARY KEY  (`id`)
> > >           ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
>
> > > Models
>
> > > 
> > > # /apps/models/solution.php
>
> > > class Solution extends AppModel
> > > {
> > >   var $name = 'Solution';
>
> > >   #Validations
> > >   var $validate = array (
> > >                           'title'   =>    array (
> > >                                                   'rule'  =>
> > > 'notEmpty'
> > >                                                 ),
> > >                           'user_id' =>    array (
> > >                                                   'rule'  =>
> > > 'notEmpty'
> > >                                                 ),
> > >                           'teaser'    =>  array (
> > >                                                   'rule'  =>
> > > 'notEmpty'
> > >                                                 ),
> > >                           'status_id' => array  (
> > >                                                   'rule'  =>
> > > 'notEmpty'
> > >                                                 )
> > >                         );
> > >   #Associations
> > >   var $hasMany  = array (
> > >                           'Section' =>  array (
> > >                                                 'className'   =>
> > > 'Section',
> > >                                                 'foreignKey'  =>
> > > 'solution_id',
> > >                                                 'order'       =>
> > > 'Section.created ASC',
> > >                                                 'dependent'   =>  true
> > >                                               )
> > >                         );
>
> > > }
>
> > > ?>
>
> > > ++
>
> > > 
> > > # /apps/models/section.php
>
> > > class Section extends AppModel
> > > {
> > >   var $name = 'Section';
>
> > >   #Validations
> > >   var $validate = array (
> > >                           'title'       =>    array (
> > >                                                       'rule'  =>
> > > 'notEmpty'
> > >                                                     ),
> > >                           'content'     =>    array (
> > >                                                       'rule'  =>
> > > 'notEmpty'
> > >                                                     ),
> > >                           'solution_id' =>    array (
> > >                                                       'rule'  =>
> > > 'notEmpty'
> > >                                                     )
> > >                         );
> > >   #Associations
> > >   var $belongsTo  = array (
> > >                             'Solution' =>  array (
> > >                                                     'className'   =>
> > > 'Solution',
> > >                                                     'foreignKey'  =>
> > > 'solution_id'
> > >       

Re: multiple file include...

2009-03-06 Thread Xoubaman

Edit the default layout at app\views\layouts\default.ctp and add a
element (at app\views\elements) placing it where you want. You can
access de data from the db using the element's requestAction method.

Read http://book.cakephp.org/view/94/Views

On Mar 6, 9:35 pm, ashutosh  wrote:
> hi all,
> I was trying cakePHP to make my site. this side has left side bar
> which picks the catalog data from db and the middle content depending
> upon the some other parameter. Left side bar will always be same
> format and will be picked up from db. any idea how should i do that? i
> am new to cakePHP. I want to create that Left side bar as other file
> and include in main and middle part in other file and include in main
> file any suggestion??
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Newbie to MVC and CakePHP question on CRUD / Associations

2009-03-06 Thread A Summer
Thank you for your response.

Do you mean use the cake bake scaffold thingy to generate a scaffold?

On Fri, Mar 6, 2009 at 11:17 AM, Xoubaman  wrote:

> Use the console to generate basic crud actions for your models. You
> can generate the models also. The code will be simple enough to get a
> idea about how cake works.
>
> On Mar 6, 4:53 pm, a_summer  wrote:
> > Good Day,
> >
> > Thank you for taking the time to read this discussion.
> >
> > I am new to MVC design, and I need to understand how to create a view/
> > controller that will insert records into a model that uses the hasMany
> > association.
> >
> > The table layout and code for the models is below:
> >
> > MySQL DB Create Table
> > [solutions]
> >
> > CREATE TABLE `solutions`
> > (
> >  `id` int(11) NOT NULL
> > auto_increment,
> >  `title` varchar(255) default
> > NULL,
> >  `teaser`
> > text,
> >  `user_id` int(11) default
> > NULL,
> >  `status_id` int(11) default
> > NULL,
> >  `created` datetime default
> > NULL,
> >  `modified` datetime default
> > NULL,
> >  PRIMARY KEY
> > (`id`)
> >) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
> > CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC
> >
> > [sections]
> >
> > CREATE TABLE `sections` (
> > `id` int(11) NOT NULL auto_increment,
> > `title` text,
> > `content` text,
> > `solution_id` int(11) default NULL,
> > `created` datetime default NULL,
> > `modified` datetime default NULL,
> > PRIMARY KEY  (`id`)
> >   ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
> >
> > Models
> >
> >  >
> > # /apps/models/solution.php
> >
> > class Solution extends AppModel
> > {
> >   var $name = 'Solution';
> >
> >   #Validations
> >   var $validate = array (
> >   'title'   =>array (
> >   'rule'  =>
> > 'notEmpty'
> > ),
> >   'user_id' =>array (
> >   'rule'  =>
> > 'notEmpty'
> > ),
> >   'teaser'=>  array (
> >   'rule'  =>
> > 'notEmpty'
> > ),
> >   'status_id' => array  (
> >   'rule'  =>
> > 'notEmpty'
> > )
> > );
> >   #Associations
> >   var $hasMany  = array (
> >   'Section' =>  array (
> > 'className'   =>
> > 'Section',
> > 'foreignKey'  =>
> > 'solution_id',
> > 'order'   =>
> > 'Section.created ASC',
> > 'dependent'   =>  true
> >   )
> > );
> >
> > }
> >
> > ?>
> >
> > ++
> >
> >  >
> > # /apps/models/section.php
> >
> > class Section extends AppModel
> > {
> >   var $name = 'Section';
> >
> >   #Validations
> >   var $validate = array (
> >   'title'   =>array (
> >   'rule'  =>
> > 'notEmpty'
> > ),
> >   'content' =>array (
> >   'rule'  =>
> > 'notEmpty'
> > ),
> >   'solution_id' =>array (
> >   'rule'  =>
> > 'notEmpty'
> > )
> > );
> >   #Associations
> >   var $belongsTo  = array (
> > 'Solution' =>  array (
> > 'className'   =>
> > 'Solution',
> > 'foreignKey'  =>
> > 'solution_id'
> >   )
> >   );
> >
> > }
> >
> > ?>
> >
> > Now, in my old and flawed method of coding, I would include a form
> > with a hidden field that includes the solution_id.
> >
> > Since I am trying to understand MVC, I know I will need a view to
> > manage the input form for inserting a new section. But I am stuck on
> > the controller ... how do I ensure that the controller includes the
> > correct solution_id?
> >
> > Thanks in advance for any assistance you can provide!
> >
> > A Summer
> >
>

--~--~-~--~~~---~--~~
You received this message because you are s

Re: Cake performance tips

2009-03-06 Thread Miles J

Well I use this technique, it only loads models that we need for that
current action. Cuts down the models tremendously.

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



Model for a Task belonging to either a Project or a SubProject

2009-03-06 Thread Toutankharton

Hi !
I builted my application originally to deal with Tasks belonging to
one subproject, which itself was belonging to one project. A project
could have one or more subprojects, which could have one or more
tasks.

Unfortunately, I have to change that to be able to pass the subproject
step. I need to be able to add a task to a project. How can I set up
my Projet, SubProject and Task Models in order to do that ?

I need to be able to do something like that :

Project 1
--Task A
-- Task B
--SubProject 1
 Task C
Project 2
-- SubProject 2
-- SubProject 3
 Task D
 Task E

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



Re: Line feed at the befining of my pages source ?!? Where does it come from? Is beaks my XML :(

2009-03-06 Thread Aktarus

Thanks to IRC channel guys I solved the pbm:  Remove all the php
closing tags  ?>  from your code and it solved the pbm.

Thanks to the CakePHP community!

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



Recursive Count ?

2009-03-06 Thread weckmann

Hi together,

I have problems to create a count query with recursive conditions...
To clear up things, I ll try to make an example:


We have 4 tables:

ModelA, ModelB, ModelC, ModelD

They are connected like this:

- ModelA contains a FK to ModelB.
- ModelB contains a FK to ModelC.
- ModelC contains a FK to ModelD.

And I want to make a distinct count of the PK of ModelB, combined with
some conditions spreaded over the tables.

This would look like the following SQL:

SELECT COUNT (DISTINCT ModelA.modelb_id) FROM ModelA
   INNER JOIN ModelB ON ModelB.id = ModelA.modelb_id
   INNER JOIN ModelC ON ModelC.id = ModelB.modelc_id
   INNER JOIN ModelD ON ModelD.id = ModelC.modeld_id
WHERE ModelD.something = 'somevalue'
   AND ModelA.someother = 'thatvalue'
   AND ModelB.somethird = 'thosevalues';



So, how can I translate that into Cake syntax? ;-)

How would I need to link the models together and how do I need to form
the count?


I've tried a lot of things in quiet a lot of hours and googled around
for days but was not able to find a working solution. So this is my
last hope.. *crossing fingers*

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: Line feed at the befining of my pages source ?!? Where does it come from? Is beaks my XML :(

2009-03-06 Thread Pablo Viojo
removing all closing ?> on your models, controllers, components and helpers
may help (they are not needed)
Saludos,

Pablo Viojo
pvi...@gmail.com
http://pviojo.net
(#220 y creciendo!)


Ayudar nos hace felices!
http://needish.com  - http://helperman.org



On Fri, Mar 6, 2009 at 7:02 PM, Aktarus  wrote:

>
> Looking in forums I have found this:-
>
>
> http://bytes.com/topic/xml/answers/685843-xml-version-1-0-encoding-utf-8-creting-problem-mozilla-firefox
>
> Although **I** don't introduce the line feed they are talking about, I
> presume it is inserted by CakePHP in the code, I cannot find where
> with my debugger ... Can anyone help?
>
> Thanks.
>
> >
>

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



Re: Line feed at the befining of my pages source ?!? Where does it come from? Is beaks my XML :(

2009-03-06 Thread Aktarus

Looking in forums I have found this:-

http://bytes.com/topic/xml/answers/685843-xml-version-1-0-encoding-utf-8-creting-problem-mozilla-firefox

Although **I** don't introduce the line feed they are talking about, I
presume it is inserted by CakePHP in the code, I cannot find where
with my debugger ... Can anyone help?

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



l10n not working on production server

2009-03-06 Thread bberg

hi,

i've set up the l10n class with success on my local server.

i can make __('string') read the app/locale/eng/LC_MESSAGES/default.po
file based on $_SESSION['Config']['language']
but it is not working on the production server.

i've read somewhere that there is a problem with 64bit servers. tried
their patches but it did not work either.

any ideas?
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
-~--~~~~--~~--~--~---



Please help with installation

2009-03-06 Thread jlyon

Hi I have no idea how best to install cakephp and have it work at
correctly
This is my setup (on dreamhost)

\
\www.mydomain01.com
\www.mydomain02.com
\www.mydomain03.com
\cake_install\app
\cake_install\cake
\cake_install\vendors
\cake_install\.htaccess
\cake_install\index.php
\cake_install\README

What do I need to do to create an app on www.domain02.com

thanks

jonathan


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



multiple file include...

2009-03-06 Thread ashutosh

hi all,
I was trying cakePHP to make my site. this side has left side bar
which picks the catalog data from db and the middle content depending
upon the some other parameter. Left side bar will always be same
format and will be picked up from db. any idea how should i do that? i
am new to cakePHP. I want to create that Left side bar as other file
and include in main and middle part in other file and include in main
file any suggestion??

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



Re: Cake performance tips

2009-03-06 Thread jcorrea

Profiling my applications give me some good insights about where our
application is having bottlenecks.
The slow methods within cake core are:
1. Loading models takes a lot of the time (85% of the total time),
specifically at Model::__createLink
2. FormHelper::select with large lists

Is there any way to limit the model loading? maybe caching the object
the first time they are loaded?
Or do i have to re-engenieer my relations (cake's model relations) to
fit the performance requirement?
We could use bindModel all over the application but that's not the
idea.

On Mar 6, 9:07 am, Miles J  wrote:
> 1000 rows is nothing, try 100,000 rows, then that would possibly
> stress test the database and models.
--~--~-~--~~~---~--~~
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: L18n Showing and editing all available languages at the same time

2009-03-06 Thread Aurelius

Sry, I didn't quite get it...

I want to load the content in all languages of the Model I'm in, no an
associated one!

I need a function which load all/the choosen languages of the record
I'm editing
e.g. localhost/blogs/edit/2
the printed find-method should something like this:
Array
(
[0] => Array
(
[Blog] => Array
(
[id] => 2
[locale] => en
[name] => English blogtitle
)

)

[1] => Array
(
[Blog] => Array
(
[id] => 2
[locale] => de
[name] => German blogtitle
)
)

)

How can I achieve that?

thx
Aurelius

On 4 Mrz., 19:18, "jitka (poLK)"  wrote:
> Yes, you can use TranslateBehavior, if you don't mind that callbacks
> are not fired on associated models. It means - any behavior's
> callbacks can work correctly only on primary model, so it does not
> translate virtual fields for associated models.
>
> Possible workaround for this issue is 
> here:http://groups.google.com/group/cake-php/browse_thread/thread/9b7e6090...
>
> As of displaying or editing multiple translations at once, yes it is
> possible - by default it picks up locale from your Config.language
> setting, but you can set YourModel->locale to array of locales and
> then ;) you know, read test case of TranslateBehavior.
--~--~-~--~~~---~--~~
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 and soundmanager2 HELP!!

2009-03-06 Thread farfignugin

I have soundmanager2 serving up mp3s on a music library site, but
every so often soundmanager in safari will not link up when an mp3 is
clicked. When I reset safari it will work fine again, but clearing the
cache does not help.

If you are running safari and have a few minutes to spare please visit
http://ddub.com/library and see if the links will play and shoot me an
email with the results.

drewpearsonmu...@gmail.com

Thanks everyone




--~--~-~--~~~---~--~~
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: Labels around inputs

2009-03-06 Thread Brendon Kozlowski

> The input type is multiple checkboxes. I think that’s where the problem is
> coming from.

If that's true, try it without that option and see if it renders
properly.  If it is true, there may be a solution that good ol' Google
could help us find.  I haven't yet had a reason to use the multiple
option.  I don't see why the multiple should override the div and
label options' array parameters.
--~--~-~--~~~---~--~~
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: Converting SQL query to Cake query

2009-03-06 Thread RyOnLife


Apologies for continuing to pound away at this thread, but I had another
issue come up. In addition to views, pages also have votes. When I tried to
count the votes and views, both counts are the same and are "wrong"—due to
the way the tables are being joined, the count doesn't work as desired.

My model association and find() query are pasted below. Any help on how to
do individual counts is welcomed.

So the Page model contains:

  var $hasOne = array( 
'PageViewTotal' => array(
  'className' => 'PageView',
  'type' => 'inner'
),   
'PageVoteTotal' => array( 
  'className' => 'PageVote', 
  'type' => 'inner' 
)
  );

And the Cake query is:

  $results = $this->Page->find('all', array( 
'fields' => array(
  'Page.*',
  'COUNT(PageViewTotal.id) AS views',
  'COUNT(PageVoteTotal.id) AS votes'
), 
'group' => 'VideoList.id', 
'order' => 'views DESC', 
'limit' => 10,
  ));


RyOnLife wrote:
> 
> I was overthinking the bind. Instead of bindModel() in the controller,
> just needed the following association in the Page model:
> 
>   var $hasOne = array( 
> 'PageViewTotal' => array( 
>   'className' => 'PageView', 
>   'type' => 'inner' 
> )
>   );
> 
> Between that and the afterFind() callback, seems to do the trick and be a
> fairly pure solution. Still seems like if the models were set up
> correctly, I could get page_view_count in the Page dimension of the array
> without having to manipulate it there using afterFind().
> 
> As I am trying to learn, any comments as to the effectiveness of this
> solution and/or ways to improve would be much appreciated. 
> 
> 
> 
> RyOnLife wrote:
>> 
>> Here's the afterFind(). It works. Would just like some comments on
>> whether this is a sound approach.
>> 
>>   function afterFind($results) {
>> if(!empty($results[0]['Page']) &&
>> !empty($results[0][0]['total_view_count'])) {
>>   $i = 0;
>>   foreach($results as $result) {
>> $results[$i]['Page']['total_view_count'] =
>> $result[0]['total_view_count'];
>> unset($results[$i][0]);
>> $i++;
>>   }
>> }
>> return $results;
>>   }
>> 
>> I'm much more unsure about the latter question of whether there is a
>> place in the Page model to do the bind. And now I'm wondering if it would
>> be possible and make sense to create a total_view_count.php file in the
>> models folder.
>> 
>> 
>> 
>> RyOnLife wrote:
>>> 
>>> @grigri: Thanks. Just what I was looking for. I hadn't used bindModel()
>>> before, but now makes total sense on getting from the SQL to Cake query.
>>> 
>>> This does lead me to two follow up questions...
>>> 
>>> The $results array looks like this:
>>> 
>>> Array
>>> (
>>> [0] => Array
>>> (
>>> [Page] => Array
>>> (
>>> [id] => 1
>>> [user_id] => 1
>>> [title] => test
>>> [slug] => test
>>> [created] => 2009-02-19 12:58:14
>>> )
>>> 
>>> [0] => Array
>>> (
>>> [page_view_count] => 10
>>> )
>>> )
>>> )
>>> 
>>> If I want page_view_count in the Page array, is the best approach to
>>> manipulate it to my liking in the afterFind() callback in the Page
>>> model?
>>> 
>>> Since I am always going to want this 'page_view_count' data, I tried
>>> moving the bindModel() code to the beforeFind() callback in the Page
>>> model. Caused all sorts of problems, I imagine because beforeFind() gets
>>> triggered numerous times through the various associations between all
>>> the models. Should I stick to binding over and over in my controllers,
>>> or is there a way to do it in the models?
>>> 
>>> I ask both these questions because I'm anticipating a lot of redundant
>>> code with the array manipulation and binding. Something tells me there
>>> is a better way.
>>> 
>>> 
>>> grigri wrote:
 
 
 Try this:
 
 $this->Page->bindModel(array(
   'hasOne' => array(
 'PageViewTotal' => array(
   'className' => 'PageView',
   'type' => 'inner'
 )
   )
 ));
 $results = $this->Page->find('all', array(
   'fields' => array('Page.*', 'COUNT(PageViewTotal.id) AS
 page_view_count'),
   'group' => 'Page.id',
   'order' => 'page_view_count DESC',
   'limit' => 10
 ));
 
 hth
 grigri
 
 On Mar 6, 3:36 pm, RyOnLife  wrote:
> This doesn't work because 'view_count' is not a field. All of the view
> data
> is contained in the 'View' model, keyed to the 'Page' model (Post in
> your
> example).
>
> Maybe it would help if I share the full details of my models, tables
> and the
> SQL query/result I would like to create in Cake:
>
> Page hasMany PageView:
>
> CREATE TABLE IF NOT EXISTS `pages` (
>   `id` int(11) NOT NULL auto_increment,
>  

Re: Accordion

2009-03-06 Thread Stu

Not sure if you need the scriptaculous script for anything else, but
you don't need it for this.  Also you're missing effects.js which is
specified on the website.

You might wanna take out some of that code too, you don't need all of
that, for instance:

> var topAccordion = new
> accordion('horizontal_container', {
> classNames : {
> toggle :
> 'horizontal_accordion_toggle',
> toggleActive :
> 'horizontal_accordion_toggle_active',
> content :
> 'horizontal_accordion_content'
> },
> defaultSize : {
> width : 525
> },
> direction : 'horizontal'
> });


> var nestedVerticalAccordion = new
> accordion('vertical_nested_container', {
>   classNames : {
> toggle :
> 'vertical_accordion_toggle',
> toggleActive :
> 'vertical_accordion_toggle_active',
> content :
> 'vertical_accordion_content'
> }
> });



> // Open second one
> topAccordion.activate($$('#horizontal_container
> .horizontal_accordion_toggle')[2]);
> }


All of that is if you wanted to use the nested accordion or the
horizontal accordions.

try that and post whatever happens next.
--~--~-~--~~~---~--~~
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: $viewPaths in BootStrap not seeming to work

2009-03-06 Thread jabocs

ARRGH... Can we delete this ? :)

one hour of FAIL could have been solved if I had read the full article
on this at

http://book.cakephp.org/view/36/Additional-Class-Paths


But I missed the last sentance... "Make sure that each path specified
includes a trailing slash. "

so I changed my bootstrap code to include a '/' at the end of each
path and worked:

$xch_core_path = '/Users/hardy/Sites/xch_core/app/';
$modelPaths = array($xch_core_path.'models/');
$viewPaths = array($xch_core_path.'views/');
$controllerPaths = array($xch_core_path.'controllers/');


Interesting tho that the controllers and models worked... which was
throwing me off... I guess since the views have subdirectories, it
wasn't recursing down into the subdirs... but it must have seen the
base folder of controllers and models.

DOH!!
--~--~-~--~~~---~--~~
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: $viewPaths in BootStrap not seeming to work

2009-03-06 Thread jabocs

whoops...copy and paste ...

The controller "not found error" was:

app/controllers/xpage_types_controller.php
--~--~-~--~~~---~--~~
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: $viewPaths in BootStrap not seeming to work

2009-03-06 Thread jabocs

More details

When the view can't be found the error shows it's looking in the fully
qualified path for the app like:

/Users/hardy/Sites/xch_master/app/views/xpage_types/xchange_index.ctp

But when a Controller or Model can't be found it just looks starting
in the app folder like:

app/views/xpage_types/xchange_index.ctp

Is there something that might be forcing it fully qualify to the path
of my current app?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



hasAndBelongsToMany returns 1

2009-03-06 Thread Curly

Hi! I'm beginner with cakephp.

I have binded models with HABTM

Model 'Field':
**
var $name = 'Field';
var $hasAndBelongsToMany = array(
'Category' => array('className' => 'Category')
);
**

i use :
**
$result=$this->find('all');
**

I can see that debug message returns 6 records (Num.rows) from
Category model

but $result shows only first Categories record

How to get All 'Category' records that have been associated with
'Field' model ?

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



More than one level chained hasmany association

2009-03-06 Thread miguelarc...@gmail.com

Hello,

Sorry if this is too much of a noob question, but here it goes:

I have the following Model/table associations:

Feedback hasmany Competency
Competency hasmany Questions

Is saveAll the way to go? and if so, how do I do it?

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: Accordion

2009-03-06 Thread Dave Maharaj :: WidePixels.com

 ok here is what I have in my view file.

link(array('prototype', 'scriptaculous', 'accordion' ),
false);
?>


//
//  In my case I want to load them onload, this is how you
do it!
// 
Event.observe(window, 'load', loadAccordions, true);

//
//  Set up all accordions
//
function loadAccordions() {
var topAccordion = new
accordion('horizontal_container', {
classNames : {
toggle :
'horizontal_accordion_toggle',
toggleActive :
'horizontal_accordion_toggle_active',
content :
'horizontal_accordion_content'
},
defaultSize : {
width : 525
},
direction : 'horizontal'
});

var bottomAccordion = new
accordion('vertical_container');

var nestedVerticalAccordion = new
accordion('vertical_nested_container', {
  classNames : {
toggle :
'vertical_accordion_toggle',
toggleActive :
'vertical_accordion_toggle_active',
content :
'vertical_accordion_content'
}
});

// Open first one
bottomAccordion.activate($$('#vertical_container
.accordion_toggle')[0]);

// Open second one
topAccordion.activate($$('#horizontal_container
.horizontal_accordion_toggle')[2]);
}





  title 1:
  
   element('dummy_accordion'); ?>

  
  
  title 1:
  
   element('dummy_accordion'); ?>

  
  
  title 1:
  
   element('dummy_accordion'); ?>

  
  
  title 1:
  
   element('dummy_accordion'); ?>

  
  
  
  
  
  


The element('dummy_accordion') is just content here which shows up
fine. The structure is there when I view the page. Justno accordion action.
No errors are reported. 

-Original Message-
From: Stu [mailto:greenmushroo...@gmail.com] 
Sent: March-06-09 3:32 PM
To: CakePHP
Subject: Re: Accordion


Hehe, I got this working 2 days ago,

Check out his source code, there's more then a few hints in there.

But yeah, post your code.  So we can see whats going on.


--~--~-~--~~~---~--~~
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: Converting SQL query to Cake query

2009-03-06 Thread RyOnLife


I was overthinking the bind. Instead of bindModel() in the controller, just
needed the following association in the Page model:

  var $hasOne = array( 
'PageViewTotal' => array( 
  'className' => 'PageView', 
  'type' => 'inner' 
)
  );

Between that and the afterFind() callback, seems to do the trick and be a
fairly pure solution. Still seems like if the models were set up correctly,
I could get page_view_count in the Page dimension of the array without
having to manipulate it there using afterFind().

As I am trying to learn, any comments as to the effectiveness of this
solution and/or ways to improve would be much appreciated. 



RyOnLife wrote:
> 
> Here's the afterFind(). It works. Would just like some comments on whether
> this is a sound approach.
> 
>   function afterFind($results) {
> if(!empty($results[0]['Page']) &&
> !empty($results[0][0]['total_view_count'])) {
>   $i = 0;
>   foreach($results as $result) {
> $results[$i]['Page']['total_view_count'] =
> $result[0]['total_view_count'];
> unset($results[$i][0]);
> $i++;
>   }
> }
> return $results;
>   }
> 
> I'm much more unsure about the latter question of whether there is a place
> in the Page model to do the bind. And now I'm wondering if it would be
> possible and make sense to create a total_view_count.php file in the
> models folder.
> 
> 
> 
> RyOnLife wrote:
>> 
>> @grigri: Thanks. Just what I was looking for. I hadn't used bindModel()
>> before, but now makes total sense on getting from the SQL to Cake query.
>> 
>> This does lead me to two follow up questions...
>> 
>> The $results array looks like this:
>> 
>> Array
>> (
>> [0] => Array
>> (
>> [Page] => Array
>> (
>> [id] => 1
>> [user_id] => 1
>> [title] => test
>> [slug] => test
>> [created] => 2009-02-19 12:58:14
>> )
>> 
>> [0] => Array
>> (
>> [page_view_count] => 10
>> )
>> )
>> )
>> 
>> If I want page_view_count in the Page array, is the best approach to
>> manipulate it to my liking in the afterFind() callback in the Page model?
>> 
>> Since I am always going to want this 'page_view_count' data, I tried
>> moving the bindModel() code to the beforeFind() callback in the Page
>> model. Caused all sorts of problems, I imagine because beforeFind() gets
>> triggered numerous times through the various associations between all the
>> models. Should I stick to binding over and over in my controllers, or is
>> there a way to do it in the models?
>> 
>> I ask both these questions because I'm anticipating a lot of redundant
>> code with the array manipulation and binding. Something tells me there is
>> a better way.
>> 
>> 
>> grigri wrote:
>>> 
>>> 
>>> Try this:
>>> 
>>> $this->Page->bindModel(array(
>>>   'hasOne' => array(
>>> 'PageViewTotal' => array(
>>>   'className' => 'PageView',
>>>   'type' => 'inner'
>>> )
>>>   )
>>> ));
>>> $results = $this->Page->find('all', array(
>>>   'fields' => array('Page.*', 'COUNT(PageViewTotal.id) AS
>>> page_view_count'),
>>>   'group' => 'Page.id',
>>>   'order' => 'page_view_count DESC',
>>>   'limit' => 10
>>> ));
>>> 
>>> hth
>>> grigri
>>> 
>>> On Mar 6, 3:36 pm, RyOnLife  wrote:
 This doesn't work because 'view_count' is not a field. All of the view
 data
 is contained in the 'View' model, keyed to the 'Page' model (Post in
 your
 example).

 Maybe it would help if I share the full details of my models, tables
 and the
 SQL query/result I would like to create in Cake:

 Page hasMany PageView:

 CREATE TABLE IF NOT EXISTS `pages` (
   `id` int(11) NOT NULL auto_increment,
   `user_id` int(11) NOT NULL,
   `title` varchar(100) NOT NULL,
   `slug` varchar(100) NOT NULL,
   `created` datetime NOT NULL,
   PRIMARY KEY  (`id`),
   FULLTEXT KEY `title` (`title`)
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

 PageView belongsTo Page:

 CREATE TABLE IF NOT EXISTS `page_views` (
   `id` int(11) NOT NULL auto_increment,
   `page_id` int(11) NOT NULL,
   `user_id` int(11) default NULL,
   `user_ip` int(10) unsigned default NULL,
   `created` datetime NOT NULL,
   PRIMARY KEY  (`id`)
 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED;

 SQL query:

 SELECT Page.*, COUNT(*) AS views FROM
 pages AS Page
 INNER JOIN page_views AS PageView ON Page.id = PageView.page_id
 GROUP BY Page.id
 ORDER BY COUNT(*) DESC  
 LIMIT 10 OFFSET 0;

 Returns these fields:

 id, user_id, title, slug, created, views

 The first five fields are those from the Page model and the sixth
 field,
 views, is a count of how many times the Page.id primary key is use

Re: Newbie to MVC and CakePHP question on CRUD / Associations

2009-03-06 Thread Xoubaman
Use the console to generate basic crud actions for your models. You
can generate the models also. The code will be simple enough to get a
idea about how cake works.

On Mar 6, 4:53 pm, a_summer  wrote:
> Good Day,
>
> Thank you for taking the time to read this discussion.
>
> I am new to MVC design, and I need to understand how to create a view/
> controller that will insert records into a model that uses the hasMany
> association.
>
> The table layout and code for the models is below:
>
> MySQL DB Create Table
> [solutions]
>
> CREATE TABLE `solutions`
> (
>              `id` int(11) NOT NULL
> auto_increment,
>              `title` varchar(255) default
> NULL,
>              `teaser`
> text,
>              `user_id` int(11) default
> NULL,
>              `status_id` int(11) default
> NULL,
>              `created` datetime default
> NULL,
>              `modified` datetime default
> NULL,
>              PRIMARY KEY
> (`id`)
>            ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
> CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC
>
> [sections]
>
> CREATE TABLE `sections` (
>             `id` int(11) NOT NULL auto_increment,
>             `title` text,
>             `content` text,
>             `solution_id` int(11) default NULL,
>             `created` datetime default NULL,
>             `modified` datetime default NULL,
>             PRIMARY KEY  (`id`)
>           ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
>
> Models
>
> 
> # /apps/models/solution.php
>
> class Solution extends AppModel
> {
>   var $name = 'Solution';
>
>   #Validations
>   var $validate = array (
>                           'title'   =>    array (
>                                                   'rule'  =>
> 'notEmpty'
>                                                 ),
>                           'user_id' =>    array (
>                                                   'rule'  =>
> 'notEmpty'
>                                                 ),
>                           'teaser'    =>  array (
>                                                   'rule'  =>
> 'notEmpty'
>                                                 ),
>                           'status_id' => array  (
>                                                   'rule'  =>
> 'notEmpty'
>                                                 )
>                         );
>   #Associations
>   var $hasMany  = array (
>                           'Section' =>  array (
>                                                 'className'   =>
> 'Section',
>                                                 'foreignKey'  =>
> 'solution_id',
>                                                 'order'       =>
> 'Section.created ASC',
>                                                 'dependent'   =>  true
>                                               )
>                         );
>
> }
>
> ?>
>
> ++
>
> 
> # /apps/models/section.php
>
> class Section extends AppModel
> {
>   var $name = 'Section';
>
>   #Validations
>   var $validate = array (
>                           'title'       =>    array (
>                                                       'rule'  =>
> 'notEmpty'
>                                                     ),
>                           'content'     =>    array (
>                                                       'rule'  =>
> 'notEmpty'
>                                                     ),
>                           'solution_id' =>    array (
>                                                       'rule'  =>
> 'notEmpty'
>                                                     )
>                         );
>   #Associations
>   var $belongsTo  = array (
>                             'Solution' =>  array (
>                                                     'className'   =>
> 'Solution',
>                                                     'foreignKey'  =>
> 'solution_id'
>                                                   )
>                           );
>
> }
>
> ?>
>
> Now, in my old and flawed method of coding, I would include a form
> with a hidden field that includes the solution_id.
>
> Since I am trying to understand MVC, I know I will need a view to
> manage the input form for inserting a new section. But I am stuck on
> the controller ... how do I ensure that the controller includes the
> correct solution_id?
>
> Thanks in advance for any assistance you can provide!
>
> A Summer
--~--~-~--~~~---~--~~
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: $viewPaths in BootStrap not seeming to work

2009-03-06 Thread jabocs

Further testing ... My $modelPaths also works...

I moved the model out to the "core" app directories and my app was
able to use the model in the core.

So still wondering about $viewPaths
--~--~-~--~~~---~--~~
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: Accordion

2009-03-06 Thread Stu

Hehe, I got this working 2 days ago,

Check out his source code, there's more then a few hints in there.

But yeah, post your code.  So we can see whats going on.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



$viewPaths in BootStrap not seeming to work

2009-03-06 Thread jabocs

I have placed the following code in my Cake 1.2 RC2 bootstrap file:

$xch_core_path = '/Users/hardy/Sites/xch_core/app/';
$modelPaths = array($xch_core_path.'models');
$viewPaths = array($xch_core_path.'views');
$controllerPaths = array($xch_core_path.'controllers');


Controllers are working fine... I have moved a controller over the
xch_core app/controllers folder and my second app can use it...

However when I move my app/views/xpage_types folder over to the app/
views/
I get the following:

Error: The view for XpageTypesController::xchange_index() was not
found.

Error: Confirm you have created the file: /Users/hardy/Sites/
xch_master/app/views/xpage_types/xchange_index.ctp


Seems like it can find the $controllerPaths but not the $viewPaths ??

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



Re: Accordion

2009-03-06 Thread Samuel DeVore

On Fri, Mar 6, 2009 at 11:31 AM, Dave Maharaj :: WidePixels.com
 wrote:
> I am trying to get this working on my application.
> http://stickmanlabs.com/accordion/
>
> I have the scripts in the folder, added to page layout. Checked the html
> (Firebug) and see the scripts are loaded correctly.
>
> Actually copied / paste the code from the demo after trying my own and still
> nothing.
>
> Something I am missing?


Yes any information that might actually let us help you, code samples,
error messages, sample we can look at.  It is more then likely that
this may not be the best place for help, it could be a problem with
the accordion code.  Really I am sure someone can help but your just
not giving us much to help with.

A great place to put sample code that preserves layout is to use the bin

http://bin.cakephp.org/

Sam D

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



Accordion

2009-03-06 Thread Dave Maharaj :: WidePixels.com
I am trying to get this working on my application.
http://stickmanlabs.com/accordion/
 
I have the scripts in the folder, added to page layout. Checked the html
(Firebug) and see the scripts are loaded correctly.
 
Actually copied / paste the code from the demo after trying my own and still
nothing.
 
Something I am missing?
 
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: Best way to organize CSS and JS

2009-03-06 Thread Sam Sherlock

you might be interested in
cakebaker.42dh.com/2007/03/17/mvc-with-javascript/
www.javascriptmvc.com

 - S



2009/3/6 yogesh kumar :
>
> use css and javascript in layout  default.php
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: Converting SQL query to Cake query

2009-03-06 Thread RyOnLife


Here's the afterFind(). It works. Would just like some comments on whether
this is a sound approach.

  function afterFind($results) {
if(!empty($results[0]['Page']) &&
!empty($results[0][0]['total_view_count'])) {
  $i = 0;
  foreach($results as $result) {
$results[$i]['Page']['total_view_count'] =
$result[0]['total_view_count'];
unset($results[$i][0]);
$i++;
  }
}
return $results;
  }

I'm much more unsure about the latter question of whether there is a place
in the Page model to do the bind. And now I'm wondering if it would be
possible and make sense to create a total_view_count.php file in the models
folder.



RyOnLife wrote:
> 
> @grigri: Thanks. Just what I was looking for. I hadn't used bindModel()
> before, but now makes total sense on getting from the SQL to Cake query.
> 
> This does lead me to two follow up questions...
> 
> The $results array looks like this:
> 
> Array
> (
> [0] => Array
> (
> [Page] => Array
> (
> [id] => 1
> [user_id] => 1
> [title] => test
> [slug] => test
> [created] => 2009-02-19 12:58:14
> )
> 
> [0] => Array
> (
> [page_view_count] => 10
> )
> )
> )
> 
> If I want page_view_count in the Page array, is the best approach to
> manipulate it to my liking in the afterFind() callback in the Page model?
> 
> Since I am always going to want this 'page_view_count' data, I tried
> moving the bindModel() code to the beforeFind() callback in the Page
> model. Caused all sorts of problems, I imagine because beforeFind() gets
> triggered numerous times through the various associations between all the
> models. Should I stick to binding over and over in my controllers, or is
> there a way to do it in the models?
> 
> I ask both these questions because I'm anticipating a lot of redundant
> code with the array manipulation and binding. Something tells me there is
> a better way.
> 
> 
> grigri wrote:
>> 
>> 
>> Try this:
>> 
>> $this->Page->bindModel(array(
>>   'hasOne' => array(
>> 'PageViewTotal' => array(
>>   'className' => 'PageView',
>>   'type' => 'inner'
>> )
>>   )
>> ));
>> $results = $this->Page->find('all', array(
>>   'fields' => array('Page.*', 'COUNT(PageViewTotal.id) AS
>> page_view_count'),
>>   'group' => 'Page.id',
>>   'order' => 'page_view_count DESC',
>>   'limit' => 10
>> ));
>> 
>> hth
>> grigri
>> 
>> On Mar 6, 3:36 pm, RyOnLife  wrote:
>>> This doesn't work because 'view_count' is not a field. All of the view
>>> data
>>> is contained in the 'View' model, keyed to the 'Page' model (Post in
>>> your
>>> example).
>>>
>>> Maybe it would help if I share the full details of my models, tables and
>>> the
>>> SQL query/result I would like to create in Cake:
>>>
>>> Page hasMany PageView:
>>>
>>> CREATE TABLE IF NOT EXISTS `pages` (
>>>   `id` int(11) NOT NULL auto_increment,
>>>   `user_id` int(11) NOT NULL,
>>>   `title` varchar(100) NOT NULL,
>>>   `slug` varchar(100) NOT NULL,
>>>   `created` datetime NOT NULL,
>>>   PRIMARY KEY  (`id`),
>>>   FULLTEXT KEY `title` (`title`)
>>> ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
>>>
>>> PageView belongsTo Page:
>>>
>>> CREATE TABLE IF NOT EXISTS `page_views` (
>>>   `id` int(11) NOT NULL auto_increment,
>>>   `page_id` int(11) NOT NULL,
>>>   `user_id` int(11) default NULL,
>>>   `user_ip` int(10) unsigned default NULL,
>>>   `created` datetime NOT NULL,
>>>   PRIMARY KEY  (`id`)
>>> ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED;
>>>
>>> SQL query:
>>>
>>> SELECT Page.*, COUNT(*) AS views FROM
>>> pages AS Page
>>> INNER JOIN page_views AS PageView ON Page.id = PageView.page_id
>>> GROUP BY Page.id
>>> ORDER BY COUNT(*) DESC  
>>> LIMIT 10 OFFSET 0;
>>>
>>> Returns these fields:
>>>
>>> id, user_id, title, slug, created, views
>>>
>>> The first five fields are those from the Page model and the sixth field,
>>> views, is a count of how many times the Page.id primary key is used as a
>>> PageView.page_id foreign key.
>>>
>>> Thanks for the help. I know Cake is supposed to make SQL easier, but I
>>> am
>>> having trouble making the jump from SQL to Cake queries where the SQL is
>>> more involved than simple SELECT statements.
>>>
>>> Stu-2 wrote:
>>>
>>> > $topTen = $this->Post->find('list',
>>> > array(
>>> > 'fields' => array('Post.id', 'Post.view_count'),
>>> > 'order' => array('Post.view_count DESC'),
>>> > 'limit' => 10
>>> > )
>>> > );
>>>
>>> > this worked for me.
>>>
>>> --
>>> View this message in
>>> context:http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p243...
>>> Sent from the CakePHP mailing list archive at Nabble.com.
>> >> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p2437049.html
Sent from the CakePHP maili

Re: Line feed at the befining of my pages source ?!? Where does it come from? Is beaks my XML :(

2009-03-06 Thread Alfredo Quiroga-Villamil

Ummm, try setting your layout to be of ajax type and see how it goes.

function toto() {
$this->layout = 'ajax';
$this->render( null, '/xml/default', null );
}

Regards,

Alfredo

On Fri, Mar 6, 2009 at 11:24 AM, Aktarus  wrote:
>
> Hello,
>
> I have an Ajax that requests XML feed to one of my CakePHP action.
>
> My action works great and returns something like:-
>
> 
> 
> 
>
> So far so good... with IE, because my Ajax does not work with
> Mozilla!
> Mozilla returns the following error message when accessing the action
> that ough to return the XML directly:-
>
> XML Parsing Error: XML or text declaration not at start of entity
> Location: http://localhost/dnp/toto_trees/tree
> Line Number 2, Column 1:
> ^
>
> I looked in the source of this page and I can see that the page starts
> with a blank line (line feed) - Mozilla complains about it, an XML
> document should start immediatly with  encoding="ISO-8859-1" ?> ...
>
> In my Controller:-
>
> function toto() {
>     $this->render( null, '/xml/default', null );
> }
>
> In my .ctp:-
> 
> 
>
> In my layout:-
>  echo $content_for_layout;
> Configure::write('debug', 0);
> ?>
>
>
> Thus I don't see where this line feed comes from - Can you help or
> give me a workaround?
>
> Thanks!
>
> >
>

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



Re: Converting SQL query to Cake query

2009-03-06 Thread RyOnLife


@grigri: Thanks. Just what I was looking for. I hadn't used bindModel()
before, but now makes total sense on getting from the SQL to Cake query.

This does lead me to two follow up questions...

The $results array looks like this:

Array
(
[0] => Array
(
[Page] => Array
(
[id] => 1
[user_id] => 1
[title] => test
[slug] => test
[created] => 2009-02-19 12:58:14
)

[0] => Array
(
[page_view_count] => 10
)
)
)

If I want page_view_count in the Page array, is the best approach to
manipulate it to my liking in the afterFind() callback in the Page model?

Since I am always going to want this 'page_view_count' data, I tried moving
the bindModel() code to the beforeFind() callback in the Page model. Caused
all sorts of problems, I imagine because beforeFind() gets triggered
numerous times through the various associations between all the models.
Should I stick to binding over and over in my controllers, or is there a way
to do it in the models?

I ask both these questions because I'm anticipating a lot of redundant code
with the array manipulation and binding. Something tells me there is a
better way.


grigri wrote:
> 
> 
> Try this:
> 
> $this->Page->bindModel(array(
>   'hasOne' => array(
> 'PageViewTotal' => array(
>   'className' => 'PageView',
>   'type' => 'inner'
> )
>   )
> ));
> $results = $this->Page->find('all', array(
>   'fields' => array('Page.*', 'COUNT(PageViewTotal.id) AS
> page_view_count'),
>   'group' => 'Page.id',
>   'order' => 'page_view_count DESC',
>   'limit' => 10
> ));
> 
> hth
> grigri
> 
> On Mar 6, 3:36 pm, RyOnLife  wrote:
>> This doesn't work because 'view_count' is not a field. All of the view
>> data
>> is contained in the 'View' model, keyed to the 'Page' model (Post in your
>> example).
>>
>> Maybe it would help if I share the full details of my models, tables and
>> the
>> SQL query/result I would like to create in Cake:
>>
>> Page hasMany PageView:
>>
>> CREATE TABLE IF NOT EXISTS `pages` (
>>   `id` int(11) NOT NULL auto_increment,
>>   `user_id` int(11) NOT NULL,
>>   `title` varchar(100) NOT NULL,
>>   `slug` varchar(100) NOT NULL,
>>   `created` datetime NOT NULL,
>>   PRIMARY KEY  (`id`),
>>   FULLTEXT KEY `title` (`title`)
>> ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
>>
>> PageView belongsTo Page:
>>
>> CREATE TABLE IF NOT EXISTS `page_views` (
>>   `id` int(11) NOT NULL auto_increment,
>>   `page_id` int(11) NOT NULL,
>>   `user_id` int(11) default NULL,
>>   `user_ip` int(10) unsigned default NULL,
>>   `created` datetime NOT NULL,
>>   PRIMARY KEY  (`id`)
>> ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED;
>>
>> SQL query:
>>
>> SELECT Page.*, COUNT(*) AS views FROM
>> pages AS Page
>> INNER JOIN page_views AS PageView ON Page.id = PageView.page_id
>> GROUP BY Page.id
>> ORDER BY COUNT(*) DESC  
>> LIMIT 10 OFFSET 0;
>>
>> Returns these fields:
>>
>> id, user_id, title, slug, created, views
>>
>> The first five fields are those from the Page model and the sixth field,
>> views, is a count of how many times the Page.id primary key is used as a
>> PageView.page_id foreign key.
>>
>> Thanks for the help. I know Cake is supposed to make SQL easier, but I am
>> having trouble making the jump from SQL to Cake queries where the SQL is
>> more involved than simple SELECT statements.
>>
>> Stu-2 wrote:
>>
>> > $topTen = $this->Post->find('list',
>> > array(
>> > 'fields' => array('Post.id', 'Post.view_count'),
>> > 'order' => array('Post.view_count DESC'),
>> > 'limit' => 10
>> > )
>> > );
>>
>> > this worked for me.
>>
>> --
>> View this message in
>> context:http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p243...
>> Sent from the CakePHP mailing list archive at Nabble.com.
> > 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p2436990.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: Labels around inputs

2009-03-06 Thread Dave Maharaj :: WidePixels.com

Still no luck.
My view has input('User',array('multiple'=>'checkbox',
'div'=>false, 'label'=>false));
 ?>

The input type is multiple checkboxes. I think that’s where the problem is
coming from.  The html rendered is:



ColdPlay


Would it be easier to do a foreach type setup? That way I can hardcode the
view the way I want with 

Thanks,

Dave


-Original Message-
From: Brendon Kozlowski [mailto:brendon...@hotmail.com] 
Sent: March-06-09 12:32 PM
To: CakePHP
Subject: Re: Labels around inputs


If you insist on using the helper and HAVE to have the markup you list,
it'll be mostly a manual exercise in overriding default behavior.  For a
project that I did, I did the following:

Type of Report
input('type', array('type'=>'radio', 'options'=>array
('public'=>'Public Incident/Accident','staff'=>'Staff Accident'),
'legend'=>false, 'value'=>($this->data['Incident']['type'] ==
'staff') ? 'staff' : 'public'));
?>


This, however, kept the DIV surrounding the input intact, the label however
was manually added prior to the default DIV and input that CakePHP's form
helper produces.  As I see you have the label set to false and it is still
supposedly displaying a label, that makes me believe you need to clear your
cache.  If you also need to remove the DIV surrounding the INPUT so that it
surrounds EVERYTHING, then you'll also want to set 'div'=>false in the
options array, and manually add it back in.

So, to summarize:
1. Keep 'label'=>false in your options array 2. Add 'div'=>false to your
options array 3. Manually add in the DIV and LABEL markup for your input.
4. Clear your cache.
5. Refresh the page.  :)

On Mar 5, 11:43 pm, "Dave Maharaj :: WidePixels.com"
 wrote:
> Does anyone know how I can put my inputs inside the label DIV?
>
> Right now the code rendered is:
>
> 
>  name="data[User][User][]"/>
> Perfect 
>
> from this in the view :
>    echo 
> $form->input(User,array('multiple'=>'checkbox','label'=>false));
>  ?>
>
> What I need is :
>
> 
>   type="checkbox" value="13" checked="checked"
> name="data[User][User][]"/>Perfect
> 
> 
> I dont even care if the class=checkbox is there.
>
> Thnaks
>
> 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: Best way to organize CSS and JS

2009-03-06 Thread yogesh kumar
use css and javascript in layout  default.php

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



Best way to organize CSS and JS

2009-03-06 Thread marco.rizze...@gmail.com

Hi
I must to make a big application in CAKEPHP.(Like a multiservice
platform).
Before to start the develop I would ask what is the best way to
organize the CSS and the javascript for a big application?
Many 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
-~--~~~~--~~--~--~---



Line feed at the befining of my pages source ?!? Where does it come from? Is beaks my XML :(

2009-03-06 Thread Aktarus

Hello,

I have an Ajax that requests XML feed to one of my CakePHP action.

My action works great and returns something like:-





So far so good... with IE, because my Ajax does not work with
Mozilla!
Mozilla returns the following error message when accessing the action
that ough to return the XML directly:-

XML Parsing Error: XML or text declaration not at start of entity
Location: http://localhost/dnp/toto_trees/tree
Line Number 2, Column 1:
^

I looked in the source of this page and I can see that the page starts
with a blank line (line feed) - Mozilla complains about it, an XML
document should start immediatly with  ...

In my Controller:-

function toto() {
 $this->render( null, '/xml/default', null );
}

In my .ctp:-



In my layout:-



Thus I don't see where this line feed comes from - Can you help or
give me a workaround?

Thanks!

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



Re: Labels around inputs

2009-03-06 Thread Brendon Kozlowski

If you insist on using the helper and HAVE to have the markup you
list, it'll be mostly a manual exercise in overriding default
behavior.  For a project that I did, I did the following:

Type of Report
input('type', array('type'=>'radio', 'options'=>array
('public'=>'Public Incident/Accident','staff'=>'Staff Accident'),
'legend'=>false, 'value'=>($this->data['Incident']['type'] ==
'staff') ? 'staff' : 'public'));
?>


This, however, kept the DIV surrounding the input intact, the label
however was manually added prior to the default DIV and input that
CakePHP's form helper produces.  As I see you have the label set to
false and it is still supposedly displaying a label, that makes me
believe you need to clear your cache.  If you also need to remove the
DIV surrounding the INPUT so that it surrounds EVERYTHING, then you'll
also want to set 'div'=>false in the options array, and manually add
it back in.

So, to summarize:
1. Keep 'label'=>false in your options array
2. Add 'div'=>false to your options array
3. Manually add in the DIV and LABEL markup for your input.
4. Clear your cache.
5. Refresh the page.  :)

On Mar 5, 11:43 pm, "Dave Maharaj :: WidePixels.com"
 wrote:
> Does anyone know how I can put my inputs inside the label DIV?
>
> Right now the code rendered is:
>
> 
>  name="data[User][User][]"/>
> Perfect
> 
>
> from this in the view :
>    echo $form->input(User,array('multiple'=>'checkbox','label'=>false));
>  ?>
>
> What I need is :
>
> 
> 
>  name="data[User][User][]"/>Perfect
> 
> 
> I dont even care if the class=checkbox is there.
>
> Thnaks
>
> 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: Converting SQL query to Cake query

2009-03-06 Thread grigri

Try this:

$this->Page->bindModel(array(
  'hasOne' => array(
'PageViewTotal' => array(
  'className' => 'PageView',
  'type' => 'inner'
)
  )
));
$results = $this->Page->find('all', array(
  'fields' => array('Page.*', 'COUNT(PageViewTotal.id) AS
page_view_count'),
  'group' => 'Page.id',
  'order' => 'page_view_count DESC',
  'limit' => 10
));

hth
grigri

On Mar 6, 3:36 pm, RyOnLife  wrote:
> This doesn't work because 'view_count' is not a field. All of the view data
> is contained in the 'View' model, keyed to the 'Page' model (Post in your
> example).
>
> Maybe it would help if I share the full details of my models, tables and the
> SQL query/result I would like to create in Cake:
>
> Page hasMany PageView:
>
> CREATE TABLE IF NOT EXISTS `pages` (
>   `id` int(11) NOT NULL auto_increment,
>   `user_id` int(11) NOT NULL,
>   `title` varchar(100) NOT NULL,
>   `slug` varchar(100) NOT NULL,
>   `created` datetime NOT NULL,
>   PRIMARY KEY  (`id`),
>   FULLTEXT KEY `title` (`title`)
> ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
>
> PageView belongsTo Page:
>
> CREATE TABLE IF NOT EXISTS `page_views` (
>   `id` int(11) NOT NULL auto_increment,
>   `page_id` int(11) NOT NULL,
>   `user_id` int(11) default NULL,
>   `user_ip` int(10) unsigned default NULL,
>   `created` datetime NOT NULL,
>   PRIMARY KEY  (`id`)
> ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED;
>
> SQL query:
>
> SELECT Page.*, COUNT(*) AS views FROM
> pages AS Page
> INNER JOIN page_views AS PageView ON Page.id = PageView.page_id
> GROUP BY Page.id
> ORDER BY COUNT(*) DESC  
> LIMIT 10 OFFSET 0;
>
> Returns these fields:
>
> id, user_id, title, slug, created, views
>
> The first five fields are those from the Page model and the sixth field,
> views, is a count of how many times the Page.id primary key is used as a
> PageView.page_id foreign key.
>
> Thanks for the help. I know Cake is supposed to make SQL easier, but I am
> having trouble making the jump from SQL to Cake queries where the SQL is
> more involved than simple SELECT statements.
>
> Stu-2 wrote:
>
> > $topTen = $this->Post->find('list',
> > array(
> > 'fields' => array('Post.id', 'Post.view_count'),
> > 'order' => array('Post.view_count DESC'),
> > 'limit' => 10
> > )
> > );
>
> > this worked for me.
>
> --
> View this message in 
> context:http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p243...
> 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
-~--~~~~--~~--~--~---



Newbie to MVC and CakePHP question on CRUD / Associations

2009-03-06 Thread a_summer

Good Day,

Thank you for taking the time to read this discussion.

I am new to MVC design, and I need to understand how to create a view/
controller that will insert records into a model that uses the hasMany
association.

The table layout and code for the models is below:

MySQL DB Create Table
[solutions]

CREATE TABLE `solutions`
(
 `id` int(11) NOT NULL
auto_increment,
 `title` varchar(255) default
NULL,
 `teaser`
text,
 `user_id` int(11) default
NULL,
 `status_id` int(11) default
NULL,
 `created` datetime default
NULL,
 `modified` datetime default
NULL,
 PRIMARY KEY
(`id`)
   ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8
CHECKSUM=1 DELAY_KEY_WRITE=1 ROW_FORMAT=DYNAMIC

[sections]

CREATE TABLE `sections` (
`id` int(11) NOT NULL auto_increment,
`title` text,
`content` text,
`solution_id` int(11) default NULL,
`created` datetime default NULL,
`modified` datetime default NULL,
PRIMARY KEY  (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1

Models

array (
  'rule'  =>
'notEmpty'
),
  'user_id' =>array (
  'rule'  =>
'notEmpty'
),
  'teaser'=>  array (
  'rule'  =>
'notEmpty'
),
  'status_id' => array  (
  'rule'  =>
'notEmpty'
)
);
  #Associations
  var $hasMany  = array (
  'Section' =>  array (
'className'   =>
'Section',
'foreignKey'  =>
'solution_id',
'order'   =>
'Section.created ASC',
'dependent'   =>  true
  )
);
}

?>

++

array (
  'rule'  =>
'notEmpty'
),
  'content' =>array (
  'rule'  =>
'notEmpty'
),
  'solution_id' =>array (
  'rule'  =>
'notEmpty'
)
);
  #Associations
  var $belongsTo  = array (
'Solution' =>  array (
'className'   =>
'Solution',
'foreignKey'  =>
'solution_id'
  )
  );
}

?>

Now, in my old and flawed method of coding, I would include a form
with a hidden field that includes the solution_id.

Since I am trying to understand MVC, I know I will need a view to
manage the input form for inserting a new section. But I am stuck on
the controller ... how do I ensure that the controller includes the
correct solution_id?

Thanks in advance for any assistance you can provide!

A Summer

--~--~-~--~~~---~--~~
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: Converting SQL query to Cake query

2009-03-06 Thread RyOnLife


This doesn't work because 'view_count' is not a field. All of the view data
is contained in the 'View' model, keyed to the 'Page' model (Post in your
example).

Maybe it would help if I share the full details of my models, tables and the
SQL query/result I would like to create in Cake:

Page hasMany PageView:

CREATE TABLE IF NOT EXISTS `pages` (
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) NOT NULL,
  `title` varchar(100) NOT NULL,
  `slug` varchar(100) NOT NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY  (`id`),
  FULLTEXT KEY `title` (`title`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

PageView belongsTo Page:

CREATE TABLE IF NOT EXISTS `page_views` (
  `id` int(11) NOT NULL auto_increment,
  `page_id` int(11) NOT NULL,
  `user_id` int(11) default NULL,
  `user_ip` int(10) unsigned default NULL,
  `created` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED; 

SQL query:

SELECT Page.*, COUNT(*) AS views FROM 
pages AS Page 
INNER JOIN page_views AS PageView ON Page.id = PageView.page_id 
GROUP BY Page.id 
ORDER BY COUNT(*) DESC   
LIMIT 10 OFFSET 0;

Returns these fields:

id, user_id, title, slug, created, views

The first five fields are those from the Page model and the sixth field,
views, is a count of how many times the Page.id primary key is used as a
PageView.page_id foreign key.

Thanks for the help. I know Cake is supposed to make SQL easier, but I am
having trouble making the jump from SQL to Cake queries where the SQL is
more involved than simple SELECT statements. 



Stu-2 wrote:
> 
> 
> $topTen = $this->Post->find('list',
> array(
> 'fields' => array('Post.id', 'Post.view_count'),
> 'order' => array('Post.view_count DESC'),
> 'limit' => 10
> )
> );
> 
> this worked for me.
> > 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p2436388.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: $this->passedArgs breaking my Routes

2009-03-06 Thread geoff

Sorry to keep bumping and adding, but a workaround that I've managed
to find is to use the Routing.admin configuration setting. This is a
*serious* hack though, as there is already a CMS section attached to
this project, and it really isn't ideal to have two separate
applications for different sections.

Seriously, if anyone has had some success in using custom prefixing in
Cake, I'd really appreciate it if you could let me know how you got it
working correctly!

On Mar 6, 4:19 pm, geoff  wrote:
> After doing some more searching, I came across the section in the
> cookbook concerning prefix routing. There were one or two little
> things that I was doing incorrectly, and those have been corrected.
>
> However, I took a look at the example that they set out in the
> cookbook, and tried it in my application. I copied and pasted the
> route, as well as the PHP code to create the link using the HTML
> helper, and it still did not work. The prefix was ignored completely.
> This seems like it could be a bug?
>
> On Mar 6, 3:46 pm, geoff  wrote:
>
> > Yeah, I've tried every possible combination that I can think of, and
> > nothing seems to work correctly. One thing I have noticed is that when
> > the passedArgs array is passed to the paginator helper, if there is
> > any other named parameter other than "page", the routes do not work.
> > So, I'm guessing that this is probably something to do me not having
> > my routes set up correctly.
>
> > However, I didn't think that named parameters influenced the routes at
> > all. Perhaps someone could enlighten me on this?
>
> > On Mar 6, 1:10 pm, majna  wrote:
>
> > > It's not working even you pass all params to paginator in view:
> > > $paginator->options(array('url'=>array_merge(array('prefix'=>$this->params['prefix']),array('wap'=>true),
> > >  $this->passedArgs)));
>
> > > debug($paginator->options);
> > > Bug?
>
> > > I would like to see  multiple Routing.admin, like
> > > Routing.admin
> > > Routing.user
> > > Routing.public..
>
> > > For now cake use only one.
>
> > > On Mar 6, 8:53 am, geoff  wrote:
>
> > > > Hey all.
>
> > > > I have a fairly troublesome problem that has really been grating my
> > > > goat for the past little while. It has to do with the supplying of
> > > > named parameters to aURL, and having them break mypagination. I have
> > > > a feeling that the example below might explain this better:
>
> > > > ---
>
> > > > __Route configuration__
> > > > Router::connect('/wap/', array('controller' => 'categories', 'action'
> > > > => 'index', 'prefix' => 'wap'));
> > > > Router::connect('/wap/:controller/:action/*', array('prefix' => 'wap',
> > > > 'wap' => true));
> > > > [ As far as I can understand, this will map /wap/users/view/4 =>
> > > > userscontroller/wap_view/4 ]
>
> > > > ---
>
> > > > __Pagination__
> > > > options(array('url' => $this->passedArgs))?>
> > > > [ This is what I am using to set thepaginationURLoptions. ]
>
> > > > ---
>
> > > > Now, this works fine when I have no named parameters (e.g.URL: /wap/
> > > > products/index/22/page:3/). However, as soon as I add in another named
> > > > parameter - no matter what the named parameter - the URLs used in 
> > > > thepaginationare broken; they don't seem to use the reverse routing
> > > > anymore. This is an example of the kinds of URLs that are generated
> > > > once another named parameter is added: /products/wap_index/22/page:3/
> > > > images:on.
>
> > > > So, as you can see, it merely takes the user to the 
> > > > controller/actionURL, which is not the way that I would want it.
>
> > > > I'm suspecting that this might actually just be because there is some
> > > > silly parameter that I haven't included or something. If there is
> > > > anyone that can help me, or at least point in the a decent direction,
> > > > I would really appreciate it!
>
> > > > Cheers,
> > > > Geoff
--~--~-~--~~~---~--~~
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: Converting SQL query to Cake query

2009-03-06 Thread Stu

$topTen = $this->Post->find('list',
array(
'fields' => array('Post.id', 'Post.view_count'),
'order' => array('Post.view_count DESC'),
'limit' => 10
)
);

this worked for me.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



SecurityComponent on Dreamhost, problem with HTTP Auth

2009-03-06 Thread Pixelastic

Hello,

I am trying to protect some of my pages with the basic Http
Authentification provided by the SecurityComponent (those pages are
indeed RSS feeds), but even if everything worked great on my local
machine, it kind of fails while online on my Dreamhost server.

I have set up a really simple page showing the problem (it's a fresh
cake install, with the latest nightly build). The only new file is the
app_controller :

http://reveter.pixelastic.com/
class AppController extends Controller {

var $components = array('Security');

function beforeFilter() {
$this->Security->loginOptions = array(
'type' => 'basic',
'login' => 'httpAuthenticate',
'realm' => 'test'
);
$this->Security->loginUsers = array();
$this->Security->requireLogin();

}


function httpAuthenticate($args) {
debug($args);
die();
//I've tried returning false, exiting, calling a blackHole here, but
nothing changed.
}
}

So, what I am trying to do, is asking for an http auth on every single
page, and displaying the fields entered in the prompt (just to prove
that the httpAuthenticate method is triggered). But I kept having a
loop of the prompt asking me again and again my login/pass, and the
custom method is never triggered.

I asked the support team at Dreamhost and they told me that nothing
they can think of on their servers could cause such a loop. And as
they cannot help with custom scripts I was wondering if they're was
something wrong with my implementation ?
The guy at Dreamhost thought that maybe the rewrite rules were
creating an infinite loop, do you have any clues ?
--~--~-~--~~~---~--~~
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: $this->passedArgs breaking my Routes

2009-03-06 Thread geoff

After doing some more searching, I came across the section in the
cookbook concerning prefix routing. There were one or two little
things that I was doing incorrectly, and those have been corrected.

However, I took a look at the example that they set out in the
cookbook, and tried it in my application. I copied and pasted the
route, as well as the PHP code to create the link using the HTML
helper, and it still did not work. The prefix was ignored completely.
This seems like it could be a bug?

On Mar 6, 3:46 pm, geoff  wrote:
> Yeah, I've tried every possible combination that I can think of, and
> nothing seems to work correctly. One thing I have noticed is that when
> the passedArgs array is passed to the paginator helper, if there is
> any other named parameter other than "page", the routes do not work.
> So, I'm guessing that this is probably something to do me not having
> my routes set up correctly.
>
> However, I didn't think that named parameters influenced the routes at
> all. Perhaps someone could enlighten me on this?
>
> On Mar 6, 1:10 pm, majna  wrote:
>
> > It's not working even you pass all params to paginator in view:
> > $paginator->options(array('url'=>array_merge(array('prefix'=>$this->params['prefix']),array('wap'=>true),
> >  $this->passedArgs)));
>
> > debug($paginator->options);
> > Bug?
>
> > I would like to see  multiple Routing.admin, like
> > Routing.admin
> > Routing.user
> > Routing.public..
>
> > For now cake use only one.
>
> > On Mar 6, 8:53 am, geoff  wrote:
>
> > > Hey all.
>
> > > I have a fairly troublesome problem that has really been grating my
> > > goat for the past little while. It has to do with the supplying of
> > > named parameters to aURL, and having them break mypagination. I have
> > > a feeling that the example below might explain this better:
>
> > > ---
>
> > > __Route configuration__
> > > Router::connect('/wap/', array('controller' => 'categories', 'action'
> > > => 'index', 'prefix' => 'wap'));
> > > Router::connect('/wap/:controller/:action/*', array('prefix' => 'wap',
> > > 'wap' => true));
> > > [ As far as I can understand, this will map /wap/users/view/4 =>
> > > userscontroller/wap_view/4 ]
>
> > > ---
>
> > > __Pagination__
> > > options(array('url' => $this->passedArgs))?>
> > > [ This is what I am using to set thepaginationURLoptions. ]
>
> > > ---
>
> > > Now, this works fine when I have no named parameters (e.g.URL: /wap/
> > > products/index/22/page:3/). However, as soon as I add in another named
> > > parameter - no matter what the named parameter - the URLs used in 
> > > thepaginationare broken; they don't seem to use the reverse routing
> > > anymore. This is an example of the kinds of URLs that are generated
> > > once another named parameter is added: /products/wap_index/22/page:3/
> > > images:on.
>
> > > So, as you can see, it merely takes the user to the controller/actionURL, 
> > > which is not the way that I would want it.
>
> > > I'm suspecting that this might actually just be because there is some
> > > silly parameter that I haven't included or something. If there is
> > > anyone that can help me, or at least point in the a decent direction,
> > > I would really appreciate it!
>
> > > Cheers,
> > > Geoff
--~--~-~--~~~---~--~~
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: $this->passedArgs breaking my Routes

2009-03-06 Thread geoff

Yeah, I've tried every possible combination that I can think of, and
nothing seems to work correctly. One thing I have noticed is that when
the passedArgs array is passed to the paginator helper, if there is
any other named parameter other than "page", the routes do not work.
So, I'm guessing that this is probably something to do me not having
my routes set up correctly.

However, I didn't think that named parameters influenced the routes at
all. Perhaps someone could enlighten me on this?

On Mar 6, 1:10 pm, majna  wrote:
> It's not working even you pass all params to paginator in view:
> $paginator->options(array('url'=>array_merge(array('prefix'=>$this->params['prefix']),array('wap'=>true),
>  $this->passedArgs)));
>
> debug($paginator->options);
> Bug?
>
> I would like to see  multiple Routing.admin, like
> Routing.admin
> Routing.user
> Routing.public..
>
> For now cake use only one.
>
> On Mar 6, 8:53 am, geoff  wrote:
>
> > Hey all.
>
> > I have a fairly troublesome problem that has really been grating my
> > goat for the past little while. It has to do with the supplying of
> > named parameters to aURL, and having them break mypagination. I have
> > a feeling that the example below might explain this better:
>
> > ---
>
> > __Route configuration__
> > Router::connect('/wap/', array('controller' => 'categories', 'action'
> > => 'index', 'prefix' => 'wap'));
> > Router::connect('/wap/:controller/:action/*', array('prefix' => 'wap',
> > 'wap' => true));
> > [ As far as I can understand, this will map /wap/users/view/4 =>
> > userscontroller/wap_view/4 ]
>
> > ---
>
> > __Pagination__
> > options(array('url' => $this->passedArgs))?>
> > [ This is what I am using to set thepaginationURLoptions. ]
>
> > ---
>
> > Now, this works fine when I have no named parameters (e.g.URL: /wap/
> > products/index/22/page:3/). However, as soon as I add in another named
> > parameter - no matter what the named parameter - the URLs used in 
> > thepaginationare broken; they don't seem to use the reverse routing
> > anymore. This is an example of the kinds of URLs that are generated
> > once another named parameter is added: /products/wap_index/22/page:3/
> > images:on.
>
> > So, as you can see, it merely takes the user to the controller/actionURL, 
> > which is not the way that I would want it.
>
> > I'm suspecting that this might actually just be because there is some
> > silly parameter that I haven't included or something. If there is
> > anyone that can help me, or at least point in the a decent direction,
> > I would really appreciate it!
>
> > Cheers,
> > Geoff
--~--~-~--~~~---~--~~
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: Converting SQL query to Cake query

2009-03-06 Thread RyOnLife


Thanks, but that doesn't address the issue. Removing the condition does not
make the Cake query match the SQL query (or a LEFT JOIN equivalent).

The normalized database has a views table that contains a record of each
individual visit to a page. I do have my Cake associations properly setup:
Page hasMany View and View belongsTo Page. I am trying to retrieve the top
10 most viewed pages, sorted by most number of views. 

I know how to do it in SQL (as pasted above), just can't figure out the
Cake.




Miles J wrote:
> 
> 
> Remove that condition, you should be using associations instead. Once
> you have an association, all related data will be returned, simply
> contain it or up the recursion.
> > 
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/Converting-SQL-query-to-Cake-query-tp2434189p2435579.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: Pagination with POST data

2009-03-06 Thread Joe Critchley

I've got a fully working version of POST pagination that is crawlable,
and fully supports HABTM relationships.

First of all, I use this component for HABTM pagination (only really
useful for multiple relationships, otherwise you would just do it
directly from the join model) - 
http://bakery.cakephp.org/articles/view/habtm-searching

Then, use this technique for converting POST data to named parameters.
http://bakery.cakephp.org/articles/view/form-posting-with-_get-parameters

To merge both of them, I had a bit of trouble with the order. You need
to explicitly state the order in the $this->paginate property,
otherwise things might start going a bit random!

Good luck sir.

On Mar 5, 3:05 pm, "marco.rizze...@gmail.com"
 wrote:
> I have seen from manual that I can pass  arguments to paginator
> functions with
>
>         $paginator->options(array('url' => .));
>
> Now with this I arguments  pass via GET.
> How can I do If I would pass arguments via POST.
> Many Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Converting SQL query to Cake query

2009-03-06 Thread Miles J

Remove that condition, you should be using associations instead. Once
you have an association, all related data will be returned, simply
contain it or up the recursion.
--~--~-~--~~~---~--~~
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: Labels around inputs

2009-03-06 Thread Miles J

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



Re: Cake performance tips

2009-03-06 Thread Miles J

1000 rows is nothing, try 100,000 rows, then that would possibly
stress test the database and models.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to use contained models in conditions?

2009-03-06 Thread Miles J

Do custom queries? You dont have to use relations.
--~--~-~--~~~---~--~~
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: routes regex

2009-03-06 Thread Alexandru Ciobanu

Alfredo Quiroga-Villamil wrote:
> Btw, I think I might have missed a digit in that regex:
>
> /\w+-\w+-\w+-\d+-\+-\d+-\w+-\w+/
>
>
>   
Thanks Alfredo.


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



Re: How to use contained models in conditions?

2009-03-06 Thread yogesh kumar
class Post extends AppModel {

var $name = 'Post';
var $hasMany=array('Comment');

function beforeSave()
{
if(!isset($this->data['Post']['id']))
{
if($this->data['Post']['url']=="")
{
$title_low=strtolower($this->data['Post']['title']);
$this->data['Post']['url']=Inflector::slug($title_low, '-');
}
}
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: $this->passedArgs breaking my Routes

2009-03-06 Thread majna

It's not working even you pass all params to paginator in view:
$paginator->options(array('url'=>array_merge(array('prefix'=>$this-
>params['prefix']),array('wap'=>true), $this->passedArgs)));
debug($paginator->options);
Bug?

I would like to see  multiple Routing.admin, like
Routing.admin
Routing.user
Routing.public..

For now cake use only one.



On Mar 6, 8:53 am, geoff  wrote:
> Hey all.
>
> I have a fairly troublesome problem that has really been grating my
> goat for the past little while. It has to do with the supplying of
> named parameters to aURL, and having them break mypagination. I have
> a feeling that the example below might explain this better:
>
> ---
>
> __Route configuration__
> Router::connect('/wap/', array('controller' => 'categories', 'action'
> => 'index', 'prefix' => 'wap'));
> Router::connect('/wap/:controller/:action/*', array('prefix' => 'wap',
> 'wap' => true));
> [ As far as I can understand, this will map /wap/users/view/4 =>
> userscontroller/wap_view/4 ]
>
> ---
>
> __Pagination__
> options(array('url' => $this->passedArgs))?>
> [ This is what I am using to set thepaginationURLoptions. ]
>
> ---
>
> Now, this works fine when I have no named parameters (e.g.URL: /wap/
> products/index/22/page:3/). However, as soon as I add in another named
> parameter - no matter what the named parameter - the URLs used in 
> thepaginationare broken; they don't seem to use the reverse routing
> anymore. This is an example of the kinds of URLs that are generated
> once another named parameter is added: /products/wap_index/22/page:3/
> images:on.
>
> So, as you can see, it merely takes the user to the controller/actionURL, 
> which is not the way that I would want it.
>
> I'm suspecting that this might actually just be because there is some
> silly parameter that I haven't included or something. If there is
> anyone that can help me, or at least point in the a decent direction,
> I would really appreciate it!
>
> Cheers,
> Geoff
--~--~-~--~~~---~--~~
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: requestAction problem with different version 1.2.0.7692 and 1.2.1.8004

2009-03-06 Thread aerozep

Hello,
thank's for the reply...
I have added "with" parameter and now all is ok in the new cake
version too.
I have read again the documentation (http://book.cakephp.org/view/78/
Associations-Linking-Models-Together ) and I have observed the use of
"with":

" with: Defines the name of the model for the join table. By default
CakePHP will auto-create a model for you. Using the example above it
would be called RecipesTag. By using this key you can override this
default name. The join table model can be used just like any "regular"
model to access the join table directly."

This is the same thing that You have said.

Thank's again,
(sorry for my bad english!)
Mattia

On 5 Mar, 18:11, Martin Westin  wrote:
> ( I'll skip the usual suggestion: to not use requestAction for this
> purpose. It has been said too often and I am sure you have read a few
> already. )
>
> That does sound strange. I can suggest only one far-fetched things to
> look into.
>
> The very unlikely thing that can mess with the models in this way is
> if the same models (or more specifically: other models named the same)
> have been loaded into the ClassRegistry before you do the request.
> This IS very rare and has only happened to me once. Using
> requestAction can probably increase the odds though.
>
> In that case the "other model" was simply Cake creating an "empty"
> joining model (based off AppModel) for an association. That model was
> then reused when I was trying to load up the "real" joining model. You
> can check if the models are there and really descendants of your
> models and not direct descendants of AppModel.
>
> Looking at your model definitions I see no "with" parameter specified.
> So if the model "Tab" is loaded, it will load an empty "RolesTab" and
> nothing you do from that oint on will even get the real RolesTab model
> up and running. You will simply re-use the empty one.
>
> Try adding:
> 'with'  => 'RolesTab',
> to both sides of the habtm.
>
> /Martin
>
> On Mar 5, 12:11 pm, "mazzon.mat...@gmail.com"
>
>  wrote:
> > Hello,
> > I have a problem with requestAction when I change cakephp version from
> > 1.2.0.7692 to 1.2.1.8004.
> > I have this relations into Models that make a hasAndBelongsToMany from
> > Roles table and Tabs table (in the join table I have 2 fileds more:
> > position and active) :
>
> > class RolesTab extends AppModel {
>
> >         var $name = 'RolesTab';
>
> >         //The Associations below have been created with all possible keys,
> > those that are not needed can be removed
> >         var $belongsTo = array(
> >                         'Role' => array('className' => 'Role',
> >                                                                 
> > 'foreignKey' => 'role_id',
> >                                                                 
> > 'conditions' => '',
> >                                                                 'fields' => 
> > '',
> >                                                                 'order' => 
> > ''
> >                         ),
> >                         'Tab' => array('className' => 'Tab',
> >                                                                 
> > 'foreignKey' => 'tab_id',
> >                                                                 
> > 'conditions' => '',
> >                                                                 'fields' => 
> > '',
> >                                                                 'order' => 
> > ''
> >                         )
> >         );
>
> > }
>
> > class Role extends AppModel {
>
> >         var $name = 'Role';
>
> >         //The Associations below have been created with all possible keys,
> > those that are not needed can be removed
>
> >         var $hasAndBelongsToMany = array(
> >                         'Tab' => array('className' => 'Tab',
> >                                                 'joinTable' => 'roles_tabs',
> >                                                 'foreignKey' => 'role_id',
> >                                                 'associationForeignKey' => 
> > 'tab_id',
> >                                                 'unique' => true,
> >                                                 'conditions' => '',
> >                                                 'fields' => '',
> >                                                 'order' => '',
> >                                                 'limit' => '',
> >                                                 'offset' => '',
> >                                                 'finderQuery' => '',
> >                                                 'deleteQuery' => '',
> >                                                 'insertQuery' => ''
> >                         )
> >         );
>
> > }
>
> > class Tab extends AppModel {
>
> >         var $name = 'Tab';
>
> >         var $hasAndBelongsToMany = array(
> >                         'Role' => array('className' => 'Role',
> >                                              

Re: Pagination with POST data

2009-03-06 Thread byqsri

Apology accepted.
I use the grid component with the filter plugin.


On Mar 6, 10:12 am, Son Dat Giang  wrote:
> Oh, yes. I'm sorry if you don't like the way I show my opinion. I have never
> heard about ext js before.
> I've visited some ext js demo, hmmm... It's realy valueable.
>
> But, i don't know how to switch cake pagination method from GET to POST.
> What situation of extjs are  you using ?
>
> Is there any cakephpers know the code block to change pagination request
> from URL to POST method???
> -
> Best regards !
> Giang Son Dat
> Mobile: +84 988114164
> Email giangson...@gmail.com, giangson...@yahoo.com
>
> On Fri, Mar 6, 2009 at 12:27 AM, byqsri  wrote:
>
> > Thanks for your "kind" response.
> > I think that make search with POST it's not so stupid Infact I have a
> > element with EXT js (i think that also Ext js developer team don't
> > need to be stupid) that make search with POST of data.
> > I hope that if there is the possibility to pass data to pagination
> > with POST I can save time.
>
> > On Mar 6, 4:06 am, Son Dat Giang  wrote:
> > > I dunno why you want to pass pagination data via POST. POST is not good
> > for
> > > searching and paginating. Because your result-page can not keep the
> > content
> > > by URL of itself.
> > > So, I think, cakePHP developer team did not support pagination via POST.
> > > They don't need to be stupid.
>
> > > Am I right?
> > > -
> > > Best regards !
> > > Giang Son Dat
> > > Mobile: +84 988114164
> > > Email giangson...@gmail.com, giangson...@yahoo.com
>
> > > On Thu, Mar 5, 2009 at 7:05 AM, marco.rizze...@gmail.com <
>
> > > marco.rizze...@gmail.com> wrote:
>
> > > > I have seen from manual that I can pass  arguments to paginator
> > > > functions with
>
> > > >        $paginator->options(array('url' => .));
>
> > > > Now with this I arguments  pass via GET.
> > > > How can I do If I would pass arguments via POST.
> > > > Many Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake performance tips

2009-03-06 Thread LunarDraco

I would start a simple test with two different database.
one very small with at least one but no more than 5 records per table.

Then do another test with a database with at least 1000 records in the
tables that you would expect to grow.
If your code is setup correctly with view pagination etc. the time
between these two scenarios should change very little.

If you see a huge delay difference with the 1000 record database, then
you definitely have some bind or containable work to do.

If both scenarios are slow, your going to have to look a little deeper
at your code. As an example I had a wicked loop in my Auth and Menu
system which generated 250+ querys for something that should have only
been 13. Add to that a lazy find on my groups table which was bound to
my Users via a HABTM mapping netting more than a few thousand users
being pulled in for every cycle in this loop.

I guess my point is cake is very flexible. Flexible enough to let you
dig yourself a pretty deep hole. The DebugKit and FireCake has proven
to be a priceless set of tools for debugging (mainly because their
free) and they are very will put together, great examples of how to
write plugins. I would add a couple log statments in your
app_controller beforeFilter. spit out the controller and action that
is being called. This will show you a nice trace of what your app is
doing. I find this a good practice to run every once in a while. If
you want a real test write down on paper what you think the trace of
your app should look like for say logging in. Then log in and compare
I'm going to bet there some stuff happening that you wouldn't expect.


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



Re: How to use contained models in conditions?

2009-03-06 Thread laeffe

I guess that your best chance is to switch the direction that you talk
with your models.


On Mar 6, 7:26 am, Braindead  wrote:
> Miles, that's bad news. But how can I solve my problem? Is there any
> workaround?
--~--~-~--~~~---~--~~
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 validation without model

2009-03-06 Thread rich...@home

How to do validation without a database table:

You still need a model. For a concrete example, check out Snook's
CakePHP contact form: http://snook.ca/archives/cakephp/contact_form_cakephp/

Where to put common controller functions? Create a component.

Hope this helps

On Mar 5, 11:00 pm, D4rko  wrote:
> Hi!
>
> I have a form that submits it's data to a controller, which then
> processes it (possibly in some complicated way) and saves it to a
> database. Or even doesn't save it, just uses it to render view. The
> point is that there is no direct relation between form fields and
> database tables. How do I validate such form, while still having the
> benefits of form helpers mentioned in tutorials (automatic toggling of
> error messages, repopulating the fields with entered data). One idea I
> have is to create the model with empty useTable var, and use it to
> validate the form - but that's not entirely intuitive to me. Is it
> okay (and "the MVC way") to do so, create such model for every form I
> want to validate, or is there some other, preferred solution?
>
> The other question is - there is a function that I want to be
> accessible by two controllers (but not necessarily by every function
> in the whole application, global variables and functions doesn't sound
> too OOP). Where do I put it to make it 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: Form validation without model

2009-03-06 Thread Braindead

Yes, it is possible to use validation without a table. Simply define
$useTable = false in your model and define the validation rules as if
there was a table. You can then use cakes form helper without any
problems.

This is how you can force validation in your controller (part of my
contact page):

if (!empty($this->data)) {
$this->Contact->set($this->data);
if($this->Contact->validates()) {
//do something
}
} else {
$errors = $this->Contact->invalidFields();
$this->render();
}


Hope that helps,
Markus
--~--~-~--~~~---~--~~
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 ajax helper to reload an element

2009-03-06 Thread byqsri

I have similar problem.
I have an element inside a view and I would on a click of a button
that the element would be reloaded with same params of first render.
Can someone suggest me some solution?


On Feb 28, 6:49 am, Corey Crawford  wrote:
> OK, finally getting a chance to look at this again. The biggest
> problem I'm having is passing variable information to theelement, so
> that it can reduce the scope of what's returned and filter based on a
> drop down selection.
>
> Here's some code snippets:
>
> http://bin.cakephp.org/view/168041585
>
> Basically, I've gotten it to call theelementfrom within a 'refresh'
> view, called by the controller. However, Firebug shows *no* data being
> sent in theAJAXPOST, so I can't seem to get the data for the formelementthat 
> changed. The debug log shows no data for $this->data when
> logged from the controller (homes).
>
> The CDATA for theAJAXobserver seems to be setup right:
> //
>
> I tried wrapping it in a FORM tag but that didn't help. Any ideas what
> might be going on here?
>
> Thanks :)
>
>  - Corey Crawford
>
> On Feb 11, 9:25 am, WebbedIT  wrote:
>
> > As this is anAJAXrequest you are interfacing with the DOM and as
> > such it does not matter whether theelementto be updated was built
> > with a view orelement.  As long as you have the link/observer calling
> > a new instance ofajax.updater and have set it to update the required 
> > elementid then all should be happy.  Your refreshSearchElement action
> > needs a /home/refresh_search_element.ctp view and if you are using the
> > RequestHandler component  Cake should do all the rest for you.
>
> > Have you got FireBug installed? If so what POST and Response data does
> > it show for theajaxrequest?
>
> On Feb 11, 10:32 am, brian  wrote:
>
> > Sorry, I forgot something, actually
>
> > $this->layout = false;
> > $this->set('new_param', $new_param);
>
> > $this->viewPath = 'elements';
>
> > /*
> > OR:
> > $this->viewPath = 'elements'.DS.'some_other_dir';
> > */
>
> > $this->render('search_element_1');
>
> > This will force Cake to use only theelementto render the view.
--~--~-~--~~~---~--~~
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: Pagination with POST data

2009-03-06 Thread Son Dat Giang
Oh, yes. I'm sorry if you don't like the way I show my opinion. I have never
heard about ext js before.
I've visited some ext js demo, hmmm... It's realy valueable.

But, i don't know how to switch cake pagination method from GET to POST.
What situation of extjs are  you using ?

Is there any cakephpers know the code block to change pagination request
from URL to POST method???
-
Best regards !
Giang Son Dat
Mobile: +84 988114164
Email giangson...@gmail.com, giangson...@yahoo.com


On Fri, Mar 6, 2009 at 12:27 AM, byqsri  wrote:

>
> Thanks for your "kind" response.
> I think that make search with POST it's not so stupid Infact I have a
> element with EXT js (i think that also Ext js developer team don't
> need to be stupid) that make search with POST of data.
> I hope that if there is the possibility to pass data to pagination
> with POST I can save time.
>
>
>
> On Mar 6, 4:06 am, Son Dat Giang  wrote:
> > I dunno why you want to pass pagination data via POST. POST is not good
> for
> > searching and paginating. Because your result-page can not keep the
> content
> > by URL of itself.
> > So, I think, cakePHP developer team did not support pagination via POST.
> > They don't need to be stupid.
> >
> > Am I right?
> > -
> > Best regards !
> > Giang Son Dat
> > Mobile: +84 988114164
> > Email giangson...@gmail.com, giangson...@yahoo.com
> >
> > On Thu, Mar 5, 2009 at 7:05 AM, marco.rizze...@gmail.com <
> >
> > marco.rizze...@gmail.com> wrote:
> >
> > > I have seen from manual that I can pass  arguments to paginator
> > > functions with
> >
> > >$paginator->options(array('url' => .));
> >
> > > Now with this I arguments  pass via GET.
> > > How can I do If I would pass arguments via POST.
> > > Many Thanks
> >
>

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



Re: link problem

2009-03-06 Thread mscdex

On Mar 6, 1:40 am, kaushik  wrote:
> I want to create a link like this:
>
>  
Try:
link(' ', "../", array('alt'=>'Home', 'escape'
=> false)) ?>
--~--~-~--~~~---~--~~
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: Pagination with POST data

2009-03-06 Thread byqsri

Thanks for your "kind" response.
I think that make search with POST it's not so stupid Infact I have a
element with EXT js (i think that also Ext js developer team don't
need to be stupid) that make search with POST of data.
I hope that if there is the possibility to pass data to pagination
with POST I can save time.



On Mar 6, 4:06 am, Son Dat Giang  wrote:
> I dunno why you want to pass pagination data via POST. POST is not good for
> searching and paginating. Because your result-page can not keep the content
> by URL of itself.
> So, I think, cakePHP developer team did not support pagination via POST.
> They don't need to be stupid.
>
> Am I right?
> -
> Best regards !
> Giang Son Dat
> Mobile: +84 988114164
> Email giangson...@gmail.com, giangson...@yahoo.com
>
> On Thu, Mar 5, 2009 at 7:05 AM, marco.rizze...@gmail.com <
>
> marco.rizze...@gmail.com> wrote:
>
> > I have seen from manual that I can pass  arguments to paginator
> > functions with
>
> >        $paginator->options(array('url' => .));
>
> > Now with this I arguments  pass via GET.
> > How can I do If I would pass arguments via POST.
> > Many Thanks
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Labels around inputs

2009-03-06 Thread Braindead

I haven't tried it, but maybe this can help:
http://bakery.cakephp.org/articles/view/overriding-specific-html-tags-before-using-helper-methods


--~--~-~--~~~---~--~~
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: Captcha reload problem, works in ff not in IE

2009-03-06 Thread iraj23


tnx Smelly Eddie
i must tell again i am not the site administrator and just a visitor of some
sites that used the captcha and i need for those sites see SAME captcha
image on every load 

tnx again
-- 
View this message in context: 
http://www.nabble.com/Captcha-reload-problem%2C-works-in-ff-not-in-IE-tp17855131p22367896.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
-~--~~~~--~~--~--~---