Tuesday, November 30, 2010

Re: Associations in app_controller.php

Hi,

Are you sure that Link model has belongsTo relationship with Menu model?

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Mon, Nov 29, 2010 at 9:33 PM, pablosky <pablo005_1@hotmail.com> wrote:
Hello.

I'm trying to extract data from a table from the app_controller.php.
But the table is related to another table using "belongTo."

This code works:

if (!Cache::read('links')) {
 $this->loadModel('Link');
 $result = $this->Link->find('all', array('fields' =>
array('Link.id', 'Link.name', 'Link.url')));
 Cache::write('links', $result);
}

But this code does not work:

if (!Cache::read('links')) {
 $this->loadModel('Link');
 $result = $this->Link->find('all', array('fields' =>
array('Link.id', 'Link.name', 'Link.url', 'Menu.alias')));
 Cache::write('links', $result);
}

Do not work in app_controller.php relationship?

Thank you!!

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

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

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

calling a view in pop up

hi .,.,.

Can someone please help me with this requirement?

i want to call a view in a pop up window.
pop up window must be popped up when user clicks on submit button.
i was searching in the web for the same for past 2 days and got nothing.
Hope i get answer here.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: CakePlate - Boilerplate CakePHP distro

Without downloading it, how do we find out what's included? How would anyone know if you've coded it well (to standards etc)? How easy is it to strip down pieces not needed on a specific project? What's the [Cake] upgrade path like?

Jeremy Burns
Class Outfit

jeremyburns@classoutfit.com
http://www.classoutfit.com

On 30 Nov 2010, at 04:16, ryan.pendergast@gmail.com wrote:

> You know how as a developer each time you create a new web app you
> spend the first few hours downloading, installing, and configuring the
> important add-ons that you need for nearly any production-level
> project? When all you really want to do is get started on your new
> kick-ass idea?
>
> That's why a friend and I decided to do something about it. We're
> launching CakePlate, a open source distribution of CakePHP that's
> ready to rock, right out of the box.
>
> learn more and read the full announcement at http://cakeplate.posterous.com/
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

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

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

Re: Console bake - modify templates

Dear Sophy

When I use that, it is a kind of submit or what?

$.ajax({
                                    type: "POST",
                                    url: "replace_expenses",
                                    data: dataString,
                                    success: function(results) {
                                        $('#ajax_update').html("<div id='message'></div>");
                                        $('#message').html(results)
                                        .append()
                                        .hide()
                                        .fadeIn(1500, function() {
                                        });
                                    }
                                });

Dalina,

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Monday, November 29, 2010

Re: CakePlate - Boilerplate CakePHP distro

Looks very nice thank you.

Have you given any thought about ACL/Auth? Any plans on including that?


On Mon, 2010-11-29 at 20:16 -0800, ryan.pendergast@gmail.com wrote:
> You know how as a developer each time you create a new web app you
> spend the first few hours downloading, installing, and configuring the
> important add-ons that you need for nearly any production-level
> project? When all you really want to do is get started on your new
> kick-ass idea?
>
> That's why a friend and I decided to do something about it. We're
> launching CakePlate, a open source distribution of CakePHP that's
> ready to rock, right out of the box.
>
> learn more and read the full announcement at http://cakeplate.posterous.com/
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en


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

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

Re: How do I Find Categories within in Contained Model in CakePHP

I have also posted this at Stackoverflow if you're interested

On 11/30/2010 1:23 PM, Thorpe Obazee wrote:
Hi Everyone,

I had a recent question here regarding Finding records via conditions in habtm. Now, I could search for posts within a category I searched for.

Now, my questions is how to I retrieve the categories of each post if it has two or more categories in this query:

$this->set('posts', $this->Category->find(     'first',     array(         'conditions' => array(             'Category.uri' => $uri         ),         'contain' => array('Post')     ) )); 

I'd imagine something like this:

$this->set('posts', $this->Category->find(     'first',     array(         'conditions' => array(             'Category.uri' => $uri         ),         'contain' => array('Post' => array(             'contain' => 'Category'         ))     ) )); 

Here's what my models look like.

// Category Model class Category extends AppModel {     var $name = 'Category';     var $hasAndBelongsToMany = array(         'Post' => array(             'className' => 'Post'         )     );     var $actsAs = array('Containable'); }  // Post Model     class Post extends AppModel {         var $name = 'Post';         var $hasAndBelongsToMany = array(             'Category' => array(                 'className' => 'Category'             )         );         var $actsAs = array('Containable');         var $virtualFields = array(             'date_posted' => 'DATE_SUB(Post.created, INTERVAL 7 DAY)'         );     } 

A sample data would be like this:

categories id name 1  holidays 2  destinations  posts id title 1  I am a post 2  I am another post  categories_posts post_id category_id 1       1 2       2 2       1 

I am retrieving posts from the Category, 'holidays'.

Array (     [Category] => Array         (             [id] => 3             [name] => holidays             [uri] => holidays             [created] => 2010-11-25 20:43:03             [modified] => 2010-11-25 20:43:03         )      [Post] => Array         (             [0] => Array                 (                     [id] => 1                     [title] => I am a post                 ),             [1] => Array                 (                     [id] => 2                     [title] => I am a another post                 )         ) ) 

The problem is that 1 of the posts are in two categories. I'd like to have that information also available so that I can show this in the view

/categories/view/holidays 
I am a post categories: holidays, destination I am a body text 

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en


How do I Find Categories within in Contained Model in CakePHP

Hi Everyone,

I had a recent question here regarding Finding records via conditions in habtm. Now, I could search for posts within a category I searched for.

Now, my questions is how to I retrieve the categories of each post if it has two or more categories in this query:

$this->set('posts', $this->Category->find(     'first',     array(         'conditions' => array(             'Category.uri' => $uri         ),         'contain' => array('Post')     ) )); 

I'd imagine something like this:

$this->set('posts', $this->Category->find(     'first',     array(         'conditions' => array(             'Category.uri' => $uri         ),         'contain' => array('Post' => array(             'contain' => 'Category'         ))     ) )); 

Here's what my models look like.

// Category Model class Category extends AppModel {     var $name = 'Category';     var $hasAndBelongsToMany = array(         'Post' => array(             'className' => 'Post'         )     );     var $actsAs = array('Containable'); }  // Post Model     class Post extends AppModel {         var $name = 'Post';         var $hasAndBelongsToMany = array(             'Category' => array(                 'className' => 'Category'             )         );         var $actsAs = array('Containable');         var $virtualFields = array(             'date_posted' => 'DATE_SUB(Post.created, INTERVAL 7 DAY)'         );     } 

A sample data would be like this:

categories id name 1  holidays 2  destinations  posts id title 1  I am a post 2  I am another post  categories_posts post_id category_id 1       1 2       2 2       1 

I am retrieving posts from the Category, 'holidays'.

Array (     [Category] => Array         (             [id] => 3             [name] => holidays             [uri] => holidays             [created] => 2010-11-25 20:43:03             [modified] => 2010-11-25 20:43:03         )      [Post] => Array         (             [0] => Array                 (                     [id] => 1                     [title] => I am a post                 ),             [1] => Array                 (                     [id] => 2                     [title] => I am a another post                 )         ) ) 

The problem is that 1 of the posts are in two categories. I'd like to have that information also available so that I can show this in the view

/categories/view/holidays 
I am a post categories: holidays, destination I am a body text