Re: How to call a function from a different controller

2013-03-05 Thread Jonathan Sundquist
Move the send message to the AppController.
On Mar 5, 2013 8:50 PM,  wrote:

> Hi, I'll explain the context of my problem:
>
> In my project there are companies and students, companies publish job
> opportunities and students can apply for these.
> Both companies and students inherit features from users object. So, you
> have users, companies and students.
>
> In my users controller I manage things related to users: auth, send
> messages between users, send email notifications, etc.
>
> My problem is:
>
> When a student apply to a job opportunity, the app should register its
> apply and send a message (which is managed by users controller)
>
> Basically I have this:
>
> class Users extends AppController{
> ...
> function sendMessage(){
> //data is recieved by post method
> }
> }
>
> class Opportunity extends AppController{
>...
>function registerApply(){
>//Here I should call the sendMessage() function with data
>}
> }
>
> I've readed some ideas to do this, but I don't understand how to call an
> external function and send POST data.
>
> Thanks for your help.
>
>
>
>
>
>
>
>
>
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Calling functions in other controllers

2013-02-27 Thread Jonathan Sundquist
I might also suggest not using get by itself.  You should use meaningful
action names.  Like getCart or getData.


On Wed, Feb 27, 2013 at 7:03 AM,  wrote:

>
> On Wednesday, February 27, 2013 2:55:53 AM UTC+2, lirc201 wrote:
>>
>> I'm in 2 different controllers.  In the checkout controller, I'm trying
>> to call a function in the cart controller.
>>
>> Are you sure that the function is in the cart controller?  The $uses
> variable indicates which other models this model will use (not which other
> controllers).  If you want to call a method on another controller you will
> need to use either App::Import or RequestAction.  If the error you are
> getting is an SQL error rather than a method not found error it would seem
> like the get() method is on the model.
>
> In general, many people will tell you that calling one controller from
> another is a bad idea and should only be done as a last resort.
>
> If it is true that you are managing to call a controller method then it
> may be simpler to move these methods into the Cart model which you would
> then be able to access from the $uses variable.
>
> If the methods are really on the model (or if you choose to move them
> there) you will need to be acting on a particular instance of Cart so you
> would do something like:
> $this->Cart->id = $CartID; // assumes you already have the id of the cart
> you want
> $Cart = $this->Cart->get(); // assumes that the only state information
> that get needs is the id and will read any additional information for itself
>
> Alternatively, you may need to find the cart you are looking for and pass
> that information into the get call.  I.e.
> $Cart = $this->Cart->find('first', array('conditions' =>
> array('Cart.customer_id' => $CustomerID)));
> $Total = $this->Cart->total($Cart);
>
> As a side note:
> One debugging method you could use when confronted with this type of
> situation is to copy and paste the query that generated the error directly
> into something like PhpMyAdmin and see what part of the query is causing
> the SQL error.  My guess is that in your case the query has a where clause
> with 'WHERE Cart.id=' with no id specified or something like that.
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Calling functions in other controllers

2013-02-26 Thread Jonathan Sundquist
If you are in the function trying to call another function just do
$this->get() not $this->cart->get()
On Feb 26, 2013 6:32 PM, "lirc201"  wrote:

> I'm still working in cake 1.3.15 (going to upgrade soon) but running into
> an issue.  I'm setting up a shopping cart so I have functions in my
> cart_controller like
>
> Cart get()
> Cart total()
>
> When I attempt to call these functions in my checkout_controller ...
>
> var $uses = ('Cart',,,);
>
> function index() {
>   $cart = $this->Cart->get();
>   $total = $this->Cart->total();
>
> When checking out I get an SQL error about incorrect mysql syntax ...
> check the manual ...  the next line reads "Query: get".  If I pull the
> "get" code into the checkout_controller it runs as expected.
>
> What I'm I missing?
>
> Thanks,
> Brian
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: What happeened to the API Documentation on CakePHP.org?

2013-02-26 Thread Jonathan Sundquist
You mean this api? http://api.cakephp.org/1.3/


On Tue, Feb 26, 2013 at 12:26 PM, kdubya  wrote:

> I can't find the classes anymore. I was specifically looking for the
> Debugger class in 1.3. The structure that used to be there until recently
> is gone. What happened? Did I miss something?
>
> Ken
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Link to PDF? Yikes!

2013-02-20 Thread Jonathan Sundquist
Either create a route so that cake knows how to get to that folder or best
option would be to move the files folder under webroot.


On Wed, Feb 20, 2013 at 8:05 AM, April DeRossett
wrote:

> I have read, and read, but I can not figure this out.  I am hoping someone
> will point me in the right direction.  I have .pdf resources in
> app/files/id#/../..  To which I need to link.  How do I do this?  I keep
> getting a missing controller. "Files". Isn't there a way to link without
> controller and model?
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Struggling with first cake development.

2013-02-13 Thread Jonathan Sundquist
While Yvon makes some good observations what you actually set your
variables to that are passed to the view are your choice. Name them as you
wish.  He did hit the nail on the head though when it comes to your
validation rules.  just like your table columns everything should be
lowercase.

I would agree as well in order to help depict where the error is it would
be helpful to see the form as well.  Was your model, controller, and views
created using the cake bake included

Hello Thomas...

Im sort of very new with Cakephp and I'm using/learning v2.3..

I'm not good enough (yet) to know exactly what is wrong, but it seems you
didn't follow naming "conventions"...  And as I understood, for the magic
to happen, it needs to be consistent..



CategoriesController.php
>  class CategoriesController extends AppController {
> public $helpers = array('Html', 'Form');
> public $components = array('Session');
>
>  public function index() {
>  $this->set('Categories', $this->Category->find('all'));  *//
> Here, it should be 'categories' (no capital C)*
> }
>  public function view($id = null) {
> if (!$id) {
> throw new NotFoundException(__('Invalid category'));
> }
> $CatRec = $this->Category->findById($id)**;  *// $categorie =
> $this..*
> if (!$CatRec) { *// !$categorie*
> throw new NotFoundException(__('Invalid category'));
> }
> $this->set('Categories', $CatRec);  *// $this->set('categorie',
> $categorie);*
> }
>  public function add() {
> if ($this->request->is('post')) {
>  $this->Category->create();
>  if ($this->Category->validates()) {  *// I think the
> validates will be done by itself on the save, you dont need to add it here.
> (Im not sure though)*
>
>  if ($this->Category->save($this->**request->data)) {
> $this->Session->setFlash('Your Category has been saved.');
>   //  $this->redirect(array('action' => 'index'));
> } else {
> $this->Session->setFlash('**Unable to add your
> Category.');
> }
> }else {
> $this->Session->setFlash('**Unable to validate.');
> }
>
> }
> }
> }
>
> Category.php
>
>  class Category extends AppModel {
> public $validate = array(
> 'Name' => array('rule' => 'notEmpty'), *// 'name' => 'notEmpty',*
> 'Description' => array('rule' => 'notEmpty'), *// 'description'
> => 'notEmpty',*
> 'Type' => array('rule' => 'notEmpty')  *// 'type' => 'notEmpty'
> no Capitals, no new array*
> );
> }
>
> any help appreciated
>
> Thomas
>
>
>

and seeing your add.ctp would help also if all those changes dont work.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: combine 2 tables to order by date (different fieldnames)

2013-02-07 Thread Jonathan Sundquist
I don't know of a cakephp way off the top of my head but on the database
side the best way would be using either a view table or a stored procedure.


On Thu, Feb 7, 2013 at 10:41 AM, Mathias R  wrote:

> Hi,
>
> i have 2 tables (i.e. incoming_messages and outgoing_messages). saving
> data in one table isn't possible.
> now i want to select all entries from both tables, for getting a working
> pagination, and order it by date. But each table has a different name for
> date-fields, but same format.
>
> changing table-structure is not possible.
>
> is there a way to combine this tables within a request and how?
>
> Greetings
> M.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Best IDE for CakePHP 2.1

2013-02-03 Thread Jonathan Sundquist
Best IDE - phpstorm

Best text editor - notepad++ (windows) or sublime text (mac)
On Feb 3, 2013 9:53 PM, "Sun Zheng"  wrote:

> Try Sublime Text 2. Loving it.
>
> On Thursday, April 12, 2012 1:23:46 PM UTC+8, Reza Talamkhani wrote:
>>
>> Hi,
>> I Need an IDE for CakePHP 2.1 that integerated with cake console and
>> suggestion...
>> I test eclipse, netbeans & Codelobster but it did not meet any...
>>
>> Please help me to choose the best IDE.
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: sql statement Cake 1.3 uses to add data

2013-02-02 Thread Jonathan Sundquist
Alright after a bit more research, with debug level set at 2 run this after
your query.

$log = $this->b->a->getDataSource()->log(false,false);
debug($log);

Reference for the above is coming from here:
http://stackoverflow.com/questions/3647065/how-can-i-see-cakephps-sql-dump-in-the-controller


On Sat, Feb 2, 2013 at 1:03 PM, Anja Liebermann wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hi Jonathan,
>
> debug 2 ( or also 3) only shows me the SELECT statements, but not the
> INSERT statements.
>
>
> Calamity Jane
>
>
> Am 02.02.2013 20:01, schrieb Jonathan Sundquist:
> > You should be able to set debug level to 2 and see all statement types.
> > On Feb 2, 2013 12:58 PM, "Anja Liebermann" 
> wrote:
> >
> > Hello everybody,
> >
> > I need help to find out why my model isn't saving. I use version 1.3.14
> > and develop with Cake since some years but at this moment I am
> > completely stuck. Duh...
> >
> > I have Model A which hasOne Model B. B belongsTo A.
> >
> > In controller B I try to move data from B to A by calling after some
> > transformations
> > $this->B->A->save($this->data).
> > That worked fine until I did some changes to my code and now I am stuck
> > with a boolean false for this saving attempt. The data also really isn't
> > saved to my table. But why?
> > $this->data contains of course an array with ['A'] and all the data
> > which should go to A.
> >
> > I already disabled any beforeSave and validation rules, but still no
> save.
> >
> > My question: How can I see with which sql statement Cake tries to add
> > the data to my table? All I found is ways to see the select statements,
> > but none for inset / update statements.
> >
> > Any hints on that would be appreciated  and  of course hints for other
> > things I can try to find the source of my error, too!
> >
> > Hope I listed all information needed.
> >
> >
> > Calamity Jane
> >>
> >> --
> >> Like Us on FaceBook https://www.facebook.com/CakePHP
> >> Find us on Twitter http://twitter.com/CakePHP
> >>
> >> ---
> >> You received this message because you are subscribed to the Google
> Groups
> >> "CakePHP" group.
> >> To unsubscribe from this group and stop receiving emails from it, send
> an
> >> email to cake-php+unsubscr...@googlegroups.com.
> >> To post to this group, send email to cake-php@googlegroups.com.
> >> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> >> For more options, visit https://groups.google.com/groups/opt_out.
> >>
> >>
> >>
> >
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.11 (GNU/Linux)
>
> iEUEARECAAYFAlENYvgACgkQbOdiIJzHNKHRWgCZAbB9ij3e2OQ+E5y9cYjzjjpD
> xzkAliwuayu+uVNC+kDZEvKoQ3kuNkk=
> =C0dq
> -END PGP SIGNATURE-
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: sql statement Cake 1.3 uses to add data

2013-02-02 Thread Jonathan Sundquist
You should be able to set debug level to 2 and see all statement types.
On Feb 2, 2013 12:58 PM, "Anja Liebermann"  wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hello everybody,
>
> I need help to find out why my model isn't saving. I use version 1.3.14
> and develop with Cake since some years but at this moment I am
> completely stuck. Duh...
>
> I have Model A which hasOne Model B. B belongsTo A.
>
> In controller B I try to move data from B to A by calling after some
> transformations
> $this->B->A->save($this->data).
> That worked fine until I did some changes to my code and now I am stuck
> with a boolean false for this saving attempt. The data also really isn't
> saved to my table. But why?
> $this->data contains of course an array with ['A'] and all the data
> which should go to A.
>
> I already disabled any beforeSave and validation rules, but still no save.
>
> My question: How can I see with which sql statement Cake tries to add
> the data to my table? All I found is ways to see the select statements,
> but none for inset / update statements.
>
> Any hints on that would be appreciated  and  of course hints for other
> things I can try to find the source of my error, too!
>
> Hope I listed all information needed.
>
>
> Calamity Jane
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.11 (GNU/Linux)
>
> iEYEARECAAYFAlENYdMACgkQbOdiIJzHNKEZhwCgoRHVvmXMkTH1GGA0CGgbR+0g
> 4roAn2skGuzD0mvTqheku5NQPuYxP2T0
> =D1YS
> -END PGP SIGNATURE-
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: rewrite URL with .htacces

2013-01-27 Thread Jonathan Sundquist
You actually would not use .htaccess, you should continue to use cakephp
and use the routing feature built in.  Take a look at
http://book.cakephp.org/2.0/en/development/routing.html to get a better
idea.



On Sun, Jan 27, 2013 at 8:07 PM, Mogpusse  wrote:

> Hi i need help
>
> i have this url
>
> http://b2c.tla/articles/darticle/2  il want to rewrite I will wish to
> rewrite the url for a url like http://b2c.tla/nom-produit-2.html
>
> i use cakephp 2.1 please i need help
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Missing Database Connection

2013-01-26 Thread Jonathan Sundquist
Which godaddy server are you trying to upload your site to?


On Thu, Jan 24, 2013 at 4:19 AM, Ram_Cakephp  wrote:

> Hi,  I am getting the following error. I uploaded the application in
> godaddy server.
> solution please.
>
>
> Missing Database Connection
>
> *Error: *Mysql requires a database connection
>
> *Error: *Mysql driver is NOT enabled
>
> *Notice: *If you want to customize this error message, create
> app\View\Errors\missing_connection.ctp.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Format my XML output in CakePHP

2013-01-23 Thread Jonathan Sundquist
Change your set array to be players instead of output.
On Jan 23, 2013 6:01 PM, "Mariano C."  wrote:

> I have the players table with three field id, first_name, last_name. The
> PlayersController have method index that show every player in the table:
>
> public function index() {
> $output = $this->Player->find('all');
> $this->set(array(
> 'output' => $output,
> '_serialize' => array('output')
> ));
> $this->render('generic_response');
> }
>
> and the generic_response is an XML view that look like this:
>
>  $xml = Xml::fromArray(array('response' => $output));
> echo $xml->asXML();
>
> The resulting XML is:
>
> 
>   
>  
>2
>Ciro
>Spee
>  
>
>
>  
>3
>Ugo
>Ridi
>  
>
>
> but I want something like:
>
> 
>   
>  
>2
>Ciro
>Spee
>  
>  
>3
>Ugo
>Ridi
>  
>
>
> How can I do this?
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: How can I override a CakePHP plugin in application?

2013-01-21 Thread Jonathan Sundquist
Can you give us a little bit more information. What are you trying to
override a controller or model?


On Mon, Jan 21, 2013 at 7:36 AM, Cséfalvay Kálmán <
csefalvay.kal...@gmail.com> wrote:

> I see that overriding of a view is very simple (
> http://book.cakephp.org/2.0/en/plugins.html#overriding-plugin-views-from-inside-your-application),
> but how can I override a controller or a model?
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Best way to get Twitter bootstrap working!

2013-01-17 Thread Jonathan Sundquist
Check this out.
https://groups.google.com/forum/?fromgroups=#!topic/cake-php/e11EAkB3WaA


On Thu, Jan 17, 2013 at 10:45 AM, Josh  wrote:

> Hi everyone i'm searching to find the best way to get Bootstrap working
> fine in cakephp?
> Thanks.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: PHPUnit_Util_Skeleton_Test not found in CakePHP

2013-01-16 Thread Jonathan Sundquist
Looks like you got your answer.

http://stackoverflow.com/questions/14348318/phpunit-util-skeleton-test-not-found-in-cakephp


On Tue, Jan 15, 2013 at 9:34 PM, Mathew  wrote:

> I'm able to run my individual tests for each model in a plugin called Agg,
> but when I try to run a CakeTestSuite, then I get an error.
>
> class ModelsTest extends CakeTestSuite
> {
> public static function suite()
>  {
> $suite = new CakeTestSuite('All model tests');
> $suite->addTestDirectory(TESTS . 'Case' . DS . 'Model');
>  return $suite;
> }
> }
>
> Running that suite generates this error.
>
> > Fatal error: Class 'PHPUnit_Util_Skeleton_Test' not found in
> C:\work\zend\cake\Cake\TestSuite\CakeTestSuiteCommand.php on line 77
>
> I'm using PHP 5.3.15 and have PHPUnit 3.7.12 installed with CakePHP 2.2.5
>
> I get this error when running tests both via the web and the CLI.
>
>
> If I search for 'PHPUnit_Util_Skeleton_Test' in PEAR folder for PHPUnit
> it's not found. This seems strange to me. Am I using the wrong version of
> PHPUnit? When was this class introduced?
>
> It seems that this class is no longer used in PHPUnit 3.7.x, and I'm
> wondering if CakePHP 2.2 will only work with PHPUnit 3.6. I tried to
> uninstall the pear package, and then install the 3.6.x version but always
> installs the newest version. Any ideas on how to downgrade PHPUnit?
>
> Downgrading using the --force to install older versions of PHPUnit didn't
> resolve the problem. I tried 3.6.12, 3.6.5 and 3.5. With the 3.6.12 I got
> an error with is_file() somewhere in the PHPUnit code.
>
> Any help would be appreciated.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Cake PHP doesn't work on Mac but on Windows

2013-01-10 Thread Jonathan Sundquist
What are your error logs telling you?  There could be a number of issues
causing the problem.


On Thu, Jan 10, 2013 at 7:29 AM, Theresia Z  wrote:

> I have a big problem with Cakephp. We installed it and built an
> application on windows, everything worked fine. Then I installed Cakephp on
> two other windows-computers and copy-pasted the app-Data, it worked. Now I
> tried the same thing on Mac and it wont work.
>
> The CakePHP installation works, the connection to the database is there
> and on the cakephp-indexsite there are no errors. But as soon as I try to
> open our application, I always get a 404-Error. The Code is exactly the
> same like on my windows-pc and I don't understand why it wont work.
>
> On Windows, we are using XAMPP, on Mac, MAMPP. Might this be a problem?
>
> I hope you can help us with that.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Custom column in association

2013-01-04 Thread Jonathan Sundquist
Create your table structure first and then run through cake bake to have it
create your models for you. It should be fairly straight forward.  I would
also suggest removing the id field from matches_teams.


On Fri, Jan 4, 2013 at 9:39 AM, marcus33cz  wrote:

> Thanx a lot jsundquist!
>
> I guess it makes sense but the assotiation is getting pretty complicated.
> :)
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Custom column in association

2013-01-04 Thread Jonathan Sundquist
What you are asking for is possible but I would suggest rethinking how you
have your tables laid out and also consider how your data should relate to
each other.  The original meaning of a HABTM table (matches_teams) is meant
to be only a joining table. It should really contain only match_id and
team_id. From what I can gather from your email is teams can play multiple
matches, matches have many teams.  However that said match has a score.
 Personally I would place the score in its own table and possibly relate
the score table to a match and also relate it to a team.  Similar to the
below.

Scores
 - id
 - match_id
 - team_id
 - score


On Fri, Jan 4, 2013 at 9:21 AM, marcus33cz  wrote:

> Hiya,
>
> I'm wondering if this is possible - imagine you have these tables:
>
> *teams **(id, name)*
> *matches **(id, date_started, created, modified)*
> *matches_teams **(id, match_id, team_id)*
> *
> *
> Every team can participate in many matches (e.g. on monday Detroit vs
> L.A., on wednesday Detroit vs Boston, on saturday Boston vs Tampa Bay)...
>
> Can I somehow add more details to the association? I'd like to save how
> many goals the team scored. So for example Detroit scored 5 goals on monday
> and 1 goal on wednesday.
>
> I believe the best place to store this would be the *matches_teams *table
> where you would create another column called *score*.
>
> *But do you make sure that this works automagically? How can you set the
> value of goals in forms (and somehow bind it to the model)?*
> *
> *
> *Thanks a lot. :-) *
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: 2.2.4 or 2.3.0

2013-01-03 Thread Jonathan Sundquist
Go with 2.2.4 as its still the current stable release.  2.3.0 is still only
a release candidate and will have multiple updates come out down the line.


On Thu, Jan 3, 2013 at 9:42 AM, Anis Ghabri  wrote:

> Hi,
>
> I guess it's clear for my next project starting NOW Should I use the 2.2.4
> version of the 2.3.0 version of CakePHP.
>
> regards
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Not able to view anything on the page

2012-12-29 Thread Jonathan Sundquist
In order to see the blog controller pages you need to go to /blog
On Dec 29, 2012 7:03 PM, "Harish Geeth"  wrote:

> Hi,
>
> I am new to cakePHP and downloaded the framework and started playing with
> it. I am using NetBeans to edit PHP files. I am able to cinfigure the
> CakePHP as expected. I get successful messages when I try to hit the
> webserver. But for some reason when I try to run the application after
> adding Model and Controller, I don't see the results as exected.
>
>
> 
>
>
> Folder structure is
>
>
> 
>
> *CONTROLLER*
>
> 
> /*
>  * To change this template, choose Tools | Templates
>  * and open the template in the editor.
>  */
>
> /**
>  * Description of blog_controller
>  *
>  * @author harishupadhyayula
>  */
> class BlogsController extends AppController {
>
> var $name = 'Blog';
> var $uses = array('Blog');
>
>
> var $scaffold;
> }
>
> ?>
>
> *MODEL*
>
> 
> /*
>  * To change this template, choose Tools | Templates
>  * and open the template in the editor.
>  */
>
> /**
>  * Description of blog
>  *
>  * @author harishupadhyayula
>  */
> class Blog extends AppModel {
> var $name = 'Blog';
> }
>
> ?>
> I modified my dabase.php files as well. I am not sure where it's going
> wrong and I tried all day to figure this out but i had not luck.
>
> Any help is appreciated.
>
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Help please with "Guestflo" widget

2012-12-28 Thread Jonathan Sundquist
This really isn't a cakephp problem.  Someone built a cms on top of cakephp
and you are relaying heavily on that.  In order to add this new, from what
I can understand from the initial post, static widget you will need to
modify one of the view files.  This doesn't sound like some thing you will
be able to accomplish via the admin panel. If you would like help walking
you through what is required feel free to email me directly and I will try
to help you out.


On Fri, Dec 28, 2012 at 8:57 AM, mrfugimoto  wrote:

> Hi @jsundquist, it's cake version 1.3"Old". I have read through
> everything I think there is in the cookbooks. It seems not even the
> developers of cakePHP know how to get the widget to work. It's not a knock
> against the developers. I just don't see any references to adding scripts
> in their documentation. Not even on the google groups.
>
> Any idea if the newest version supports embedding scripts?
>
> Thank you for your help.
>
>
> On Friday, December 28, 2012 9:15:25 AM UTC-5, jsundquist wrote:
>
>> So your pasting html into a tinymxe editor which Will convert a < into
>> < and a > >.
>>
>> If you are trying to add this static widget to the events page you Will
>> need to modify the ctp file within the /app/views/events directory.
>> Possibly an index.ctp file.
>>
>> I would suggest checking out the docs for cakephp at docs.cakephp.org.
>> also in order to figure out which version of cakephp you are using check
>> out the /cake directory. If you view any file in there it should give you
>> an idea as to the version.
>> On Dec 28, 2012 6:35 AM, "mrfugimoto"  wrote:
>>
>>> Hi @jsundquist.
>>>
>>> This is my root>app>views folder contents
>>>
>>> C:\xampp\htdocs\divinghorse\**app\views
>>> C:\xampp\htdocs\divinghorse\**app\views\administrators
>>> C:\xampp\htdocs\divinghorse\**app\views\categories
>>> C:\xampp\htdocs\divinghorse\**app\views\elements
>>> C:\xampp\htdocs\divinghorse\**app\views\errors
>>> C:\xampp\htdocs\divinghorse\**app\views\events
>>> C:\xampp\htdocs\divinghorse\**app\views\galleries
>>> C:\xampp\htdocs\divinghorse\**app\views\helpers
>>> C:\xampp\htdocs\divinghorse\**app\views\images
>>> C:\xampp\htdocs\divinghorse\**app\views\layouts
>>> C:\xampp\htdocs\divinghorse\**app\views\layouts\js
>>> C:\xampp\htdocs\divinghorse\**app\views\layouts\rss
>>> C:\xampp\htdocs\divinghorse\**app\views\layouts\xml
>>> C:\xampp\htdocs\divinghorse\**app\views\news
>>> C:\xampp\htdocs\divinghorse\**app\views\newsdetail
>>> C:\xampp\htdocs\divinghorse\**app\views\ourevents
>>> C:\xampp\htdocs\divinghorse\**app\views\ourgalleries
>>> C:\xampp\htdocs\divinghorse\**app\views\pagecontent
>>> C:\xampp\htdocs\divinghorse\**app\views\pages
>>> C:\xampp\htdocs\divinghorse\**app\views\scaffolds
>>>
>>> This is the admin panel online from panel login view thru setting up a
>>> new event and what it looks like on the web.
>>>
>>> Admin Panel
>>> http://i366.photobucket.com/**albums/oo101/johnnypiepics/1-**
>>> adminhome_zps366ca5cb.jpg
>>>
>>> Add New Event
>>> http://i366.photobucket.com/**albums/oo101/johnnypiepics/2-**
>>> addevent_zpsa7092e1d.jpg
>>>
>>> Event Added in HTML editor mode.Then saved
>>> http://i366.photobucket.com/**albums/oo101/johnnypiepics/3-**
>>> eventadded_saved_zps985dadb3.**jpg
>>>
>>> Event view on web page, the guestflo widget script and stripped
>>> http://i366.photobucket.com/**albums/oo101/johnnypiepics/4-**
>>> pageresult_zpscd55c45a.jpg
>>>
>>> On Thursday, December 27, 2012 8:48:55 PM UTC-5, jsundquist wrote:

 What is Grr Cms that they are using? Cakephp is just a framework in
 itself. It might help to understand this "admin" panel you speak of.
 Honestly it sounds to me like you need to modify the layout file which is
 usually with app/Views
 On Dec 27, 2012 7:37 PM, "mrfugimoto"  wrote:

> Hi @cricket. Thank you very much for reply.
>
> Unfortunately I am very unfamiliar with cakePHP. Of our 300 seo
> customers. This particular one is the only one who uses this script.
>
> The business owner, (our customer) just started using guestflo, this
> site http://guestflo.com/ to create promotional ads for their
> website.
>
> I would post the site but it's an adult site for a strip club in
> Atlantic City New Jersey USA.
>
> Basically when I go into the cakePHP management console> "Add event"
> it doesn't allow me to embed that widget code. It only allows for basic
> HTML and upload of an image to be posted under "Managed Events" on the 
> CMS.
>
> I've told the customer this may not be possible to post the widget
> mainly becau

Re: Cake 2.0 documentation Vs Cake 1.3 documentation

2012-12-28 Thread Jonathan Sundquist
Cakephp is an open source project. If you feel there is stuff that can be
fixed or updated you can always look into submitting a pull request for
updates. I would also suggest looking at the api docs as well for
documentation on the components. You're going to get a lot more information
form the api then the book.
On Dec 28, 2012 8:00 AM, "Techinfocomp"  wrote:

> Hello,
>
> I Feel that Cake 1.3 documentation is much understandable and easier then
> Cake 2.0 documentation, I don't know why CakePHP Did that ?
>
> Eg:
>
> AuthComponent in 2.0
> -
>
> http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html
>
> And
>
> AuthComponent in 1.3
> 
>
> http://book.cakephp.org/1.3/en/The-Manual/Core-Components/Authentication.html
>
> In 1.3 it's clearly mention that how can i convert my normal password
> string into MD5 but in 2.0 it's not clear to me because there are many
> changes in AuthComponent.
>
> One more example:
>
> in 1.3 AuthComponent Variables are clearly described but in 2.0 there is
> no description regarding AuthComponent Variables
>
> Any one here can help me to understand this ?
>
> What i am trying to do is i need to convert my password in to Clean MD5
> only i don't want any extra string need to be added other then my password
> only like i don't want salt string etc.
>
> Thanks
>
> Harsh Gupta
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Help please with "Guestflo" widget

2012-12-28 Thread Jonathan Sundquist
So your pasting html into a tinymxe editor which Will convert a < into <
and a > >.

If you are trying to add this static widget to the events page you Will
need to modify the ctp file within the /app/views/events directory.
Possibly an index.ctp file.

I would suggest checking out the docs for cakephp at docs.cakephp.org.
also in order to figure out which version of cakephp you are using check
out the /cake directory. If you view any file in there it should give you
an idea as to the version.
On Dec 28, 2012 6:35 AM, "mrfugimoto"  wrote:

> Hi @jsundquist.
>
> This is my root>app>views folder contents
>
> C:\xampp\htdocs\divinghorse\app\views
> C:\xampp\htdocs\divinghorse\app\views\administrators
> C:\xampp\htdocs\divinghorse\app\views\categories
> C:\xampp\htdocs\divinghorse\app\views\elements
> C:\xampp\htdocs\divinghorse\app\views\errors
> C:\xampp\htdocs\divinghorse\app\views\events
> C:\xampp\htdocs\divinghorse\app\views\galleries
> C:\xampp\htdocs\divinghorse\app\views\helpers
> C:\xampp\htdocs\divinghorse\app\views\images
> C:\xampp\htdocs\divinghorse\app\views\layouts
> C:\xampp\htdocs\divinghorse\app\views\layouts\js
> C:\xampp\htdocs\divinghorse\app\views\layouts\rss
> C:\xampp\htdocs\divinghorse\app\views\layouts\xml
> C:\xampp\htdocs\divinghorse\app\views\news
> C:\xampp\htdocs\divinghorse\app\views\newsdetail
> C:\xampp\htdocs\divinghorse\app\views\ourevents
> C:\xampp\htdocs\divinghorse\app\views\ourgalleries
> C:\xampp\htdocs\divinghorse\app\views\pagecontent
> C:\xampp\htdocs\divinghorse\app\views\pages
> C:\xampp\htdocs\divinghorse\app\views\scaffolds
>
> This is the admin panel online from panel login view thru setting up a new
> event and what it looks like on the web.
>
> Admin Panel
>
> http://i366.photobucket.com/albums/oo101/johnnypiepics/1-adminhome_zps366ca5cb.jpg
>
> Add New Event
>
> http://i366.photobucket.com/albums/oo101/johnnypiepics/2-addevent_zpsa7092e1d.jpg
>
> Event Added in HTML editor mode.Then saved
>
> http://i366.photobucket.com/albums/oo101/johnnypiepics/3-eventadded_saved_zps985dadb3.jpg
>
> Event view on web page, the guestflo widget script and stripped
>
> http://i366.photobucket.com/albums/oo101/johnnypiepics/4-pageresult_zpscd55c45a.jpg
>
> On Thursday, December 27, 2012 8:48:55 PM UTC-5, jsundquist wrote:
>>
>> What is Grr Cms that they are using? Cakephp is just a framework in
>> itself. It might help to understand this "admin" panel you speak of.
>> Honestly it sounds to me like you need to modify the layout file which is
>> usually with app/Views
>> On Dec 27, 2012 7:37 PM, "mrfugimoto"  wrote:
>>
>>> Hi @cricket. Thank you very much for reply.
>>>
>>> Unfortunately I am very unfamiliar with cakePHP. Of our 300 seo
>>> customers. This particular one is the only one who uses this script.
>>>
>>> The business owner, (our customer) just started using guestflo, this
>>> site http://guestflo.com/ to create promotional ads for their website.
>>>
>>> I would post the site but it's an adult site for a strip club in
>>> Atlantic City New Jersey USA.
>>>
>>> Basically when I go into the cakePHP management console> "Add event" it
>>> doesn't allow me to embed that widget code. It only allows for basic HTML
>>> and upload of an image to be posted under "Managed Events" on the CMS.
>>>
>>> I've told the customer this may not be possible to post the widget
>>> mainly because the version they are using is cakePHP vers 1.3. Which I
>>> believe is old and doesn't support the jquery scripts. If there is a work
>>> around without ruining their CMS framework, I'll try it but I really don't
>>> think they want to have the code changed entirely in order to make the
>>> widget work.
>>>
>>> Hopefully this all makes sense and I'm not rambling. Any help you can
>>> provide is greatly appreciated. Thank you
>>>
>>> On Thursday, December 27, 2012 2:41:55 PM UTC-5, mrfugimoto wrote:

 Hi Please delete if this shows up twice. I posted in the old cakephp
 Google Groups but nothing showed up. I clicked new cakephp Google group,
 and still didn't see anything.

 Trying again...

 Hi I am extremely unfamiliar with cakephp framework. I work for a web
 development company who provide SEO support to customers. We inherited
 a site which is cakephp 1.3, (I believe an old version). We have an
 "Our Events" page and the customer asked me to add a widget

 This is the widget below. I've tried adding this through the admin
 panel "New Event". Nothing works. It's just an empty image frame with
 nothing to the right. Please help. I've tried everywhere on Google and
 find nothing.

 Thank you to anybody ahead of time.

 
 
 < script 
 src="http://guestflo.com/**venue**-widget.php
 ?
 VenueID=31&limit=30&a_link=**614**" type="text/javascript">
 < /div>
 < style type="text/css">
 .widget-wrapper{
 width:650px;
 color:#fff;
 }
 < /

Re: Help please with "Guestflo" widget

2012-12-27 Thread Jonathan Sundquist
What is Grr Cms that they are using? Cakephp is just a framework in itself.
It might help to understand this "admin" panel you speak of. Honestly it
sounds to me like you need to modify the layout file which is usually with
app/Views
On Dec 27, 2012 7:37 PM, "mrfugimoto"  wrote:

> Hi @cricket. Thank you very much for reply.
>
> Unfortunately I am very unfamiliar with cakePHP. Of our 300 seo customers.
> This particular one is the only one who uses this script.
>
> The business owner, (our customer) just started using guestflo, this site
> http://guestflo.com/ to create promotional ads for their website.
>
> I would post the site but it's an adult site for a strip club in Atlantic
> City New Jersey USA.
>
> Basically when I go into the cakePHP management console> "Add event" it
> doesn't allow me to embed that widget code. It only allows for basic HTML
> and upload of an image to be posted under "Managed Events" on the CMS.
>
> I've told the customer this may not be possible to post the widget mainly
> because the version they are using is cakePHP vers 1.3. Which I believe is
> old and doesn't support the jquery scripts. If there is a work around
> without ruining their CMS framework, I'll try it but I really don't think
> they want to have the code changed entirely in order to make the widget
> work.
>
> Hopefully this all makes sense and I'm not rambling. Any help you can
> provide is greatly appreciated. Thank you
>
> On Thursday, December 27, 2012 2:41:55 PM UTC-5, mrfugimoto wrote:
>>
>> Hi Please delete if this shows up twice. I posted in the old cakephp
>> Google Groups but nothing showed up. I clicked new cakephp Google group,
>> and still didn't see anything.
>>
>> Trying again...
>>
>> Hi I am extremely unfamiliar with cakephp framework. I work for a web
>> development company who provide SEO support to customers. We inherited
>> a site which is cakephp 1.3, (I believe an old version). We have an
>> "Our Events" page and the customer asked me to add a widget
>>
>> This is the widget below. I've tried adding this through the admin
>> panel "New Event". Nothing works. It's just an empty image frame with
>> nothing to the right. Please help. I've tried everywhere on Google and
>> find nothing.
>>
>> Thank you to anybody ahead of time.
>>
>> 
>> 
>> < script 
>> src="http://guestflo.com/**venue-widget.php
>> ?
>> VenueID=31&limit=30&a_link=**614" type="text/javascript">
>> < /div>
>> < style type="text/css">
>> .widget-wrapper{
>> width:650px;
>> color:#fff;
>> }
>> < /style>
>> 
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: I want to change password using cake php

2012-12-26 Thread Jonathan Sundquist
You should never modify the database manually. You should have cakephp
update the database for you.
On Dec 26, 2012 1:15 AM, "crush"  wrote:

> Turn debug to 2 in the config file. Login with the new password and copy
> the password string it posts in the debug at the bottom of the page after
> you try to login. Paste that into the database in the password field for
> the appropriate user.
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: I want to change password using cake php

2012-12-25 Thread Jonathan Sundquist
You can update it the same way you created it.
On Dec 25, 2012 7:11 PM, "euromark"  wrote:

> did you try google?
>
>
> Am Dienstag, 25. Dezember 2012 15:24:10 UTC+1 schrieb sweety:
>>
>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: I want to change password using cake php

2012-12-25 Thread Jonathan Sundquist
That's nice.
On Dec 25, 2012 7:07 PM, "sweety"  wrote:

>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Help! - Simple authentication tutorial? Is it broken?

2012-12-19 Thread Jonathan Sundquist
oxfordRob,

I've been trying to figure out what might be your issue with little to no
success.  One thing I might suggest you try is to move your entire app
directory up to the root level instead of inside a subfolder if possible.
 You may have a configuration issue causing cake core to not find the
appcontroller.  I do know you said that the blog tutorial worked for you
but its just a thought.


On Wed, Dec 19, 2012 at 2:57 PM, OxfordRob  wrote:

> Help! I have been trying to fix the 'Simple' Authentication tutorial for
> 10 hours today :-(
>
> The error messages from my Apache error log are listed below.
>
> I am sure I have an AppController.php file within the app/Controller
> older. Also, that this contains a good version of the AppController class
> from the tutorial.
>
> But still I get all of the errors below.
>
> Has anybody else successfully completed this tutorial and could give some
> pointers?
>
>
>
>
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP Fatal error:
> Class 'AppController' not found in
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Controller/CakeErrorController.php on
> line 31
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP Stack trace:
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP   1. {main}()
> /var/www/cakephp-2.3.0-RC1/app/webroot/index.php:0
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP   2.
> Dispatcher->dispatch() /var/www/cakephp-2.3.0-RC1/app/webroot/index.php:97
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP   3.
> Dispatcher->_getController()
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Routing/Dispatcher.php:152
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP   4.
> Dispatcher->_loadController()
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Routing/Dispatcher.php:228
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP   5.
> class_exists()
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Routing/Dispatcher.php:259
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP   6. App::load()
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Core/App.php:0
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP   7. include()
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Core/App.php:540
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP   8. App::load()
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Core/App.php:0
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP   9.
> App::shutdown() /var/www/cakephp-2.3.0-RC1/lib/Cake/Core/App.php:0
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP  10.
> App::_checkFatalError() /var/www/cakephp-2.3.0-RC1/lib/Cake/Core/App.php:899
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP  11.
> call_user_func() /var/www/cakephp-2.3.0-RC1/lib/Cake/Core/App.php:926
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP  12.
> ErrorHandler::handleError()
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Core/App.php:0
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP  13.
> ErrorHandler::handleFatalError()
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Error/ErrorHandler.php:161
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP  14.
> call_user_func()
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Error/ErrorHandler.php:211
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP  15.
> ErrorHandler::handleException()
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Error/ErrorHandler.php:0
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP  16.
> ExceptionRenderer->__construct()
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Error/ErrorHandler.php:125
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP  17.
> ExceptionRenderer->_getController()
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Error/ExceptionRenderer.php:94
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP  18. App::load()
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Core/App.php:0
> [Wed Dec 19 20:49:25 2012] [error] [client 127.0.0.1] PHP  19. include()
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Core/App.php:560
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: updating table field by date

2012-12-19 Thread Jonathan Sundquist
Chris,

Just to help you out instead of the giant mktime string you have you can
also use strtotime().  Within the function you can simply do strtotime('+30
days') which will do the same thing as above.


On Wed, Dec 19, 2012 at 2:39 PM, Chris  wrote:

> hi cricket, thank you for your response
> I have another approach to it,... on the click to advertising banner
> and/or link thru function (link goes thru function), and checks and compare
>  "featured_end" date with today's date,... and if it less than today's date
> it resets table.
> here is the function,... just in case anyone needs it:
>
>   function featured($id = null)
>   {
> if(!($dba = $this->Dba->findById($id)))
> {
>   $this->flash('error', ucfirst(i18n::translate('dba not found')));
>   $this->redirect('/not_found');
> }
> elseif(!($user = $this->User->findById($dba['Dba']['user_id'])))
> {
>   $this->flash('error', ucfirst(i18n::translate('user not found')));
>   $this->redirect('/not_found');
> }
> else
> {
>  $today = date('Y-m-d H:i:s');
>
> if($dba['Dba']['featured_end'] <= $today)
> {
>   $dba['Dba']['featured'] = 0;
>   $dba['Dba']['featured_start'] = NULL;
>   $dba['Dba']['featured_end'] = NULL;
>
>   $this->Dba->save($dba);
>
>   $this->redirect('/');
>
> }
> $this->redirect('/dbas/view/' . $dba['Dba']['id']);
> }
>  }
>
>
>
>
> On Wednesday, December 19, 2012 11:11:07 AM UTC-8, cricket wrote:
>
>> Create a shell task to fetch all records with featured == 1 and
>> end_date in the past. Run a cron job at midnight to call it.
>>
>> On Wed, Dec 19, 2012 at 6:22 AM, Chris  wrote:
>> > hi guys,... can anyone help please
>> >
>> > I'm building promotional advertising feature on a site,...
>> > and have a table fields: "featured_start" once the user is call the
>> function
>> > and "featured_end" after 30 days:
>> >
>> > $dba['Dba']['featured'] = 1;
>> > $dba['Dba']['featured_start'] = date('Y-m-d H:i:s');
>> > $after_30 = mktime(date("H"), date("i"), date("s"), date("m"),
>> date("d")+30,
>> > date("y"));
>> > $dba['Dba']['featured_end'] = date('Y-m-d H:i:s', $after_30);
>> >
>> > now I want to set $dba['Dba']['featured'] = 0; after 30 days,
>> > and reset "featured_start" and "featured_end" to NULL
>> > so the promotion can stop,...
>> >
>> > how can I this,...?
>> >
>> > thanks in advance
>> > chris
>> >
>> >
>> >
>> > --
>> > Like Us on FaceBook 
>> > https://www.facebook.com/**CakePHP
>> > Find us on Twitter http://twitter.com/CakePHP
>> >
>> > ---
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "CakePHP" group.
>> > To post to this group, send email to cake...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > cake-php+u...@**googlegroups.com.
>> > Visit this group at 
>> > http://groups.google.com/**group/cake-php?hl=en.
>>
>> >
>> >
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Help / Source code for Simple Authentication tutorial

2012-12-19 Thread Jonathan Sundquist
What does your current AppController look like?

A stripped down version should look like this

 wrote:

> @jsundquist - Thank you - that makes sense, I can see that information at
> the part of the error string.
>
> If I look at my cake folder structure, the file seems to be there (see
> attached picture). I am sure that file contains the class definition:
>
> class AppController extends Controller { ... etc.
>
> But it does not seem to be found by cake.
>
> I would think that somehow I have set it up so that cake is looking in the
> wrong place for this file. But that seems odd as the early part of the blog
> tutorial was working before I stated adding the authentication code.
>
>
>
>
> On Wednesday, 19 December 2012 19:04:10 UTC, jsundquist wrote:
>
>> The message is still pretty clear. That's a standard php debug message.
>> No way of changing the information present.
>>
>> As far as what that is telling you, its saying it still cannot find your
>> AppController.
>> On Dec 19, 2012 12:55 PM, "OxfordRob"  wrote:
>>
>>> @jsundquist - that was helpful, thank you. I had deleted the file - and
>>> the one I had created was missing:
>>>
>>> App::uses('Controller', 'Controller');
>>>
>>> I am still seeing the long string of error messages however.
>>>
>>> "Fatal error: Class 'AppController' not found in
>>> /var/www/cakephp-2.3.0-RC1/**lib/Cake/Controller/**CakeErrorController.php
>>> on line 31 Call Stack: 0.0009 354512 1. {main}() /var/www/cakephp-2.3.0-RC1/
>>> **app/webroot/index.php:0 0.0896 2939480 2. " etc
>>>
>>> I am finding it very hard to make any sense of these error messages.
>>> They are no very 'diagnostic'. Is there any way of getting more useful
>>> information about where the error might be? I can't see any of my file
>>> names in there, and I can't even see where one error item starts and
>>> another ends
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Wednesday, 19 December 2012 14:27:34 UTC, jsundquist wrote:

 The AppController.php is part of the default download of CakePHP in all
 versions. I just downloaded a fresh copy of CakePHP 2.3.0-RC1 and within
 the app/Controllers directory there is in fact an AppController.php file.
  You shouldn't need to re-create the file unless you deleted it.


 On Wed, Dec 19, 2012 at 8:23 AM, OxfordRob  wrote:

> As a follow upI am suspicious in this area
>
> The tutorial says "To add this component to your application *open*your
> app/Controller/AppController.**p**hp file and *add* the following
> lines:"
>
> But this is the first mention of an 'AppController.php' file.
>
> So I just created an 'AppController.php' file and put in the code, but
> that does not feel right to me.
>
> I already have a 'UsersController.php' file that contains the class
> definition:
>
> class UsersController extends AppController
>
> So that makes me thing that 'AppController' is a pre-defined class in
> cake. Am I meant to be overloading this class?
>
> Something seems wrong.
>
> Any ideas please?
>
>
>
> On Wednesday, 19 December 2012 12:24:34 UTC, OxfordRob wrote:
>>
>> Folks,
>>
>> I successfully worked through the blog tutorial and everything worked
>> fine.
>>
>> I then moved onto the Authentication example / tutorial here...but
>> can't make it work..
>>
>> http://book.cakephp.org/2.0/**en/tutorials-and-examples/**blog-**
>> a**uth-example/auth.html
>>
>> I get a gibberish error message when I access the page... (Copied
>> below) which does not give me any real clues about what I have done 
>> wrong.
>>
>> Does anybody know where to download the full source code for this
>> example? Or, if you have made this work, would you post it please?
>>
>> Any clues about how to read the error message below, and where I
>> might start looking would be very gratefully received!
>>
>> I have attached zip of my /app directory.
>>
>> Thanks for any help!
>>
>>
>> *Error message:* on accessing URL: http://localhost/cakephp-2.3.**0**
>> **-RC1/users/add 
>>
>> Fatal error: Class declarations may not be nested in
>> /var/www/cakephp-2.3.0-RC1/**lib/Cake/Error/**ExceptionRenderer.*
>> ***php on line 55 Call Stack: 0.0014 354512 1. {main}()
>> /var/www/cakephp-2.3.0-RC1/**app/webroot/index.php:0 0.1175
>> 2937464 2. Dispatcher->dispatch() /var/www/cakephp-2.3.0-RC1/**app***
>> */webroot/index.php:97 0.1438 3490652 3.
>> Dispatcher->_getController() /var/www/cakephp-2.3.0-RC1/**lib
>> /Cake/Routing/Dispatcher.**php:**1**52 0.1438 3490652 4.
>> Dispatcher->_loadController() /var/www/cakephp-2.3.0-RC1/**lib
>> /Cake/Routing/Dispatcher.**php:**2**28 0

Re: Help / Source code for Simple Authentication tutorial

2012-12-19 Thread Jonathan Sundquist
The message is still pretty clear. That's a standard php debug message. No
way of changing the information present.

As far as what that is telling you, its saying it still cannot find your
AppController.
On Dec 19, 2012 12:55 PM, "OxfordRob"  wrote:

> @jsundquist - that was helpful, thank you. I had deleted the file - and
> the one I had created was missing:
>
> App::uses('Controller', 'Controller');
>
> I am still seeing the long string of error messages however.
>
> "Fatal error: Class 'AppController' not found in
> /var/www/cakephp-2.3.0-RC1/lib/Cake/Controller/CakeErrorController.php on
> line 31 Call Stack: 0.0009 354512 1. {main}()
> /var/www/cakephp-2.3.0-RC1/app/webroot/index.php:0 0.0896 2939480 2. "
> etc
>
> I am finding it very hard to make any sense of these error messages. They
> are no very 'diagnostic'. Is there any way of getting more useful
> information about where the error might be? I can't see any of my file
> names in there, and I can't even see where one error item starts and
> another ends
>
>
>
>
>
>
>
> On Wednesday, 19 December 2012 14:27:34 UTC, jsundquist wrote:
>>
>> The AppController.php is part of the default download of CakePHP in all
>> versions. I just downloaded a fresh copy of CakePHP 2.3.0-RC1 and within
>> the app/Controllers directory there is in fact an AppController.php file.
>>  You shouldn't need to re-create the file unless you deleted it.
>>
>>
>> On Wed, Dec 19, 2012 at 8:23 AM, OxfordRob  wrote:
>>
>>> As a follow upI am suspicious in this area
>>>
>>> The tutorial says "To add this component to your application *open*your
>>> app/Controller/AppController.**php file and *add* the following lines:"
>>>
>>> But this is the first mention of an 'AppController.php' file.
>>>
>>> So I just created an 'AppController.php' file and put in the code, but
>>> that does not feel right to me.
>>>
>>> I already have a 'UsersController.php' file that contains the class
>>> definition:
>>>
>>> class UsersController extends AppController
>>>
>>> So that makes me thing that 'AppController' is a pre-defined class in
>>> cake. Am I meant to be overloading this class?
>>>
>>> Something seems wrong.
>>>
>>> Any ideas please?
>>>
>>>
>>>
>>> On Wednesday, 19 December 2012 12:24:34 UTC, OxfordRob wrote:

 Folks,

 I successfully worked through the blog tutorial and everything worked
 fine.

 I then moved onto the Authentication example / tutorial here...but
 can't make it work..

 http://book.cakephp.org/2.0/**en**/tutorials-and-examples/**blog-**
 auth-example/auth.html

 I get a gibberish error message when I access the page... (Copied
 below) which does not give me any real clues about what I have done wrong.

 Does anybody know where to download the full source code for this
 example? Or, if you have made this work, would you post it please?

 Any clues about how to read the error message below, and where I might
 start looking would be very gratefully received!

 I have attached zip of my /app directory.

 Thanks for any help!


 *Error message:* on accessing URL: http://localhost/cakephp-2.3.**0**
 -RC1/users/add 

 Fatal error: Class declarations may not be nested in
 /var/www/cakephp-2.3.0-RC1/**lib**/Cake/Error/**ExceptionRenderer.**php
 on line 55 Call Stack: 0.0014 354512 1. {main}() 
 /var/www/cakephp-2.3.0-RC1/
 **app**/webroot/index.php:0 0.1175 2937464 2. Dispatcher->dispatch()
 /var/www/cakephp-2.3.0-RC1/**app**/webroot/index.php:97 0.1438 3490652
 3. Dispatcher->_getController() /var/www/cakephp-2.3.0-RC1/**lib**
 /Cake/Routing/Dispatcher.**php:**152 0.1438 3490652 4.
 Dispatcher->_loadController() /var/www/cakephp-2.3.0-RC1/**lib**
 /Cake/Routing/Dispatcher.**php:**228 0.1440 3491896 5. class_exists()
 /var/www/cakephp-2.3.0-RC1/**lib**/Cake/Routing/Dispatcher.**php:**259
 0.1440 3492168 6. App::load() 
 /var/www/cakephp-2.3.0-RC1/**lib**/Cake/Core/App.php:0
 0.1458 3537372 7. App::shutdown() 
 /var/www/cakephp-2.3.0-RC1/**lib**/Cake/Core/App.php:0
 0.1468 3537344 8. App::_checkFatalError() /var/www/cakephp-2.3.0-RC1/**
 lib**/Cake/Core/App.php:899 0.1470 3538456 9. call_user_func()
 /var/www/cakephp-2.3.0-RC1/**lib**/Cake/Core/App.php:926 0.1470
 3538500 10. ErrorHandler::handleError() /var/www/cakephp-2.3.0-RC1/**
 lib**/Cake/Core/App.php:0 0.1471 3538992 11. ErrorHandler::**
 handleFatalError**() /var/www/cakephp-2.3.0-RC1/**lib**
 /Cake/Error/ErrorHandler.**php:**161 0.1481 3548532 12.
 call_user_func() /var/www/cakephp-2.3.0-RC1/**lib**
 /Cake/Error/ErrorHandler.**php:**211 0.1481 3548560 13.
 ErrorHandler::handleException() /var/www/cakephp-2.3.0-RC1/**lib**
 /Cake/Error/ErrorHandler.**php:0 0.1488 

Re: Particular find operation to do

2012-12-19 Thread Jonathan Sundquist
Would would need to do a not in condition.  The below find method should
produce something to the following

SELECT * FROM users as user where user.group_id <> yourid;

$this->User->find('all', array('conditions'=>array('User.group_id <>' ,
generic id)));


On Wed, Dec 19, 2012 at 11:21 AM, byqsri  wrote:

> Hi
> I'm newbie with cakephp
> I have model User, model Group and model UsersGroup ( an user can belongs
> to many groups and a group can have many users).
> I would ask how in CakePHP can I find all users that not belong to the
> Group group_id (where group_id is a generic int value)
> Many thanks
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Help / Source code for Simple Authentication tutorial

2012-12-19 Thread Jonathan Sundquist
The AppController.php is part of the default download of CakePHP in all
versions. I just downloaded a fresh copy of CakePHP 2.3.0-RC1 and within
the app/Controllers directory there is in fact an AppController.php file.
 You shouldn't need to re-create the file unless you deleted it.


On Wed, Dec 19, 2012 at 8:23 AM, OxfordRob  wrote:

> As a follow upI am suspicious in this area
>
> The tutorial says "To add this component to your application *open* your
> app/Controller/AppController.php file and *add* the following lines:"
>
> But this is the first mention of an 'AppController.php' file.
>
> So I just created an 'AppController.php' file and put in the code, but
> that does not feel right to me.
>
> I already have a 'UsersController.php' file that contains the class
> definition:
>
> class UsersController extends AppController
>
> So that makes me thing that 'AppController' is a pre-defined class in
> cake. Am I meant to be overloading this class?
>
> Something seems wrong.
>
> Any ideas please?
>
>
>
> On Wednesday, 19 December 2012 12:24:34 UTC, OxfordRob wrote:
>>
>> Folks,
>>
>> I successfully worked through the blog tutorial and everything worked
>> fine.
>>
>> I then moved onto the Authentication example / tutorial here...but can't
>> make it work..
>>
>> http://book.cakephp.org/2.0/**en/tutorials-and-examples/**
>> blog-auth-example/auth.html
>>
>> I get a gibberish error message when I access the page... (Copied below)
>> which does not give me any real clues about what I have done wrong.
>>
>> Does anybody know where to download the full source code for this
>> example? Or, if you have made this work, would you post it please?
>>
>> Any clues about how to read the error message below, and where I might
>> start looking would be very gratefully received!
>>
>> I have attached zip of my /app directory.
>>
>> Thanks for any help!
>>
>>
>> *Error message:* on accessing URL: http://localhost/cakephp-2.3.**
>> 0-RC1/users/add 
>>
>> Fatal error: Class declarations may not be nested in
>> /var/www/cakephp-2.3.0-RC1/**lib/Cake/Error/**ExceptionRenderer.php on
>> line 55 Call Stack: 0.0014 354512 1. {main}() /var/www/cakephp-2.3.0-RC1/
>> **app/webroot/index.php:0 0.1175 2937464 2. Dispatcher->dispatch()
>> /var/www/cakephp-2.3.0-RC1/**app/webroot/index.php:97 0.1438 3490652 3.
>> Dispatcher->_getController() /var/www/cakephp-2.3.0-RC1/**
>> lib/Cake/Routing/Dispatcher.**php:152 0.1438 3490652 4.
>> Dispatcher->_loadController() /var/www/cakephp-2.3.0-RC1/**
>> lib/Cake/Routing/Dispatcher.**php:228 0.1440 3491896 5. class_exists()
>> /var/www/cakephp-2.3.0-RC1/**lib/Cake/Routing/Dispatcher.**php:259
>> 0.1440 3492168 6. App::load() 
>> /var/www/cakephp-2.3.0-RC1/**lib/Cake/Core/App.php:0
>> 0.1458 3537372 7. App::shutdown() 
>> /var/www/cakephp-2.3.0-RC1/**lib/Cake/Core/App.php:0
>> 0.1468 3537344 8. App::_checkFatalError() 
>> /var/www/cakephp-2.3.0-RC1/**lib/Cake/Core/App.php:899
>> 0.1470 3538456 9. call_user_func() 
>> /var/www/cakephp-2.3.0-RC1/**lib/Cake/Core/App.php:926
>> 0.1470 3538500 10. ErrorHandler::handleError() /var/www/cakephp-2.3.0-RC1/
>> **lib/Cake/Core/App.php:0 0.1471 3538992 11. 
>> ErrorHandler::**handleFatalError()
>> /var/www/cakephp-2.3.0-RC1/**lib/Cake/Error/ErrorHandler.**php:161
>> 0.1481 3548532 12. call_user_func() /var/www/cakephp-2.3.0-RC1/**
>> lib/Cake/Error/ErrorHandler.**php:211 0.1481 3548560 13.
>> ErrorHandler::handleException(**) /var/www/cakephp-2.3.0-RC1/**
>> lib/Cake/Error/ErrorHandler.**php:0 0.1488 3550236 14. App::load()
>> /var/www/cakephp-2.3.0-RC1/**lib/Cake/Core/App.php:0
>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Can cake bake generate input list box in View?

2012-12-19 Thread Jonathan Sundquist
Since its not a related table you can always just do a find('list') on the
model that contains your data and send it to the view. Within the view you
would then set your $this->Form->input('field', array('options'=>
$this->values));




On Wed, Dec 19, 2012 at 5:04 AM, euromark  wrote:

> no, if you have relations you don't have to do anything.
> cake will automatically populate them if you pass them down via
> controller. thats why we asked you.
>
> if you really need some custom solutions you can look how I set up custom
> selects in my adjusted bake templates
>
> https://github.com/dereuromark/setup/blob/master/Console/Templates/setup/views/form.ctp#L81
>
> echo "\t\techo \$this->Form->input('{$field}', array('options' => ".
> Inflector::camelize($modelClass)."::".$enumMethod."(), ...));\n";
>
> as an example
>
>
>
> Am Mittwoch, 19. Dezember 2012 03:12:24 UTC+1 schrieb Sam:
>
>> Sorry for being vague. The table exist by itself and does not have any
>> relationship with any other tables. The fields are custom-selected. Will it
>> be a problem if the fields do not come from related tables?
>>
>> Thank you.
>>
>> On Tuesday, December 18, 2012 10:19:16 PM UTC+8, euromark wrote:
>>>
>>> are you talking about custom select fields? or the ones that come from
>>> related tables?
>>> your initial post is too incomplete to answer your question
>>>
>>>
>>> Am Dienstag, 18. Dezember 2012 13:32:55 UTC+1 schrieb Sam:

 Yes. That is right. Can it be done by cake bake? Thank you.

 On Tuesday, December 18, 2012 7:50:49 PM UTC+8, euromark wrote:
>
> do you mean like select boxes? with options filled etc?
>
>
> Am Dienstag, 18. Dezember 2012 10:41:52 UTC+1 schrieb Sam:
>>
>> Dear CakePHP experts,
>>
>> May I know if it is possible to use Cake Bake to auto-generate code
>> that will display an input listbox in View? If yes, how do I specify the
>> different input list options in the Model? I have searched through the
>> documentation but could not find any solution. I was wondering if this 
>> can
>> be done.
>>
>> Thank you.
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Can cake bake generate input list box in View?

2012-12-18 Thread Jonathan Sundquist
Yes it does it automatically if you specify a join on that field.
On Dec 18, 2012 6:33 AM, "Sam"  wrote:

> Yes. That is right. Can it be done by cake bake? Thank you.
>
> On Tuesday, December 18, 2012 7:50:49 PM UTC+8, euromark wrote:
>>
>> do you mean like select boxes? with options filled etc?
>>
>>
>> Am Dienstag, 18. Dezember 2012 10:41:52 UTC+1 schrieb Sam:
>>>
>>> Dear CakePHP experts,
>>>
>>> May I know if it is possible to use Cake Bake to auto-generate code that
>>> will display an input listbox in View? If yes, how do I specify the
>>> different input list options in the Model? I have searched through the
>>> documentation but could not find any solution. I was wondering if this can
>>> be done.
>>>
>>> Thank you.
>>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: cakephp and ajax

2012-12-17 Thread Jonathan Sundquist
Hey David,

You would connect to your model the same way you do within any other
controller.  Your controller code would look something like the following

public function index(){
 // Disable both the view and layout as they both will not be needed.
$this->autoRender = false;
// Make sure someone actually did pass in a discount code
 if($this->request->params['discount_code']){
 // Look up the discount code passed in and then json encode the response
to be used by the ajax handler within the ui.
 echo
json_encode($this->Setting->find(array('conditions'=>array('discount_code'=>$this->request->params['discount_code']);
 }
}

The above code should do about what you want it to.  You will need to write
the remaining code for the UI as I don't know what your fields are named.


On Mon, Dec 17, 2012 at 12:42 AM, David Camerotto wrote:

> Hi, I am relatively new to Cake, I took over a web site that uses it and
> am still learning the ropes, but slowly getting there.
>
> One issue has do have is with the image shown below.
>
> I want to be able to retrieve data from the DB when clicking on the Apply
> link.
>
> I have create a model and controller and have added this code to the click
> event for the link.
>
> $('#go').click(function(){
> $.ajax({
> url:'/discount/index',
> type:'POST',
> data:data
> });
>
> What I'm unsure about is how to retrieve the the data from the DB and how
> to put it into the input box - table is called settings and field is
> discount_code.
>
> Any help would be greatly appreciated
>
>
> 
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: FULL_BASE_URL error using requestAction()

2012-11-22 Thread Jonathan Sundquist
What version are you using.
On Nov 22, 2012 1:39 AM, "Miles J"  wrote:

> I keep seeing this in my debug.log, any ideas?
>
> 2012-11-22 03:22:36 Notice: Notice (8): Use of undefined constant
> FULL_BASE_URL - assumed 'FULL_BASE_URL' in
> [/var/www/cake/latest/lib/Cake/Core/Object.php, line 87]
> Trace:
> Object::requestAction() - CORECake/Core/Object.php, line 87
> include - /var/www//public/app/View/Elements/sidebar.ctp, line 1
> View::_evaluate() - CORECake/View/View.php, line 921
> View::_render() - CORECake/View/View.php, line 884
> View::element() - CORECake/View/View.php, line 422
> include - APP/View/News/index.ctp, line 9
> View::_evaluate() - CORECake/View/View.php, line 921
> View::_render() - CORECake/View/View.php, line 884
> View::render() - CORECake/View/View.php, line 476
> Controller::render() - CORECake/Controller/Controller.php, line 956
> Dispatcher::_invoke() - CORECake/Routing/Dispatcher.php, line 193
> Dispatcher::dispatch() - CORECake/Routing/Dispatcher.php, line 161
> [main] - APP/webroot/index.php, line 98
>
> And the sidebar element:
>
> requestAction('/sidebar/' . $sidebar, array('return',
> 'bare' => false)); ?>
>
> Should I just define FULL_BASE_URL?
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: How to convert given date string to utc format ?

2012-11-21 Thread Jonathan Sundquist
Using the time helper you can do the following.

$time->format('c', $yourdate);


On Wed, Nov 21, 2012 at 7:39 AM, Steve Babs  wrote:

> Hi all,
>
>
> How to convert given date string to utc format ?
>
>
> On Wednesday, November 21, 2012 6:28:18 PM UTC+5:30, Steve Babs wrote:
>>
>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Recursive removed?

2012-11-21 Thread Jonathan Sundquist
Jeremy,

I took your suggestion add added Location.state_id and State.id to the
fields array and it still returns the same error.  Good idea, unfortunately
same out come.

 - Jon


On Tue, Nov 20, 2012 at 9:34 AM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> What happens if you include State.id and Location.state_id in the fields
> array?
>
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 20 Nov 2012, at 14:46:06, jsundquist  wrote:
>
> Hello Jeremy,
>
> Here is my example. Note that this is all within my model.
>
> public function getOrder($id = null){
> if($id === null){
> return array();
> }
>
> $fields = array(
> 'Order.id',
>
> 'OrderStatus.name',
> 'Location.name',
> 'Location.line1',
>
> 'Location.line2',
> 'Location.city',
> 'Location.postal_code',
>
> 'Location.contact',
> 'Location.phone',
> 'Order.customer_notes',
>
> 'Order.internal_notes',
> 'Order.external_notes',
> 'OrderType.name',
>
> 'State.abbr'
> );
>
> $conditions = array(
> 'Order.id' => $id
> );
>
> return $this->find('first', array('fields' => $fields, 'conditions' 
> => $conditions, 'recursive' => 2));
> }
>
> The following is output to the view.
>
> *Error: *SQLSTATE[42S22]: Column not found: 1054 Unknown column 'State.abbr' 
> in 'field list'
>
> *SQL Query: *SELECT `Order`.`id`, `OrderStatus`.`name`, `Location`.`name`, 
> `Location`.`line1`, `Location`.`line2`, `Location`.`city`, 
> `Location`.`postal_code`, `Location`.`contact`, `Location`.`phone`, 
> `Order`.`customer_notes`, `Order`.`internal_notes`, `Order`.`external_notes`, 
> `OrderType`.`name`, `State`.`abbr` FROM `intranet`.`orders` AS `Order` LEFT 
> JOIN `intranet`.`locations` AS `Location` ON (`Order`.`location_id` = 
> `Location`.`id`) LEFT JOIN `intranet`.`order_statuses` AS `OrderStatus` ON 
> (`Order`.`order_status_id` = `OrderStatus`.`id`) LEFT JOIN 
> `intranet`.`order_types` AS `OrderType` ON (`Order`.`order_type_id` = 
> `OrderType`.`id`) LEFT JOIN `intranet`.`shipping_methods` AS `ShippingMethod` 
> ON (`Order`.`shipping_method_id` = `ShippingMethod`.`id`) WHERE `Order`.`id` 
> = 1 LIMIT 1
>
> *Notice: *If you want to customize this error message, create 
> app/View/Errors/pdo_error.ctp
>
>
> I would expect that it would go down one more level to do a join on
> State.id = Location.state_id however that does not appear to be the case.
>  I do have the models set up correctly.
>
> On Tuesday, November 20, 2012 1:20:38 AM UTC-6, Jeremy Burns wrote:
>>
>> Got an example?
>>
>> Jeremy Burns
>> Class Outfit
>>
>> http://www.classoutfit.com
>>
>> On 20 Nov 2012, at 00:44:41, jsundquist  wrote:
>>
>> I should also state that by default my application is set to recursive =
>> 1 but this query I am looking to pass in recursive=2.
>>
>> On Monday, November 19, 2012 6:42:22 PM UTC-6, jsundquist wrote:
>>>
>>> Looking through both the book.cakephp.org and also api.cakephp.org for
>>> 2.x they both still mention the ability to pass in recursive as a parameter
>>> however when you do this for the find method it appears it is completely
>>> ignored. Is this functionality missing or deprecated?  I'm doing a find
>>> that needs to go one extra level deeper than normal. I was hoping to just
>>> pass in recursive=>1 for this single query, but so far it looks like it
>>> still only returns direct ascendants.
>>
>>
>> --
>> Like Us on FaceBook 
>> https://www.facebook.com/**CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake...@googlegroups.com.
>> To unsubscribe from this group, send email to cake-php+u...@**
>> googlegroups.com.
>> Visit this group at 
>> http://groups.google.com/**group/cake-php?hl=en
>> .
>>
>>
>>
>>
>>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.go

Re: SQL queries in controller, operations on different tables in db

2012-11-19 Thread Jonathan Sundquist
If you perform a var_dump of $name I bet it would be $name[0]['player'].
On Nov 19, 2012 3:52 PM, "kijciwoko"  wrote:

> Ok, sorry for newbie question, but I just don't get it and it drives me
> mad. Nothing works. This is my controller:
>
> class EntriesController extends AppController
> {
>var $uses = array('Entry', 'FCPlayer');
>
> function index()
> {
> }
>
> function get_entries()
> {
>$this->set('data', $this->Entry->find('all'));
>$this->layout = 'ajax';
> }
>
> function admin_index()
> {
>$this->set('fields', $this->Entry->find('all'));
> }
>
> function admin_add()
> {
>if (!empty($this->data))
>{
> if ($this->PEntry->save($this->data))
> {
> $this->Session->setFlash('new entry, happy days...:
> '.$this->data['Entry']['time'].', add next:', 'success');
> $this->redirect(array('action' => 'add'));
> }
>}
>$this->set('f_c_players', $this->FCPlayer->find('list'));
> }
>
> function admin_edit($id = null)
> {
>$this->Entry->id = $id;
>if (!$id && empty($this->data))
>{
> $this->Entry->setFlash('Wrong Id!', 'failure');
> $this->redirect(array('action' => 'index'));
>}
>if (!empty($this->data))
>{
> if ($this->Entry->save($this->data))
> {
> $this->Session->setFlash('Edited.', 'success');
> $this->redirect(array('action' => 'index'));
> }
>}
>if (empty($this->data))
>{
> $this->data = $this->Entry->read(null, $id);
>}
> }
>
> function admin_delete($id = null)
> {
> if (!$id)
> {
>  $this->Session->setFlash('Wrong Id!', 'failure');
>  $this->redirect(array('action' => 'index'));
> }
> if ($this->Entry->delete($id))
> {
>/*** What I need here is:
>1. You have id of this entry which you're about to delete.
>   Find this record in database (table: entries)
>   and get me name of the player from same record but
> different column.
>2. Ok, you hava a name. Look in another table (fc_players)
> for a record containing
>   this name you've just found.
>3. Ok, found a record? Now look at the "news" column.
> There's an int.
>   If it's bigger then 1 just reduce and leave it there.
>   If it's equal 1 go ahead and delete whole record.
>/
>
>  $this->Session->setFlash('Deleted.', 'success');
>  $this->redirect(array('action' => 'index'));
> }
> }
>
> function admin_deleteAll()
> {
>if ($this->Entry->deleteAll('1 = 1'))
>{
>$this->Session->setFlash('All deleted.', 'success');
>$this->redirect(array('action' => 'index'));
>}
> }
>
> }
>
>
> My problem is that apparently no matter what I do, my cake (1.3.4) doesn't
> want to cooperate. I've asked my question here:
> http://stackoverflow.com/questions/13443605/cakephp-sql-queries] but I
> don't think they can help me since I can't even format code on their
> website like civilized human being.
>
> My guess is that something's wrong with sql statements but I can't be sure
> because for some reason when I ask google "hey, dude, how can I debug my
> CakePHP?" it responds "How the hell should I know?". Even if I go with
> $this->Entry->query it seems that my cake is too lazy to do anything
> (although $this->Session->setFlash('message','success'); seems to be
> working and when I try to send to my admin panel result of a query like in:
>
> $name = $this->Entry->query("SELECT player FROM entries WHERE id = '" .
> $id . "'");
> $this->Session->setFlash($name,'success');
>
> it shows blank message (and yes, i know it's not cake-efficient to do
> queries that way, I'm just that desperate)). I have no idea what else can I
> try. Any help?
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Pagination

2012-11-19 Thread Jonathan Sundquist
What you are looking for is the following.

$this->set('posts', $this->paginate(array('Post', "Post.category_id =
$categoryId"));


On Mon, Nov 19, 2012 at 3:32 PM, Paul Willis  wrote:

> I'm not paging categories I'm trying to page posts that belong to a
> particular category
>
> PW
>
>
> On 19 Nov 2012, at 21:15, Andras Kende  wrote:
>
> >
> > something like this should work:
> >
> >   public function category($id = null) {
> >   $this->paginate = array(
> >   'conditions' => array(
> >   'Category.id' => $id
> >   )
> >   );
> >   $posts = $this->Post->Category->paginate('Category');
> >   //print_r($posts);  // to test here ...
> >   $this->set(compact('posts'));
> >   }
> >
> > But since you paginating categories it may be better to do this from the
> categories controller..
> >
> > Andras Kende
> > http:///www.kende.com
> >
> > On Nov 19, 2012, at 12:57 PM, Paul Willis  wrote:
> >
> >> In my PostsController.php I have a function to find all the posts from
> a category…
> >>
> >>  public function category($id = null) {
> >>  $this->set('posts', $this->Post->Category->find('first',
> array(
> >>  'conditions' => array(
> >>  'Category.id' => $id
> >>  )
> >>  )));
> >>  }
> >>
> >>
> >> This works fine and all my posts for the particular category are
> returned.
> >>
> >> However I obviously get every post in that category and so now I would
> like to use paginate but I'm not sure how to add it to the above function.
> >>
> >> PW
> >>
> >> --
> >> Like Us on FaceBook https://www.facebook.com/CakePHP
> >> Find us on Twitter http://twitter.com/CakePHP
> >>
> >> ---
> >> You received this message because you are subscribed to the Google
> Groups "CakePHP" group.
> >> To post to this group, send email to cake-php@googlegroups.com.
> >> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> >> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> >>
> >>
> >
> > --
> > Like Us on FaceBook https://www.facebook.com/CakePHP
> > Find us on Twitter http://twitter.com/CakePHP
> >
> > ---
> > You received this message because you are subscribed to the Google
> Groups "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com.
> > To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> > Visit this group at http://groups.google.com/group/cake-php?hl=en.
> >
> >
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: preg_match Warning on Email

2012-11-02 Thread Jonathan Sundquist
Chris,
Your issue is 'VALID_EMAIL' is not a valid regular expression.  Take a look
here for how to use regular expressions to validate the email address.

http://www.developphp.com/view_lesson.php?v=224

 - Jon


On Fri, Nov 2, 2012 at 9:35 AM, Chris  wrote:

> thank you for your reply chetan,...
> I'm steel getting an error:
> Warning (2): preg_match() [function.preg-match]: Delimiter must not be
> alphanumeric or backslash [APP/controllers/invitations_controller.php, line
> 83]
>
> this is my invitations model:
>
> var $validate = array(
>  'user_id' => array(
>   'rule' => 'notEmpty',
>   'message' => 'user must be valid',
>  ),
> 'email'=> array(
> 'mustNotEmpty'=>array(
> 'rule' => 'notEmpty',
> 'message'=> 'Please enter email',
> 'last'=>true),
> 'mustBeEmail'=> array(
> 'rule' => array('email'),
> 'message' => 'Please enter valid email',
> 'last'=>true)
> ),
>
>  );
>
> and this is what I have in a invitations controller:
> $emails = array();
>
> if(!empty($this->data['Invitation']['emails']))
> {
>   $raw_emails = explode(',', $this->data['Invitation']['emails']);
>   foreach($raw_emails as $email)
>   {
> $email = trim($email);
> if(preg_match('VALID_EMAIL', $email)) // This is where I'm
> getting an error...
>   $emails[] = $email;
>   }
>
>  debug($email);
>
> I placed the debug in,... and I'm reading test email in the view,... but
> steel getting an error
>
>
>
> On Friday, November 2, 2012 6:52:42 AM UTC-7, chetan varshney wrote:
>
>> For email validation you should use-
>>
>> 'email'=> array(
>> 'mustNotEmpty'=>array(
>> 'rule' => 'notEmpty',
>> 'message'=> __('Please enter email'),
>> 'last'=>true),
>> 'mustBeEmail'=> array(
>> 'rule' => array('email'),
>> 'message' => __('Please enter valid email'),
>> 'last'=>true)
>> ),
>>
>> and for deep checking
>>
>> 'email'=> array(
>> 'mustNotEmpty'=>array(
>> 'rule' => 'notEmpty',
>> 'message'=> __('Please enter email'),
>> 'last'=>true),
>> 'mustBeEmail'=> array(
>> 'rule' => array('email', true),
>> 'message' => __('Please enter valid email'),
>> 'last'=>true)
>> ),
>>
>>
>>
>>  On Fri, Nov 2, 2012 at 7:05 PM, Chris  wrote:
>>
>>> hi guys,... I'm getting this preg_match Warning on Email issue no matter
>>> what I do,
>>> can anyone help me please,
>>>
>>> Warning (2): preg_match() [function.preg-match]: Delimiter must not be
>>> alphanumeric or backslash [APP/controllers/invitations_**controller.php,
>>> line 83]
>>>
>>> and this is what I have in a Model:
>>>
>>> var $validate = array(
>>>   'email' => array(
>>>   'rule' => 'alphaNumeric',
>>>'required' => true,
>>>   'allowEmpty' => false,
>>>  ),
>>>  );
>>>
>>> thanks in advance,...
>>>  chris
>>>
>>> --
>>> Like Us on FaceBook 
>>> https://www.facebook.com/**CakePHP
>>> Find us on Twitter http://twitter.com/CakePHP
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "CakePHP" group.
>>> To post to this group, send email to cake...@googlegroups.com.
>>> To unsubscribe from this group, send email to cake-php+u...@**
>>> googlegroups.com.
>>>
>>> Visit this group at 
>>> http://groups.google.com/**group/cake-php?hl=en
>>> .
>>>
>>>
>>>
>>
>>
>>
>> --
>> Chetan Varshney
>> Ektanjali Softwares Pvt Ltd
>>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: validate select field in a Model

2012-11-01 Thread Jonathan Sundquist
A select dropdown will never be empty unless one of the options is an empty
string.

- Jon
On Nov 1, 2012 5:23 AM, "Chris"  wrote:

>
> hi guys,... I'm using cake 1.3
> how can I validate "select" field from Model,?
>
> what I have in bootstrap:
>  Configure::write('User.genders', array('unknown', 'male', 'female'));
>
> in a view:
>  
> 
>  $genders = array(Configure::read('User.genders'));
> echo $this->Form->select('gender', $genders)
> ?>
> 
>  
>
> and in a Model:
>   var $validate = array(
>  'gender' => array(
>   'rule' => 'notEmpty',
>   'required' => true,
>   'message' => 'Gender must be valid',
>  ),
>   );
>
> I'm not getting warning of red box with "Gender must be valid"
>
> how can I do this?
>
> thanks in advance
> chris
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: validate select field in a Model

2012-11-01 Thread Jonathan Sundquist
- Jon
On Nov 1, 2012 5:23 AM, "Chris"  wrote:

>
> hi guys,... I'm using cake 1.3
> how can I validate "select" field from Model,?
>
> what I have in bootstrap:
>  Configure::write('User.genders', array('unknown', 'male', 'female'));
>
> in a view:
>  
> 
>  $genders = array(Configure::read('User.genders'));
> echo $this->Form->select('gender', $genders)
> ?>
> 
>  
>
> and in a Model:
>   var $validate = array(
>  'gender' => array(
>   'rule' => 'notEmpty',
>   'required' => true,
>   'message' => 'Gender must be valid',
>  ),
>   );
>
> I'm not getting warning of red box with "Gender must be valid"
>
> how can I do this?
>
> thanks in advance
> chris
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: JQuery save success/error

2012-10-31 Thread Jonathan Sundquist
Is your goal to output some message if they have successfully filled out
your form and possibly add a little extra data to the success message?  If
so just hide the success message by default, add some selectors that you
can populate with the json that's returned on success, and then show the
message.

As far as the failure is concerned again have hidden elements on the form
that you can select and add the validation messages to.  Or there are also
plenty of jQuery validation plugins out there that you could do your
validation on the fly using onBlur or onFocus for that matter.


On Wed, Oct 31, 2012 at 10:33 AM, Jeremy Burns | Class Outfit <
jeremybu...@classoutfit.com> wrote:

> Completely - but how do I render the element as json? As soon as I do
> $this->render('/elements/whatever'); it's returned as straightforward html.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 31 Oct 2012, at 15:28:01, Tilen Majerle 
> wrote:
>
> in both cases return json value and have keys eg. "success" (true/false)
> and "data". If "success" == true, just "print" data, if "success" == false,
> than use data as json, and decode that string and print validation errors,
> or generate string in controller for errors and print it..understand ?
> --
> Lep pozdrav, Tilen Majerle
> http://majerle.eu
>
>
>
> 2012/10/31 Jeremy Burns 
>
>> Not an expert at jQuery, but getting there.
>>
>> I'm submitting data to a controller function that saves a record via
>> ajax. If the save works, I'm rendering an element, which then appears back
>> in the ajax form as html ready to be placed into a dom element. All good -
>> that works fine. But if the save fails I want to return an array that
>> includes the validation errors - that really ought to be json. So on
>> success I want html, on error I want json - and I can't have both.
>>
>> How do I either (i) render the element but have it returned as json (and
>> ideally tack in a 'success' key that I can check in the jQuery) or (ii)
>> otherwise determine the success/error state when html has been returned to
>> the jQuery?
>>
>> --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com.
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>
>>
>>
>
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Extending Controller

2012-10-24 Thread Jonathan Sundquist
Why would you want to extend that controller if all you are doing is
putting specific functions within the new one?  You need to think how
complex does your solution need to be.  If the user is editing their own
information, which could include updating their password, I would think
that should be within the user controller.  Same goes for forgot your
password. If you are at the login screen and forgot your password I would
imagine you would also include that functionality within your users
controller.

I guess what I am getting at is thinking of it as a functional space.  Your
controller should encompass everything that there is about a user, this
could include logging in, editing ones information, forgetting ones
password, etc.

On Wed, Oct 24, 2012 at 3:16 PM, Advantage+  wrote:

> How can I extend a controller?
>
> ** **
>
> I want to create a PasswordsController to extend UsersController.
>
> PasswordsController has a few specific functions to update, forgot, change
> password and would like to keep them separate from the UsersController
> since they are rather specific operations.
>
> ** **
>
> Is it possible to extend Passwords from Users other than var $uses -
> array('User')?
>
> ** **
>
> Thanks,
>
> Dave
>
> ** **
>
> ** **
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Get Data From Associations

2012-10-22 Thread Jonathan Sundquist
Specifically look at the following within the cake book

http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#creating-and-destroying-associations-on-the-fly

On Mon, Oct 22, 2012 at 12:29 PM, Jonathan Sundquist
wrote:

> Change the join type to an outer join instead of an inner join.  In order
> to do this within your controller before you make the query you will need
> to flip either your belongsTo or hasMany depending on which way you have
> your model set up.
>
>
> On Mon, Oct 22, 2012 at 12:27 PM, lowpass  wrote:
>
>> I think the simplest approach would be to use counterCache. Then you
>> could do a find on Categories where the count is 0.
>>
>> On Mon, Oct 22, 2012 at 1:00 PM, ecko usil  wrote:
>> > Categories has many articles. How can I get list all categories with
>> > conditions categories doesn't have any articles?
>> >
>> > thanks in advance.
>> > regards ucil
>> >
>> > --
>> > Like Us on FaceBook https://www.facebook.com/CakePHP
>> > Find us on Twitter http://twitter.com/CakePHP
>> >
>> > ---
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "CakePHP" group.
>> > To post to this group, send email to cake-php@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > cake-php+unsubscr...@googlegroups.com.
>> > Visit this group at http://groups.google.com/group/cake-php?hl=en.
>> >
>> >
>>
>> --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com.
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>
>>
>>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Get Data From Associations

2012-10-22 Thread Jonathan Sundquist
Change the join type to an outer join instead of an inner join.  In order
to do this within your controller before you make the query you will need
to flip either your belongsTo or hasMany depending on which way you have
your model set up.

On Mon, Oct 22, 2012 at 12:27 PM, lowpass  wrote:

> I think the simplest approach would be to use counterCache. Then you
> could do a find on Categories where the count is 0.
>
> On Mon, Oct 22, 2012 at 1:00 PM, ecko usil  wrote:
> > Categories has many articles. How can I get list all categories with
> > conditions categories doesn't have any articles?
> >
> > thanks in advance.
> > regards ucil
> >
> > --
> > Like Us on FaceBook https://www.facebook.com/CakePHP
> > Find us on Twitter http://twitter.com/CakePHP
> >
> > ---
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com.
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com.
> > Visit this group at http://groups.google.com/group/cake-php?hl=en.
> >
> >
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Error: Call to a member function find() on a non-object

2012-10-18 Thread Jonathan Sundquist
Yes going through phpMyAdmin would be a good test.  if that works, awesome.
 Is php my admin and your cake application on the same server?  Could be a
permission issue going between servers.

Yes there should be only one database.php file within your config file.
 Are the file permissions set up correctly?

And now that I read your next comment my question is semi invalid. We need
to go back to the table / user permissions.

What do you mean by you can see the app in your browser no problem?  Does
this mean you can see it with the other database?

On Thu, Oct 18, 2012 at 6:28 PM, Russell Brown wrote:

> I can connect to it via phpMyAdmin and see the databases and tables.  Is
> that what you mean by connecting to it directly?
>
> I suspect my database config must be the problem yes.
>
> In the config folder under the app I have my database.php file setup.  I
> wonder if there is another database config I should be looking at?
>
> I have another database.php file setup exactly the same way except for the
> database name and it works fine.  I can see the app in the browser no
> problem.
>
>
>
>
>
> On Thursday, October 18, 2012 6:13:47 PM UTC-5, jsundquist wrote:
>
>> Did you set up your database config correctly?  Try connecting to it
>> directly to see if your database is up and your connection information is
>> correct.
>>
>> On Thu, Oct 18, 2012 at 6:06 PM, Russell Brown wrote:
>>
>>> It does give me the line number.  However, I just noticed that SQL Logs
>>> says "Warning - No active database connection"
>>>
>>> When I look at variables I see:  *$request->data*(empty)
>>>
>>> Somehow I am not connected to the database and/or table.
>>>
>>> On Thursday, October 18, 2012 5:47:21 PM UTC-5, phpirate wrote:
>>>
 Does it say at what line the error occurs? What does your web server's
 error log say?

 On Thu, Oct 18, 2012 at 6:14 PM, Russell Brown 
 wrote:

> Yes.  I did a clean install and still get the error.
>
> I get the DebugKit toolbar -it works fine.
>
> For some reason I can't just type debug($this); before and after the
> variable I want to check.  Still gives me a syntax error.
>
> On Thursday, October 18, 2012 3:50:23 PM UTC-5, cricket wrote:
>
>> Any other info on what the syntax error is? I'm beginning to think
>> something is really borked with your install.
>>
>> On Thu, Oct 18, 2012 at 4:28 PM, Russell Brown <
>> ru...@russsoftware.com> wrote:
>> > When I put debug($this); in the file, however I get a syntax error
>> on that
>> > line.
>> >
>> > I am using Cake 2.2.2 and I have installed the DebugKit too.
>> >
>> >
>> >
>> > On Monday, October 15, 2012 8:27:58 PM UTC-5, Wallace Cardoso
>> Colaço Ricardo
>> > wrote:
>> >>
>> >> Try to debug what objects(Models) are being loaded...
>> >>
>> >> Doing so you will know for sure the name of the instance Address.
>> >>
>> >> Put this before your find:
>> >>
>> >> debug($this);
>> >>
>> >> On Oct 15, 2012, at 9:23 PM, Russell Brown wrote:
>> >>
>> >> Here is my index.ctp view file in the View\Addresses folder:
>> >>
>> >> > >> echo $this->Html->link('Add New Address', array('action'=>'add'));
>> >> ?>
>> >> 
>> >>   
>> >>  Id
>> >>  First Name
>> >>  Last Name
>> >>  Email
>> >>  Phone
>> >>  Address
>> >>  Options
>> >>   
>> >>
>> >> > >>   foreach ( $address_list as $line ) {
>> >>   $address = $line['Address'];
>> >> echo
>> >> ''.
>> >> ''.$address['id'].''.
>> >> ''.$this->Html->link($**address['first_name'],
>> array('action'=>'view',
>> >> 'id'=>$address['id'])).''**.
>> >> ''.$address['last_name'].'**'.
>> >> ''.$address['email'].''.
>> >> ''.$address['phone'].''.
>> >> ''.$address['address'].''.
>> >> ''.$this->Html->link('**edit', array('action'=>'edit',
>> >> 'id'=>$address['id'])).' '.
>> >>
>> >> $this->Html->link('delete', array('action'=>'delete',
>> >> 'id'=>$address['id'])).''**.
>> >> '';
>> >>
>> >>   };
>> >> ?>
>> >> 
>> >>
>> >>
>> >> On Monday, October 15, 2012 6:58:52 PM UTC-5, Russell Brown wrote:
>> >>>
>> >>> Error:  Call to a member function find() on a non-object
>> >>> File:  
>> >>> c:\wamp\www\cake222\app\**Controller\**AddressesController.php
>>
>> >>>
>> >>> I get the error on the $this->set('address_list',
>> >>> $this->Address->find('all')) line below:
>> >>>
>> >>> Partial listing of my AddressesController file:
>> >>>
>> >>> > >>> class AddressesController extends AppController {
>> >>>   var $name = 'addresses';
>> >>>
>> >>>  function index($id = null) {
>> >>> $this->set('address_list', $this->Address->find('all'));
>> >>>   }
>> >>>
>> >>> I have a controller called Addresse

Re: Error: Call to a member function find() on a non-object

2012-10-18 Thread Jonathan Sundquist
Did you set up your database config correctly?  Try connecting to it
directly to see if your database is up and your connection information is
correct.

On Thu, Oct 18, 2012 at 6:06 PM, Russell Brown wrote:

> It does give me the line number.  However, I just noticed that SQL Logs
> says "Warning - No active database connection"
>
> When I look at variables I see:  *$request->data*(empty)
>
> Somehow I am not connected to the database and/or table.
>
> On Thursday, October 18, 2012 5:47:21 PM UTC-5, phpirate wrote:
>
>> Does it say at what line the error occurs? What does your web server's
>> error log say?
>>
>> On Thu, Oct 18, 2012 at 6:14 PM, Russell Brown wrote:
>>
>>> Yes.  I did a clean install and still get the error.
>>>
>>> I get the DebugKit toolbar -it works fine.
>>>
>>> For some reason I can't just type debug($this); before and after the
>>> variable I want to check.  Still gives me a syntax error.
>>>
>>> On Thursday, October 18, 2012 3:50:23 PM UTC-5, cricket wrote:
>>>
 Any other info on what the syntax error is? I'm beginning to think
 something is really borked with your install.

 On Thu, Oct 18, 2012 at 4:28 PM, Russell Brown 
 wrote:
 > When I put debug($this); in the file, however I get a syntax error on
 that
 > line.
 >
 > I am using Cake 2.2.2 and I have installed the DebugKit too.
 >
 >
 >
 > On Monday, October 15, 2012 8:27:58 PM UTC-5, Wallace Cardoso Colaço
 Ricardo
 > wrote:
 >>
 >> Try to debug what objects(Models) are being loaded...
 >>
 >> Doing so you will know for sure the name of the instance Address.
 >>
 >> Put this before your find:
 >>
 >> debug($this);
 >>
 >> On Oct 15, 2012, at 9:23 PM, Russell Brown wrote:
 >>
 >> Here is my index.ctp view file in the View\Addresses folder:
 >>
 >> >>> >> echo $this->Html->link('Add New Address', array('action'=>'add'));
 >> ?>
 >> 
 >>   
 >>  Id
 >>  First Name
 >>  Last Name
 >>  Email
 >>  Phone
 >>  Address
 >>  Options
 >>   
 >>
 >> >>> >>   foreach ( $address_list as $line ) {
 >>   $address = $line['Address'];
 >> echo
 >> ''.
 >> ''.$address['id'].''.
 >> ''.$this->Html->link($**addr**ess['first_name'],
 array('action'=>'view',
 >> 'id'=>$address['id'])).''.
 >> ''.$address['last_name'].''.
 >> ''.$address['email'].''.
 >> ''.$address['phone'].''.
 >> ''.$address['address'].''.
 >> ''.$this->Html->link('**edit**', array('action'=>'edit',
 >> 'id'=>$address['id'])).' '.
 >>
 >> $this->Html->link('delete', array('action'=>'delete',
 >> 'id'=>$address['id'])).''.
 >> '';
 >>
 >>   };
 >> ?>
 >> 
 >>
 >>
 >> On Monday, October 15, 2012 6:58:52 PM UTC-5, Russell Brown wrote:
 >>>
 >>> Error:  Call to a member function find() on a non-object
 >>> File:  c:\wamp\www\cake222\app\**Contr**oller\**AddressesController.php

 >>>
 >>> I get the error on the $this->set('address_list',
 >>> $this->Address->find('all')) line below:
 >>>
 >>> Partial listing of my AddressesController file:
 >>>
 >>> >>> >>> class AddressesController extends AppController {
 >>>   var $name = 'addresses';
 >>>
 >>>  function index($id = null) {
 >>> $this->set('address_list', $this->Address->find('all'));
 >>>   }
 >>>
 >>> I have a controller called AddressesController.php.  I have a Model
 >>> called Address.php.  The table is called addresses.
 >>>
 >>> I am using Cake 2.2.2 and PHP 5.3.8 and Apache 2.2.21 and MySQL
 5.5.16
 >>>
 >>
 >> --
 >> Like Us on FaceBook 
 >> https://www.facebook.com/**CakeP**HP
 >> Find us on Twitter http://twitter.com/CakePHP
 >>
 >> ---
 >> You received this message because you are subscribed to the Google
 Groups
 >> "CakePHP" group.
 >> To post to this group, send email to cake...@googlegroups.com.
 >> To unsubscribe from this group, send email to
 >> cake-php+u...@googlegroups.com.
 >>
 >> Visit this group at http://groups.google.com/**group**
 /cake-php?hl=en .
 >>
 >>
 >>
 >>
 > --
 > Like Us on FaceBook 
 > https://www.facebook.com/**CakeP**HP
 > Find us on Twitter http://twitter.com/CakePHP
 >
 > ---
 > You received this message because you are subscribed to the Google
 Groups
 > "CakePHP" group.
 > To post to this group, send email to cake...@googlegroups.com.
 > To unsubscribe from this group, send email to
 > cake-php+u...@**googlegroups.com**.
 > Visit this group at 
 > http://groups.google.com/**group**/cake-php?hl=en.

 >
 >

>>

Re: Error: Call to a member function find() on a non-object

2012-10-18 Thread Jonathan Sundquist
Sorry. Do a var_dump($this)

- "The cold winds are rising"
On Oct 18, 2012 3:29 PM, "Russell Brown"  wrote:

> When I put debug($this); in the file, however I get a syntax error on that
> line.
>
> I am using Cake 2.2.2 and I have installed the DebugKit too.
>
>
>
> On Monday, October 15, 2012 8:27:58 PM UTC-5, Wallace Cardoso Colaço
> Ricardo wrote:
>>
>> Try to debug what objects(Models) are being loaded...
>>
>> Doing so you will know for sure the name of the instance Address.
>>
>> Put this before your find:
>>
>> debug($this);
>>
>> On Oct 15, 2012, at 9:23 PM, Russell Brown wrote:
>>
>> Here is my index.ctp view file in the View\Addresses folder:
>>
>> > echo $this->Html->link('Add New Address', array('action'=>'add'));
>> ?>
>> 
>>   
>>   Id
>>   First Name
>>   Last Name
>>   Email
>>   Phone
>>   Address
>>   Options
>>   
>>
>> >   foreach ( $address_list as $line ) {
>>   $address = $line['Address'];
>> echo
>> ''.
>> ''.$address['id'].''.
>> ''.$this->Html->link($**address['first_name'],
>> array('action'=>'view', 'id'=>$address['id'])).''**.
>> ''.$address['last_name'].'**'.
>> ''.$address['email'].''.
>> ''.$address['phone'].''.
>> ''.$address['address'].''.
>> ''.$this->Html->link('**edit', array('action'=>'edit',
>> 'id'=>$address['id'])).' '.
>>
>> $this->Html->link('delete', array('action'=>'delete',
>> 'id'=>$address['id'])).''**.
>>  '';
>>
>>   };
>> ?>
>> 
>>
>>
>> On Monday, October 15, 2012 6:58:52 PM UTC-5, Russell Brown wrote:
>>>
>>> Error:  Call to a member function find() on a non-object
>>> File:  c:\wamp\www\cake222\app\**Controller\**AddressesController.php
>>>
>>> I get the error on the $this->set('address_list',
>>> $this->Address->find('all')) line below:
>>>
>>> Partial listing of my AddressesController file:
>>>
>>> >> class AddressesController extends AppController {
>>>   var $name = 'addresses';
>>>
>>>  function index($id = null) {
>>> $this->set('address_list', $this->Address->find('all'));
>>>   }
>>>
>>> I have a controller called AddressesController.php.  I have a Model
>>> called Address.php.  The table is called addresses.
>>>
>>> I am using Cake 2.2.2 and PHP 5.3.8 and Apache 2.2.21 and MySQL 5.5.16
>>>
>>>
>> --
>> Like Us on FaceBook 
>> https://www.facebook.com/**CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake...@googlegroups.com.
>> To unsubscribe from this group, send email to cake-php+u...@**
>> googlegroups.com.
>> Visit this group at 
>> http://groups.google.com/**group/cake-php?hl=en
>> .
>>
>>
>>
>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Block Rendering

2012-10-18 Thread Jonathan Sundquist
Check to see if the request is ajax or not.

http://api20.cakephp.org/class/request-handler-component#method-RequestHandlerComponentisAjax

On Thu, Oct 18, 2012 at 1:40 PM, Advantage+  wrote:

> How can I render a view block if the request is not ajax?
>
> ** **
>
> I have a main nav which requests standard html call and loads a page with
> a sidenav block.
>
> The sidenav requests for each mainnav section are all ajax, but when it
> loads the pages for any of the sidenav links it loads the sidenav block
> again since its defined in the view.
>
> ** **
>
> I need to only load the sidenav if the request is not ajax.
>
> ** **
>
> Any ideas?
>
> ** **
>
> Thanks,
>
> Dave
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Error: Call to a member function find() on a non-object

2012-10-18 Thread Jonathan Sundquist
The error has nothing to do with your view.  It will have to do with either
your model or your controller.  As people have previously stated can you do
a debug($this) before and after your find? It will show if the Address
model is actually loaded or not.  If its not loaded then your find method
will for sure not work.

On Thu, Oct 18, 2012 at 12:09 PM, Russell Brown wrote:

> Ok.  I changed the index.ctp as shown in the pertinent section of code as
> follows (but I still get the same error):
>
>  foreach ( $address_list as $line ) {
>   $address = $line['Address'];
>  echo
> ''.
> ''.$address[0]['id'].''.
>  /* ''.$this->Html->link($address['first_name'],
> array('action'=>'view', 'id'=>$address['id'])).''.
>  */
>
> ''.$this->Html->link($address['first_name'], array('action'=>'view',
> 'id'=>$address[0]['id'])).''.
>  ''.$address['last_name'].''.
> ''.$address['email'].''.
>  ''.$address['phone'].''.
> ''.$address['address'].''.
>  ''.$this->Html->link('edit', array('action'=>'edit',
> 'id'=>$address[0]['id'])).' '.
>
> $this->Html->link('delete', array('action'=>'delete',
> 'id'=>$address[0]['id'])).''.
>
>
>
> On Wednesday, October 17, 2012 9:27:07 AM UTC-5, PlanoCoder wrote:
>>
>> Pull your Array
>>
>> you may need to change
>>
>> ''.$address['id'].''.
>>
>> to
>>
>> ''.$address[0]['id'].''.
>>
>> or something like that
>>
>>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Cakephp find order by then group by

2012-10-18 Thread Jonathan Sundquist
The group by is throwing it off.  When you use a group and an order
together you typically do not get the expected result. In order to get the
desired results you might need to do an inner select.  I don't remember the
correct way to do it off the top of my head though to get what you are
looking for.  I do know though that the group by clause is what is causing
your issues.

On Thu, Oct 18, 2012 at 4:47 AM, anwar korti  wrote:

> Hello In a Message controller I try to display the latest message of each
> user (sender) for a connected one (receiver)  I try this but I still find
> the first entry. Thank you for your help
>
> Messages table:
>
>
>- id
>- user_id -> Sender
>- receiver_id -> receiver
>- content
>- created -> datetime
>- statut -> read or not
>
> $this->set('messages', $this->Message->find('all',
>
> array(
> 'conditions' => array('Message.receiver_id'=>$user),
> 'order' => array('Message.created desc'),
> 'group'=>'Message.user_id')));
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Missing Controller ApplicationNameController

2012-10-18 Thread Jonathan Sundquist
Assuming you are using CakePHP 2.x you could create a basic route as such:

Router::connect('/todo/:controller/:action/:id');

Put that within your routes.php config file.

On Thu, Oct 18, 2012 at 5:35 AM, Webmaster Cosinus wrote:

> it doesn't chnage anything
>
>
> On Thu, Oct 18, 2012 at 12:22 PM, Jonathan Sundquist  > wrote:
>
>> You needs to tell the application what your base url is within the config
>> file so that it knows how to handle the routing correctly.
>>
>> - "The cold winds are rising"
>> On Oct 18, 2012 2:50 AM, "cosinusweb"  wrote:
>>
>>> Hello
>>>
>>> I'm trying to install cakephp
>>>
>>> In httpdf.conf
>>> I must use an alias this is mandatory for my project
>>> Alias /toto "c:/wamp/www/f/app/webroot"
>>> 
>>> Options FollowSymLinks
>>> AllowOverride All
>>> Order deny,allow
>>> Allow from All
>>> 
>>>
>>>
>>> But when i go tho the application
>>>
>>> I've got the folloing message
>>>
>>> >> class TotoController extends AppController {
>>>
>>> }
>>>
>>> Toto is the applicationName not the controller
>>>
>>> I really do not i=undesrtant what's going on
>>>
>>> Any ideas ?
>>>
>>> Thanks
>>>
>>>
>>>  --
>>> Like Us on FaceBook https://www.facebook.com/CakePHP
>>> Find us on Twitter http://twitter.com/CakePHP
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "CakePHP" group.
>>> To post to this group, send email to cake-php@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>>
>>>
>>>
>>  --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com.
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>
>>
>>
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Missing Controller ApplicationNameController

2012-10-18 Thread Jonathan Sundquist
You needs to tell the application what your base url is within the config
file so that it knows how to handle the routing correctly.

- "The cold winds are rising"
On Oct 18, 2012 2:50 AM, "cosinusweb"  wrote:

> Hello
>
> I'm trying to install cakephp
>
> In httpdf.conf
> I must use an alias this is mandatory for my project
> Alias /toto "c:/wamp/www/f/app/webroot"
> 
> Options FollowSymLinks
> AllowOverride All
> Order deny,allow
> Allow from All
> 
>
>
> But when i go tho the application
>
> I've got the folloing message
>
>  class TotoController extends AppController {
>
> }
>
> Toto is the applicationName not the controller
>
> I really do not i=undesrtant what's going on
>
> Any ideas ?
>
> Thanks
>
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Migration Issue

2012-10-13 Thread Jonathan Sundquist
Take a look at this tutorial / example.
http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-controlled-application/simple-acl-controlled-application.htmlnote
how the acrsas has changed. It looks like you may have cake 1.3
syntex.

- "The cold winds are rising"
On Oct 13, 2012 6:46 PM, "CCorreia"  wrote:

> Hello. I've just joined a project that is currently using cake as it's
> framework, and one of the tasks assigned to me was to migrate the existing
> 2.0 version of cake to the latest (now 2.2.3).
>
> Now a situation came up when moving from my windows localhost to the
> server. It starts to fail right at the login. While debugging I did find
> out that it's losing "something" along the way, I'll try to explain better.
>
> This is where the call
> originates: $this->User->contain(array('UserInRole'=>array('Role')));
>
> This are the 3 models:
>
> class User extends AppModel {
> var $name = 'User';
> var $primaryKey = 'UserID';
> public $actsAs = array( 'Containable' );
> public $hasMany = array(
> 'UserInRole' => array(
> 'className' => 'UserInRole',
> 'foreignKey'=> 'UserID',
> 'dependent' => false
> )
> );
> ...
>
> class UserInRole extends AppModel {
> var $name = 'UserInRole';
> var $primaryKey = array( 'UserID','RoleID');
> public $actsAs = array( 'Containable' );
> public $belongsTo = array(
> 'Role' => array(
> 'className' => 'Role',
> 'foreignKey'=> 'RoleID',
> 'dependent' => false
> ),
> 'User' => array(
> 'className' => 'User',
> 'foreignKey'=> 'UserID',
> 'dependent' => false
> )
> );
> }
>
> class Role extends AppModel {
> var $name = 'Role';
> var $primaryKey = 'RoleID';
> var $hasMany = array(
>   'UserInRole' => array(
> 'className' => 'UserInRole',
> 'foreignKey'=> 'RoleID',
> 'counterCache' => true,
> 'dependent' =>true
> )
> );
> }
>
>
> This is the error when running on linux:
>
> *Error: * SQLSTATE[42000]: Syntax error or access violation: 1064 You
> have an error in your SQL syntax; check the manual that corresponds to your
> MySQL server version for the right syntax to use near 'contain' at line 1
>
> *SQL Query: * contain
>
> For this error if I debug I see that it's trying to execute a ' contain'
> query.
>
> But on windows the same executes with the following query: "SHOW FULL
> COLUMNS FROM `pmgcms2_cms`.`cms_users`"
>
>
> I've been going at this for ages, but I haven't had any luck so far, so I
> was hoping there's someone that might have ever had the same issue and can
> give me some sort of clue. I'm lost right now.
>
>
> Thanks
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Delete Foreign Key

2012-10-12 Thread Jonathan Sundquist
What does the code look like?

- "The cold winds are rising"
On Oct 12, 2012 6:31 AM, "Webmaster Cosinus"  wrote:

> I've a table called "recharges"  and onother called "montant_recharges"
>
> In the recharge table I've a filed called montant_recharge_id which link
> the two tables.
>
> When I delete a row in "montant_recharges" the associated row in recharges
> are deleted, i don't want rows in recharge to be deleted neither in
> montant_recharges since they are linked
>
>
> On Fri, Oct 12, 2012 at 1:02 PM, Tilen Majerle wrote:
>
>> i don't understand what u want..
>> --
>> Lep pozdrav, Tilen Majerle
>> http://majerle.eu
>>
>>
>>
>> 2012/10/12 cosinusweb 
>>
>>> Hello,
>>>
>>> I' ve a table "recharge" which contain an id field from an other table.
>>>
>>> When I try to delete the linked id from mysql it does not work which is
>>> normal because this id is already in use bu if i delete the liked id with
>>> cake php the all row from "recharges" is deleted
>>>
>>> It s like cake does not take into acount my constraint
>>>
>>> Why that ?
>>>
>>> --
>>> Like Us on FaceBook https://www.facebook.com/CakePHP
>>> Find us on Twitter http://twitter.com/CakePHP
>>>
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "CakePHP" group.
>>> To post to this group, send email to cake-php@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>>
>>>
>>>
>>
>>  --
>> Like Us on FaceBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com.
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>
>>
>>
>
>  --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: forn create with ID

2012-10-03 Thread Jonathan Sundquist
Is that user id being held within a session object?  If it is why not place
a beforeInsert function within your message model and add the user id there
to the data being sent in?

On Wed, Oct 3, 2012 at 7:40 AM, jodator  wrote:

> this one will be more consistent with URL routing:
>
> Form->create('Message', array('action' => array('action'
> => 'compose', $user_obj['User']['id'] ))); ?>
>
> Same array syntax as for html->url();
>
>
> On Wednesday, October 3, 2012 12:26:06 PM UTC+2, Chris wrote:
>>
>> Thank you Marcus !! it works,
>> actually I have tried that, but couldn't think of that " / " right after
>> compose...
>>
>> Thanks again,...
>>
>>
>> On Wednesday, October 3, 2012 1:10:52 AM UTC-7, marco metal wrote:
>>>
>>> Hi Chris
>>>
>>> Try this
>>>
>>> Form->create('Message', array('action' =>
>>> 'compose/'.$user_obj['User']['**id'] )); ?>
>>>
>>>
>>>
>>>
>>>
>>> Enjoy,
>>>
>>> Marcus
>>>
>>  --
> Like Us on FacekBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Accessing extra fiends on many to many relationship table

2012-09-29 Thread Jonathan Sundquist
If you need access to more data with in the joining table you will not be
able to use a habtm model. You will need to change it into a has many model.

- "The cold winds are rising"
On Sep 29, 2012 9:06 PM, "gosukiwi"  wrote:

> This is what I've got, I have a table named Users, and a table named
> Lessons, users can give lessons, and the can also suscribe to other user's
> lessons.
> So my schema is something like this
>
> users table
> id  | username
> 1   | mike
>
> lessons table
> id | name | teacher_id
> 1  | ...  |  1
>
> So my users_lessons table looks something like this
> user_id | lesson_id | confirmed
> 1  | 1 | false
> 2  | 1 | true
> 1  | 2 | false
>
> So far I can map all the users from a lesson, and all the lessons from a
> user, but given a lesson, i cannot get the status of each user signed up to
> that lesson, how can I do that?
>
> My Lesson model looks something like this
>
> public $hasAndBelongsToMany = array(
> 'Students' =>
> array(
> 'className'  => 'User',
> 'joinTable'  => 'users_lessons',
> 'foreignKey' => 'lesson_id',
> 'associationForeignKey'  => 'user_id',
> 'unique' => true,
> 'conditions' => '',
> 'fields' => '',
> 'order'  => '',
> 'limit'  => '',
> 'offset' => '',
> 'finderQuery'=> '',
> 'deleteQuery'=> '',
> 'insertQuery'=> ''
> )
> );
>
>  --
> Like Us on FacekBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Hello i need help in database schema ready

2012-09-27 Thread Jonathan Sundquist
I guess I question what you would like this data set for.  Looking at this
from a large scale of the United States I know there are a number of city
names that are duplicated across multiple states.  Now I don't know if this
is the same across the rest of the world but you may need to rethink what
you are looking to implement. You may need to set up your relational table
from countries to states/province to cities.

Also a quick search of Google reveals this page.
http://www.maxmind.com/app/worldcities which can be found on this thread
http://forums.overclockers.com.au/showthread.php?t=899135 .

On Thu, Sep 27, 2012 at 10:36 AM, Peter Nassef wrote:

> i need three table .sql content
> First: All Countries
> Secound: All Cities Related to Countries
> Third :Units Measurement
>
> On Thu, Sep 27, 2012 at 5:08 PM, Maliko V  wrote:
>
>> Can you elaborate what do you need exactly? Us to show you how u create
>> this schema or model using bake ?
>>
>> VM
>>
>> Sent from iPhone smartphone
>>
>> On 2012-09-27, at 11:02 AM, Peter Nassef  wrote:
>>
>> Hello cakephp member
>>
>> i need table content all country and all cities relate to this countries
>> and other table content units measurement
>>
>>
>> and Thanks :)
>>
>> --
>> Like Us on FacekBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com.
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>
>>
>>
>>  --
>> Like Us on FacekBook https://www.facebook.com/CakePHP
>> Find us on Twitter http://twitter.com/CakePHP
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com.
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com.
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>
>>
>>
>
>
>
> --
>
> __
> Peter Nassef
> Mob.:+2 0122 561 6354
> E-mail: peter.nas...@gmail.com
> Web Designer, Developer: XHTML, CSS, jQuary, Ajax, JavaScript, PHP& MySql
>
>  --
> Like Us on FacekBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Hello i need help in database schema ready

2012-09-27 Thread Jonathan Sundquist
I don't know how likely you will find a country and all cities within each
specific country.  You are more likely to find database schemas out there
that give you countries with all related states/provinces within.

On Thu, Sep 27, 2012 at 10:08 AM, Maliko V  wrote:

> Can you elaborate what do you need exactly? Us to show you how u create
> this schema or model using bake ?
>
> VM
>
> Sent from iPhone smartphone
>
> On 2012-09-27, at 11:02 AM, Peter Nassef  wrote:
>
> Hello cakephp member
>
> i need table content all country and all cities relate to this countries
> and other table content units measurement
>
>
> and Thanks :)
>
> --
> Like Us on FacekBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>
>  --
> Like Us on FacekBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: hasMany through - how to retrieve my data?

2012-09-16 Thread Jonathan Sundquist
Why are you using a hasMany instead of a hasAndBelongsToMany? You wouldn't
need the id column as you two ideas together would be your index.

- "The cold winds are rising"
On Sep 16, 2012 5:17 PM, "Nvp"  wrote:

> Hi!
> I built DB with tables:
>
> *restaurants* - main table
>
> *kitchens* - second table
>
> *kitchen_restaurants* - join table with fields: id, kitchen_id,
> restaurant_id
>
> *Model/Restaurant.php*:
> public $hasMany = array(
> 'KitchenRestaurant'
> );
>
> *Model/Kitchen.php*:
> public $hasMany = array(
> 'KitchenRestaurant'
> );
>
> *Model/KitchenRestaurant.php*:
> public $belongsTo = array(
> 'Restaurant', 'Kitchen'
> );
>
> The problem is that I have separate controller for my main page in which I
> need to retrieve data from this models with complex conditions.
>
> I added
>
> public $uses = array('Restaurant');
>
> to my main page controller and here comes the part where I need your
> advices.
>
> I need to select only those restaurants where kitchen = $id. I've tried to
> add
> public function index() {
> $this->set('rests', $this->Restaurant->find('all', array( 'conditions' =>
> array('Restaurant.active' => "1", 'KitchenRestaurant.id' => "1") ))); }
>
> but I get Column not found error. How to properly retrieve data in hasMany
> through or HABTM?
> Thanks!
>
> --
> Like Us on FacekBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>
>

-- 
Like Us on FacekBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Site loads but console plugin schema fails

2012-09-12 Thread Jonathan Sundquist
I finally figured out what I was doing wrong. I needed to specify the app
path when trying to run the console command.  Once specified I was able to
create the schema with out any issues.

On Wed, Sep 12, 2012 at 9:49 PM, Jonathan Sundquist wrote:

> This evening I was trying to set up a site using a plugin and I am
> actually able to get a  majority of the site to load minus a few setup
> items I still need to complete however now when I try to set up the schema
> using the cake console it says it cannot find the plugin at all.  What
> could I be doing wrong? I've done a search with little to no help. Below is
> the error message that I receive.
>
> jsundquist@merlin:/var/www/mwp/lib/Cake/Console$ ./cake schema create -p
> BostonConference
>
> Welcome to CakePHP v2.1.5 Console
> ---
> App : Console
> Path: /var/www/mwp/lib/Cake/Console/
> ---
> Cake Schema Shell
> ---
> Error: Plugin BostonConference could not be found.
> #0 /var/www/mwp/lib/Cake/Model/CakeSchema.php(128):
> CakePlugin::path('BostonConferenc...')
> #1 /var/www/mwp/lib/Cake/Model/CakeSchema.php(98): CakeSchema->build(Array)
> #2 /var/www/mwp/lib/Cake/Console/Command/SchemaShell.php(99):
> CakeSchema->__construct(Array)
> #3 /var/www/mwp/lib/Cake/Console/Shell.php(378): SchemaShell->startup()
> #4 /var/www/mwp/lib/Cake/Console/ShellDispatcher.php(177):
> Shell->runCommand('create', Array)
> #5 /var/www/mwp/lib/Cake/Console/ShellDispatcher.php(69):
> ShellDispatcher->dispatch()
> #6 /var/www/mwp/lib/Cake/Console/cake.php(41): ShellDispatcher::run(Array)
> #7 {main}
>
>
> Again the site loads when I hit the url however I can't seem to get it to
> be found within the cake console.  Any help that you can provide would be
> very much apperciated.
>
> Thanks,
>
> Jon
>

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Site loads but console plugin schema fails

2012-09-12 Thread Jonathan Sundquist
This evening I was trying to set up a site using a plugin and I am actually
able to get a  majority of the site to load minus a few setup items I still
need to complete however now when I try to set up the schema using the cake
console it says it cannot find the plugin at all.  What could I be doing
wrong? I've done a search with little to no help. Below is the error
message that I receive.

jsundquist@merlin:/var/www/mwp/lib/Cake/Console$ ./cake schema create -p
BostonConference

Welcome to CakePHP v2.1.5 Console
---
App : Console
Path: /var/www/mwp/lib/Cake/Console/
---
Cake Schema Shell
---
Error: Plugin BostonConference could not be found.
#0 /var/www/mwp/lib/Cake/Model/CakeSchema.php(128):
CakePlugin::path('BostonConferenc...')
#1 /var/www/mwp/lib/Cake/Model/CakeSchema.php(98): CakeSchema->build(Array)
#2 /var/www/mwp/lib/Cake/Console/Command/SchemaShell.php(99):
CakeSchema->__construct(Array)
#3 /var/www/mwp/lib/Cake/Console/Shell.php(378): SchemaShell->startup()
#4 /var/www/mwp/lib/Cake/Console/ShellDispatcher.php(177):
Shell->runCommand('create', Array)
#5 /var/www/mwp/lib/Cake/Console/ShellDispatcher.php(69):
ShellDispatcher->dispatch()
#6 /var/www/mwp/lib/Cake/Console/cake.php(41): ShellDispatcher::run(Array)
#7 {main}


Again the site loads when I hit the url however I can't seem to get it to
be found within the cake console.  Any help that you can provide would be
very much apperciated.

Thanks,

Jon

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.




Re: How to call a function from another controlle?

2012-09-05 Thread Jonathan Sundquist
Create an app controller and have both controllers extend it. Then move
your ping function into the app controller.

- "The cold winds are rising"
On Sep 5, 2012 6:06 PM, "Salines"  wrote:

> eg I have a plugin called Test, and the class named TestController, where
> I have a ping function  , public function ping() {...}
>
> how can I call the ping function from app controller beforeFilter function?
>
> public function beforeFilter(){
>  // call Plugin/Test/TestController/ping() ???
> }
>
> Thanx
>
>
>  --
> 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.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>
>

-- 
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.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.