Re: How to campare two arrays whether they have the same elements-cakephp 1.3

2013-03-14 Thread Joseph zhu
ok, thank you.

On Thu, Mar 14, 2013 at 4:57 PM, lowpass  wrote:

> You could extract the IDs of the already-chosen courses and use those
> to exclude from the other results.
>
> // get registered courses
> $registered_data = $this->YourModel->find(...);
>
> $keys = Set::extract(
> '{n}.Listing.id',
> $registered_data
> );
>
> // get available courses
> $available_data = $this->Listing->find(
> 'all',
> array(
> 'conditions' => array(
> 'NOT' => array(
> 'Listing.id' => $keys
> )
> )
> )
> );
>
> This isn't a very efficient query, though.
>
> Depending on how your first data array is structured, you may have to
> use 'Listing.{n}.id' instead.
>
> On Thu, Mar 14, 2013 at 4:28 PM, Joseph zhu  wrote:
> > In fact, the question is that, I am responsible for managing a education
> > website, the website will supply courses for each quarter,
> > the courses supplied for each quarter maybe same, but the students won't
> be
> > allowed to choose the courses which the students have choose before.
> > Now I can get the courses the students have chosen before.
> > foreach($registered as $value){
> >  echo  $value['Listing']['title'];
> >}
> >
> > and here is the course supplied for the current quarter.
> > foreach($courseListings as $listing){
> >   echo  $listing['Listing']['title'];
> >}
> > so if some courses were chosen by the student before, he won't be
> allowed to
> > choose the course for the current quarter.
> > Below is the form for courses register.
> >     
> >   Enroll in course :
> >   
> >   create('Registration',array('action'=>'index')); ?>
> > input('listing',array('label'=>false,'div'=>false)); ?>
> > 
> >   end('Enrol') ?>
> > 
> > I tried but didn't  figure it out.
> > Do you have some good ideas?
> > Thank you so much.
> >
> > On Thu, Mar 14, 2013 at 9:22 AM, Joseph zhu 
> wrote:
> >>
> >> two array:
> >> one is: foreach($courseListings as $listing){
> >>   echo  $listing['Listing']['title'];
> >>}
> >> another one:
> >> foreach($registered as $value){
> >> echo  $value['Listing']['title'];
> >>}
> >> How to campare them and get the same elements.
> >> 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 a topic in the
> >> Google Groups "CakePHP" group.
> >> To unsubscribe from this topic, visit
> >>
> https://groups.google.com/d/topic/cake-php/gqIqXb6j_EU/unsubscribe?hl=en.
> >> To unsubscribe from this group and all its topics, 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.
> >>
> >>
> >
> >
> >
> >
> > --
> > God bless you!
> > Joseph
> >
> > --
> > 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 a topic in the
> Google Groups "CakePHP" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cake-php/gqIqXb6j_EU/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, 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.
>
>
>


-- 
God bless you!
Joseph

-- 
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: How to campare two arrays whether they have the same elements-cakephp 1.3

2013-03-14 Thread Joseph zhu
In fact, the question is that, I am responsible for managing a education
website, the website will supply courses for each quarter,
the courses supplied for each quarter maybe same, but the students won't be
allowed to choose the courses which the students have choose before.
Now I can get the courses the students have chosen before.
foreach($registered as $value){
 echo  $value['Listing']['title'];
   }

and here is the course supplied for the current quarter.
foreach($courseListings as $listing){
  echo  $listing['Listing']['title'];
   }
so if some courses were chosen by the student before, he won't be allowed
to choose the course for the current quarter.
Below is the form for courses register.

   Enroll in course :
   
   create('Registration',array('action'=>'index')); ?>
input('listing',array('label'=>false,'div'=>false)); ?>
  
end('Enrol') ?>

I tried but didn't  figure it out.
Do you have some good ideas?
Thank you so much.

On Thu, Mar 14, 2013 at 9:22 AM, Joseph zhu  wrote:

> two array:
> one is: foreach($courseListings as $listing){
>   echo  $listing['Listing']['title'];
>}
> another one:
> foreach($registered as $value){
> echo  $value['Listing']['title'];
>}
> How to campare them and get the same elements.
> 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 a topic in the
> Google Groups "CakePHP" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cake-php/gqIqXb6j_EU/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, 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.
>
>
>



-- 
God bless you!
Joseph

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




How to campare two arrays whether they have the same elements-cakephp 1.3

2013-03-14 Thread Joseph zhu
two array:
one is: foreach($courseListings as $listing){  
  echo  $listing['Listing']['title'];
   }
another one:
foreach($registered as $value){
echo  $value['Listing']['title'];
   }
How to campare them and get the same elements.
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 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: Cakephp 1.3 video tutorial

2013-03-12 Thread Joseph zhu
Good, but the version of my website is used cakephp 1.3, so I need to focus
1.3
If you have good video resources about 1.3, it will be greater.

On Tue, Mar 12, 2013 at 10:23 AM, euromark  wrote:

> why not starting with the current cake version if you just started to work
> with it?
> Use 2.3 and the tutorials here:
> http://book.cakephp.org/2.0/en/tutorials-and-examples.html
>
>
>
> Am Dienstag, 12. März 2013 15:54:07 UTC+1 schrieb Joseph zhu:
>
>> Hi there:
>> I am a beginner for cakephp 1.3, I have a website built with cakephp 1.3,
>> so I want to study it, and who has the cakephp 1.3 video tutorial, could
>> you please recommend me some links?
>> Thank you so much.
>>
>  --
> 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 a topic in the
> Google Groups "CakePHP" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cake-php/-z4jjl-xxAA/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, 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.
>
>
>



-- 
God bless you!
Joseph

-- 
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: Cakephp 1.3 video tutorial

2013-03-12 Thread Joseph zhu
Thank you so much.  I also want to know some video tutorial about the table
relationship, it is important to get the data.

On Tue, Mar 12, 2013 at 8:32 AM, Paul Willis  wrote:

> I found Andrew Perk's series to be very useful
>
> http://www.youtube.com/watch?v=nO9oSQhRa9s
>
> PW
>
> On 12 Mar 2013, at 14:54, Joseph zhu  wrote:
>
> > Hi there:
> > I am a beginner for cakephp 1.3, I have a website built with cakephp
> 1.3, so I want to study it, and who has the cakephp 1.3 video tutorial,
> could you please recommend me some links?
>
> --
> 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 a topic in the
> Google Groups "CakePHP" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cake-php/-z4jjl-xxAA/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, 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.
>
>
>


-- 
God bless you!
Joseph

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




Cakephp 1.3 video tutorial

2013-03-12 Thread Joseph zhu
Hi there:
I am a beginner for cakephp 1.3, I have a website built with cakephp 1.3, 
so I want to study it, and who has the cakephp 1.3 video tutorial, could 
you please recommend me some links?
Thank you so much.

-- 
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: how to get the array value in view

2013-03-11 Thread Joseph zhu
Ok, I have figured it out. Thank you so much.

On Mon, Mar 11, 2013 at 10:03 AM, Ganapathi Raman wrote:

>
> Hi,
>
>   once again to check your foreach method
>
>
>
>
>
>
> On Mon, Mar 11, 2013 at 4:31 AM, Joseph zhu  wrote:
>
>> Hi there:
>> It didn't show either, do you have more ideas about it?
>> Thank you.
>> Have a good weekend.
>>
>> On Sat, Mar 9, 2013 at 3:01 PM, lowpass  wrote:
>>
>>> On Sat, Mar 9, 2013 at 2:40 AM, Joseph zhu 
>>> wrote:
>>> >
>>> > In the view,I use 
>>> > 
>>> > 
>>> > 
>>> > but I can't get the value for field Curriculum.title
>>> > how to get the value for filed Curriculum.title.
>>>
>>> Sorry, I thought you meant that you wanted to extract just those
>>> values. To print them from a loop, you need to do:
>>>
>>> foreach($coursedatas['Curriculum'] as $curriculum)
>>> {
>>> echo $curriculum['title'];
>>>
>>> Notice that the multiple arrays are under the Curriculum key.
>>>
>>> --
>>> 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 a topic in the
>>> Google Groups "CakePHP" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/cake-php/lbe7g3BHgeQ/unsubscribe?hl=en
>>> .
>>> To unsubscribe from this group and all its topics, 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.
>>>
>>>
>>>
>>
>>
>> --
>> God bless you!
>> Joseph
>>
>> --
>> 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 a topic in the
> Google Groups "CakePHP" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cake-php/lbe7g3BHgeQ/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, 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.
>
>
>



-- 
God bless you!
Joseph

-- 
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: how to get the array value in view

2013-03-10 Thread Joseph zhu
Hi there:
It didn't show either, do you have more ideas about it?
Thank you.
Have a good weekend.

On Sat, Mar 9, 2013 at 3:01 PM, lowpass  wrote:

> On Sat, Mar 9, 2013 at 2:40 AM, Joseph zhu  wrote:
> >
> > In the view,I use 
> > 
> > 
> > 
> > but I can't get the value for field Curriculum.title
> > how to get the value for filed Curriculum.title.
>
> Sorry, I thought you meant that you wanted to extract just those
> values. To print them from a loop, you need to do:
>
> foreach($coursedatas['Curriculum'] as $curriculum)
> {
> echo $curriculum['title'];
>
> Notice that the multiple arrays are under the Curriculum key.
>
> --
> 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 a topic in the
> Google Groups "CakePHP" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/cake-php/lbe7g3BHgeQ/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, 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.
>
>
>


-- 
God bless you!
Joseph

-- 
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: how to get the array value in view

2013-03-08 Thread Joseph zhu
Hi there:
Thank you for reply.
I add some instruction.
the code from controller is:
$coursedatas =
$this->Category->find('all',array('conditions'=>array('Category.id'=>$category)),
array(
'contain' => array(
'Curriculum' => array(
'fields' => array('Curriculum.title'),
'order' => array(
'Curriculum.id' => 'desc'
)
)
)
));

In the view,I use 



but I can't get the value for field Curriculum.title
how to get the value for filed Curriculum.title.
Thank you.

On Fri, Mar 8, 2013 at 6:54 PM, lowpass  wrote:

> You can use the Set (deprecated) or Hash class to extract an array of
> titles. The path you would use:
> '{n}.Curriculum.{n}.title'
>
> Or possibly:
> '0.Curriculum.{n}.title'
>
> You could also get the titles keyed by their IDs. But then you may as
> well doa find('list') to get thesame thing a lot easier.
>
> On Fri, Mar 8, 2013 at 8:21 PM, Joseph zhu  wrote:
> > Hello there:
> > Below is array, who can get the value for [Curriculum][title]?
> > Thank you so much.
> >
> > Array
> > (
> > [0] => Array
> > (
> > [Category] => Array
> > (
> > [id] => 3
> > [program] =>
> > [title] => JOURNALISM
> > [public] => 1
> > [timecreated] =>
> > [timemodified] => 2012-02-20 16:38:13
> > )
> >
> > [Curriculum] => Array
> > (
> > [0] => Array
> > (
> > [id] => 22
> > [college_id] => 3
> > [level] => BA
> > [category_id] => 3
> > [code] => JO100
> > [title] => Reporting
> > [units] => 4
> > [preunits] =>
> > [location] => 0
> > [professor] =>
> > [ta] =>
> > [language] => 0
> > [schedule] =>
> > [textbook] =>
> > [syllabus] =>
> > [description] =>
> > [timecreated] =>
> > [timemodified] => 2012-09-25 17:16:48
> > [program_id] => 5
> > [display] => T
> > [precourse] => 0
> > )
> >
> > [1] => Array
> > (
> > [id] => 23
> > [college_id] => 3
> > [level] => BA
> > [category_id] => 3
> > [code] => JO110
> > [title] => Ethical Issues in Journalism
> > [units] => 3
> > [preunits] =>
> > [location] => 0
> > [professor] =>
> > [ta] =>
> > [language] => 0
> > [schedule] =>
> > [textbook] =>
> > [syllabus] =>
> > [description] =>
> > [timecreated] =>
> > [timemodified] => 2012-06-12 16:59:43
> > [program_id] => 5
> > [display] => T
> > [precourse] => 0
> > )
> >
> > [2] => Array
> > (
> > [id] => 24
> > [college_id] => 3
> > [level] => BA
> > [category_id] => 3
> > [code] => JO200
> > [title] => News Writing
> > [units] => 4
> > 

Re: how to get the array value in view

2013-03-08 Thread Joseph zhu
ADD:
the code from controller: 
$coursedatas = 
$this->Category->find('all',array('conditions'=>array('Category.id'=>$category)),
 
array(
'contain' => array(
'Curriculum' => array(
'fields' => array('Curriculum.title'),
'order' => array(
'Curriculum.id' => 'desc'
)
)
)
));

In the view,I use 



but I can't get the value for field Curriculum.title
how to get the value for filed Curriculum.title.
Thank you.
On Friday, March 8, 2013 5:21:34 PM UTC-8, Joseph zhu wrote:
>
> Hello there:
> Below is array, who can get the value for [Curriculum][title]?
> Thank you so much.
>
> Array([0] => Array([Category] => Array
> ([id] => 3[program] =>
>  [title] => JOURNALISM[public] => 1   
>  [timecreated] => [timemodified] => 2012-02-20 16:38:13   
>  )[Curriculum] => Array(  
>   [0] => Array([id] 
> => 22[college_id] => 3
> [level] => BA[category_id] => 3   
>  [code] => JO100[title] => Reporting  
>   [units] => 4[preunits] =>   
>   [location] => 0
> [professor] => [ta] =>
>  [language] => 0[schedule] => 
> [textbook] => [syllabus] =>   
>   [description] => [timecreated] =>   
>   [timemodified] => 2012-09-25 17:16:48   
>  [program_id] => 5[display] => T  
>   [precourse] => 0)   
>  [1] => Array([id] => 
> 23[college_id] => 3
> [level] => BA[category_id] => 3   
>  [code] => JO110[title] => Ethical Issues 
> in Journalism [units] => 3
> [preunits] => [location] => 0 
>[professor] => [ta] => 
> [language] => 0[schedule] =>  
>[textbook] => [syllabus] =>
>  [description] => 
> [timecreated] => [timemodified] => 2012-06-12 
> 16:59:43[program_id] => 5 
>[display] => T[precourse] => 0 
>)[2] => Array( 
>[id] => 24[college_id] => 3
> [level] => BA[category_id] => 
> 3[code] => JO200
> [title] => News Writing [units] => 4  
>   [preunits] => [location] => 0   
>  [professor] => [ta] =>   
>   [language] => 0
> [schedule] => [textbook] =>   
>   [syllabus] => [description] =>  
>[timecreated] => [timemodified] => 
> 2012-09-01 12:47:03[program_id] => 5  
>   [display] => T[precourse] => 0  
>   )[3] => Array(  
>   [id] => 25[college_id] 
> => 3[level] => BA
> [category_id] => 3[code] => JO210 
>[title] => Editoria

how to get the array value in view

2013-03-08 Thread Joseph zhu
Hello there:
Below is array, who can get the value for [Curriculum][title]?
Thank you so much.

Array([0] => Array([Category] => Array( 
   [id] => 3[program] =>
 [title] => JOURNALISM[public] => 1
[timecreated] => [timemodified] => 2012-02-20 16:38:13  
  )[Curriculum] => Array(   
 [0] => Array([id] => 22
[college_id] => 3[level] => 
BA[category_id] => 3
[code] => JO100[title] => Reporting 
   [units] => 4[preunits] =>
 [location] => 0[professor] =>  
   [ta] => [language] => 0  
  [schedule] => [textbook] =>   
  [syllabus] => [description] 
=> [timecreated] => 
[timemodified] => 2012-09-25 17:16:48[program_id] 
=> 5[display] => T
[precourse] => 0)[1] => Array   
 ([id] => 23
[college_id] => 3[level] => BA  
  [category_id] => 3[code] => JO110 
   [title] => Ethical Issues in Journalism  
   [units] => 3[preunits] =>
 [location] => 0[professor] =>  
   [ta] => [language] => 0  
  [schedule] => [textbook] =>   
  [syllabus] => [description] =>
 [timecreated] => 
[timemodified] => 2012-06-12 16:59:43[program_id] 
=> 5[display] => T
[precourse] => 0)[2] => Array   
 ([id] => 24
[college_id] => 3[level] => BA  
  [category_id] => 3[code] => JO200 
   [title] => News Writing   
[units] => 4[preunits] =>   
  [location] => 0[professor] => 
[ta] => [language] => 0 
   [schedule] => [textbook] =>  
   [syllabus] => [description] =>   
  [timecreated] => [timemodified] 
=> 2012-09-01 12:47:03[program_id] => 5 
   [display] => T[precourse] => 0   
 )[3] => Array( 
   [id] => 25[college_id] => 3  
  [level] => BA
[category_id] => 3[code] => JO210   
 [title] => Editorial Writing  [units] 
=> 4[preunits] => 
[location] => 0[professor] =>   
  [ta] => [language] => 0   
 [schedule] => [textbook] =>
 [syllabus] => [description] => 
[timecreated] => [timemodified] => 
2012-09-25 17:26:01[program_id] => 23   
 [display] => T[precourse] => 0 
   )[4] => Array(   
 [id] => 26[college_id] => 3
[level] => BA[category_id] 
=> 3[code] => JO300
[title] => Advanced Reporting [units] => 3  
  [preunits] =>

cakephp 1.3 how to send email

2013-03-04 Thread Joseph zhu
Hello there:
I am a new for cakephp, I want to know how to make send  email function. 
Who can help me, and give me some detail instructions.
Thank you so much.

-- 
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: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-05-06 Thread Joseph
If you're encountering the SplFileInfo error in CakePHP2 and you're 
absolutely certain that your file/directory permissions are set up 
properly, then one other thing to check is your PHP version. Cake2 requires 
PHP 5.2.8 or greater and although you'd usually be alerted on the default 
page if you were using the wrong version, you wouldn't be alerted if you'd 
developed your app on one server and then moved it to another.

I experienced this error after developing a Cake2 app on a PHP5.3 server 
and then moving it to a PHP 5.1 server. Upgrading to 5.2.17 (which is above 
5.2.8) solved the problem.


On Saturday, February 18, 2012 2:50:13 AM UTC+7, D Mahoney wrote:
>
>  That suggestion sounds reasonable. Tried that, but still have same issue. 
>
> I changed the cache config to add 'mask' => 0666  in 
> app/Config/bootstrap.php (Cache::config('default', array('engine' => 
> 'File', 'mask' => 0666));), then deleted the cache files with 
> "find ./*/tmp/cache -type f \( -name 'cake_*' -o -name 'element_*' -o 
> -name '*.*' \) -exec rm {} \;" then restarted lighttpd. Also made sure to 
> chown /srv/www/lighttpd to lighttpd:lighttpd since that's the user lighttpd 
> will run as. Now when I go to the application URL I'm seeing:
>
>  *Warning* (2): 
> SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_cake_en-us)
>  [function.SplFileInfo-openFile 
> ]: failed to open st
> ream: No such file or directory [*CORE/Cake/Cache/Engine/FileEngine.php*, 
> line *293*]
>
> *Warning* (512): Cannot open file 
> '/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_cake_en-us' 
> [*CORE/Cake/Cache/Engine/FileEngine.php*, line*300*]
>
>
> Still at a loss here!
>
>
> On 02/17/2012 01:10 PM, 0x20h wrote: 
>
> try to set the 'mask' => 0666 option for the file cache (in boostrap.php),
> then delete all cache files.
>
> The Problem occurs when you create the cache files under different users
> (e.g. from cli and lighttpd as www-data)
>
>
>  
>  

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Handling images

2011-11-05 Thread Joseph Núñez
Uploadify is great, I'm using it for a project that handle images in a
site. It's cool, if you need help with Uploadify and AJAX just send me an
email, I can share my experience using Uploadify & CakePHP.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Handling images

2011-11-05 Thread Joseph Núñez
You should submit de post first, save the post information in the session
and then submit the images. Are you using InnoDB?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Using containable to limit my query

2011-02-21 Thread Joseph Buarao
HI Guys,

I need you help guys.,, I'm getting confuse about using containable
behavior, my problem is, I want to limit the output of [parseditem]
have seen there are 3 feeds item I want to display only one.. what are
the possible solution to achieve this.

Here is my Controller code:
$this->Feed->Behaviors->attach('Containable');
$this->paginate = array('Category' => array('recursive'
=>2,'contain'=>array('Feed','Parseditem' => array('limit' => 2;

But it is not yet working, like what I have expected.

Here is the data structure.

[0] => Array
(
[Category] => Array
(
[id] => 1
[name] => asian food
[slug] => asian-food
)

[Feed] => Array
(
[0] => Array
(
[id] => 1
[feed_url] => http://steamykitchen.com/blog/feed
[title] =>
[popularity] => 7
[error] => 0
[Parseditem] => Array
(
[0] => Array
(
[id] => 796
[feed_id] => 1
[datetime] => 2011-01-28
11:12:42
[permalink] =>
http://feedproxy.google.com/~r/SteamyKitchen/~3/Jh82Omii8DQ/13565-chipotle-cinnamon-wings-recipe.html
[title] => Smoky Sweet
Spicy Chipotle Cinnamon Wings
[excerpt] =>
)

[1] => Array
(
[id] => 121
[feed_id] => 1
[datetime] => 2011-01-28
11:12:42
[permalink] =>
http://feedproxy.google.com/~r/SteamyKitchen/~3/Jh82Omii8DQ/13565-chipotle-cinnamon-wings-recipe.html
[title] => Smoky Sweet
Spicy Chipotle Cinnamon Wings
[excerpt] =>
)

[2] => Array
(
[id] => 366
[feed_id] => 1
[datetime] => 2011-01-28
11:12:42
[permalink] =>
http://feedproxy.google.com/~r/SteamyKitchen/~3/Jh82Omii8DQ/13565-chipotle-cinnamon-wings-recipe.html
[title] => Smoky Sweet
Spicy Chipotle Cinnamon Wings
[excerpt] =>
)

[3] => Array
(
[id] => 581
[feed_id] => 1
[datetime] => 2011-01-28
11:12:42
[permalink] =>
http://feedproxy.google.com/~r/SteamyKitchen/~3/Jh82Omii8DQ/13565-chipotle-cinnamon-wings-recipe.html
[title] => Smoky Sweet
Spicy Chipotle Cinnamon Wings
    [excerpt] =>
)

)

)

Thank you in advance guys for your favorable response.

Joseph P. Buarao
Web Developer
Azure Web Design.com

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Using containable to limit my query

2011-02-21 Thread Joseph Buarao
HI Guys,

I need your help guys.,, I'm getting confuse about using containable
behavior, my problem is, I want to limit the output of [parseditem]
have you seen below there are 3 feeds items I want to display only
one.. what are the possible solution to achieve this.

Here is my Controller code:

$this->Feed->Behaviors->attach('Containable');
$this->paginate = array('Category' => array('recursive'
=>2,'contain'=>array('Feed','Parseditem' => array('limit' => 2;

But it is not yet working, like what I have expected.

Here is the data structure.

[0] => Array
(
[Category] => Array
(
[id] => 1
[name] => asian food
[slug] => asian-food
)

[Feed] => Array
(
[0] => Array
(
[id] => 1
[feed_url] => http://steamykitchen.com/blog/feed
[title] =>
[popularity] => 7
[error] => 0
[Parseditem] => Array
(
[0] => Array
(
[id] => 796
[feed_id] => 1
[datetime] => 2011-01-28
11:12:42
[permalink] =>
http://feedproxy.google.com/~r/SteamyKitchen/~3/Jh82Omii8DQ/13565-chipotle-cinnamon-wings-recipe.html
[title] => Smoky Sweet
Spicy Chipotle Cinnamon Wings
[excerpt] =>
)

[1] => Array
(
[id] => 121
[feed_id] => 1
[datetime] => 2011-01-28
11:12:42
[permalink] =>
http://feedproxy.google.com/~r/SteamyKitchen/~3/Jh82Omii8DQ/13565-chipotle-cinnamon-wings-recipe.html
[title] => Smoky Sweet
Spicy Chipotle Cinnamon Wings
[excerpt] =>
)

[2] => Array
(
[id] => 366
[feed_id] => 1
[datetime] => 2011-01-28
11:12:42
[permalink] =>
http://feedproxy.google.com/~r/SteamyKitchen/~3/Jh82Omii8DQ/13565-chipotle-cinnamon-wings-recipe.html
[title] => Smoky Sweet
Spicy Chipotle Cinnamon Wings
[excerpt] =>
)

[3] => Array
(
[id] => 581
[feed_id] => 1
[datetime] => 2011-01-28
11:12:42
[permalink] =>
http://feedproxy.google.com/~r/SteamyKitchen/~3/Jh82Omii8DQ/13565-chipotle-cinnamon-wings-recipe.html
[title] => Smoky Sweet
Spicy Chipotle Cinnamon Wings
    [excerpt] =>
)

)

)

Thank you in advance guys for your favorable response.

Joseph P. Buarao
Web Developer
Azure Web Design.com

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Pagination Problem in Custom Query

2011-02-06 Thread Joseph Buarao
Hello Guys,

Thanks for your help Guys, I have fixed the limit statement but still
in problem, I think I found the problem not in my query it is in my
data structure, I was trying to paginate the data in one category,
here's my data structure
Array
(
[0] => Array
(
[Category] => Array
(
[id] => 1
[name] =>
[slug] => asian-food
)

[Feed] => Array
(
[0] => Array
(
[id] => 1
[url] => http://steamykitchen.com/blog/feed
[title] =>
[popularity] => 7
[error] => 0
[ParseItem] => Array
(
[0] => Array
(
[id] => 796
[feed_id] => 1
[datetime] => 2011-01-28
11:12:42
[permalink] =>
http://feedproxy.google.com/~r/SteamyKitchen/~3/Jh82Omii8DQ/13565-chipotle-cinnamon-wings-recipe.html
[title] => Smoky Sweet
Spicy Chipotle Cinnamon Wings
[excerpt] =>
)

[1] => Array
(
[id] => 121
[feed_id] => 1
[datetime] => 2011-01-28
11:12:42
[permalink] =>
http://feedproxy.google.com/~r/SteamyKitchen/~3/Jh82Omii8DQ/13565-chipotle-cinnamon-wings-recipe.html
[title] => Smoky Sweet
Spicy Chipotle Cinnamon Wings
[excerpt] =>
)



)

)

[1] => Array
(
[id] => 3
[url] => 
http://stickyrice.typepad.com/my_weblog/atom.xml
[title] =>
[popularity] => 8
[error] => 0
[ParseItem] => Array
(
[0] => Array
(
[id] => 127
[feed_id] => 3
[datetime] => 2011-01-19
04:58:22
[permalink] =>
http://stickyrice.typepad.com/my_weblog/2011/01/deck-of-the-fisherman.html
[title] => Deck of the
Fisherman
[excerpt] => Whenever I
come
)
)

   as you can see here. there is only one category and inside of it
there's a lot of feeds, that's why the paginate helper on cakephp did
come out because it start counting, referring to limit in category not
in the feeds, can you suggest to me guys how can I fix this. I want
the limit statement working on the feeds not in category, because
obviously it only has one category, so I want to limit the feeds
result inside of that particular category and have a pagination..
Thank you in advance again guys for you help..


Joseph Buarao
Web Developer
Azure Web Design

On Feb 6, 4:15 am, Jeremy Burns | Class Outfit
 wrote:
> It's 'limit' not 'limits'. Not sure if that's the only problem, but it's a 
> starter.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 5 Feb 2011, at 07:48, Joseph Buarao wrote:
>
>
>
>
>
>
>
> > Hi Fellow Programmer,
>
> > I getting problem with my code, I don't know what's the reason why the
> > sql limit statement is not working on my paginate query. below are my
> > codes feel free to suggest, I really Appreciated it.. Thank you in
> > advance for your support GUYS...
>
> > $this->paginate = array('conditions' =>  array('Category.slug'=>
> > $category),
> > 'limits' => 10);
>
> > $feeds_data = $this->paginate('Category');
>
> > By the way, I used hasAndBelongsToMany relationship..
>
> > T

Pagination Problem in Custom Query

2011-02-05 Thread Joseph Buarao
Hi Fellow Programmer,

I getting problem with my code, I don't know what's the reason why the
sql limit statement is not working on my paginate query. below are my
codes feel free to suggest, I really Appreciated it.. Thank you in
advance for your support GUYS...

$this->paginate = array('conditions' =>  array('Category.slug'=>
$category),
'limits' => 10);

$feeds_data = $this->paginate('Category');

By the way, I used hasAndBelongsToMany relationship..

Thanks..


Joseph Buarao
Web Developer
Azure Web Design.com

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


How can let Cakephp don't clear view cache when related models changed?

2010-11-02 Thread Joseph
How can let Cakephp don't clear view cache when related models
changed?

For example, I have a Food model and the follow views those use the
Food model:

/foods/index.ctp
/foods/list.ctp
/foods/view.ctp

I turn on view cache setting for all the three actions.

When someone request the url /foods/index or /foods/list,cakephp
generates cached files.

When someone request the url /foods/view,I update the click_count
column of the model Food. And, cakephp clear the previous cache files
automatic.

But I wanna save the cache files for 24 hours. I hope cakephp don't to
clear the cached files when related model changed (I just update the
model's click_count.) . How can I do it?


Thanks for some answers.

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

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


Autocomplete Help

2010-07-05 Thread siju joseph
I need a help in Autocomplete in cakephp.

My controller:

class AmaladdsController extends AppController {

var $name = 'Amaladds';
var $helpers = array('Html', 'Form', 'Javascript', 'Ajax', 'Layout');
..
...
.
function autoComplete() {
//Partial strings will come from the autocomplete field as
//$this->data['Amaladd']['subject']
$this->set('posts', $this->Amaladd->find('all', array(
'conditions' => array(
'Amaladd.subject LIKE' => 
$this->data['Amaladd']['place'].'%'
),
'fields' => array('place')
)));
$this->layout = 'ajax';
}


My view (auto_complete.ctp)


 
 
 



My form:

create('User', array('url' => '/users/index')); ?>
autoComplete('Amaladd.subject', '/amaladds/
autoComplete')?>
end('View Post')?>

in my layout file i included:
print $javascript->link('prototype');
print $javascript->link('scriptaculous');
print $javascript->link('scriptaculous/src/effects');
print $javascript->link('scriptaculous/src/controls');


Everything is similar to the Manual. But It doesnot work. In the
generated script in Firebug it show this line after submitting the
form:











//



What is wrong here??? when I type first 3 or more letters of the
'Place' field in my database, nothing happens.

Please help me


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

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


Re: ACL tutorial

2009-11-30 Thread Joseph Roberts
Try,

function beforeFilter() {
$this->Auth->logoutRedirect = array('controller' => 'xxx', 
'action'
=> 'xxx');
}

function logout() {
   $this->Auth->logout();
}

On Nov 30, 10:24 am, Lorenzo Bettini  wrote:
> Hi
>
> I've just started using cakephp, and in the second tutorial, the acl
> one, logout() in class userd_controller.php does not seem to work:
>
>         function logout() {
>                 $this->Session->setFlash('Good-Bye');
>                 $this->redirect($this->Auth->logout());
>         }
>
> infact I'm not logged out...
>
> any clue please?
>
> Moreover, are the implementations of these tutorials available for download?
>
> thanks in advance
>         Lorenzo
>
> --
> Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
> HOME:http://www.lorenzobettini.itMUSIC:http://www.purplesucker.com
> BLOGS:http://tronprog.blogspot.com http://longlivemusic.blogspot.com

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

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


Re: Form Action URL from Router

2009-11-24 Thread Joseph Roberts
Solved it:

function checkPermissions(){
Configure::write('debug', 0);
$this->layout = 'ajax';

$user = $this->Auth->user('username');

// Sanitize URL for either development or production server
if(!strrpos($this->params['url']['url'], 'cake/missio'))
$url = str_replace('Users/checkPermissions//','',$this->params
['url']['url']);
else
$url = str_replace('Users/checkPermissions//cake/missio/','',
$this->params['url']['url']);

$pieces = explode('/', $url);
$controller = Inflector::camelize($pieces[0]);
$action = Inflector::variable($pieces[1]);

$aco = $controller.'/'.$action;

if($this->Acl->check($user, "$aco", '*'))
$perm = 'allowed';
else
$perm = 'denied';

$this->set('data', $perm);
}

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

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


Form Action URL from Router

2009-11-24 Thread Joseph Roberts
I have an application that uses Auth and ACL to check permissions in
the app_controller. I am also checking permissions on every AJAX call
by using jQuery's AjaxSetup to capture the XmlHttpRequest URL. This
process works perfectly for any manual AJAX call, but for Ajaxified
forms the action URL contains both the CAKE and APP_DIR which messes
up my ACL check because it doesn't recognize controller, CAKE or the
action, APP_DIR. On top of that, my ACL check needs a camelized
controller and a variablized action, and the URL sent by the form
helper has put underscores in the controller name.

Can anyone suggest a better way to check permissions on both static
page changes AND AJAX calls without leaving the GUI? When a ACL check
fails in my app_controller it redirects to a failed permissions error
page. That is fine for static page changes, but in the middle of an
AJAX GUI it is a nightmare. I need AJAX permission checks to respond
within the AJAX framework rather than taking the user out of it to a
message page.

Please help!

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

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


MySQL Report Queries

2009-10-26 Thread Joseph Roberts

I am having difficulty at work porting old PHP/MySQL reports into a
new CakePHP app. One old report consist of three loops in this format:

get all departments
 for each department
  get all jobs in department
  for each job
   sum hours and compute $ value (# hours * value per
hour)

I'm not a wizard with queries, and trying to put the old reports into
CakePHP is causing me headaches. I am trying to honor the fat model,
skinny controller design pattern as well as refrain from using $this-
>model->query() and make use of model associations. However, I cannot
get CakePHP to return the data I want in the manner I need to generate
the report I described above.

Can anyone suggest a way to retrieve this data without resorting to
query()? I'd really rather not burn cpu cycles looping through
departments and jobs.

Thanks,

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



posts not appearing

2009-07-04 Thread deshane joseph
Hi I added couple of new posts, but they have not appeared (about an hour
ago) . Is there a delay in messages showing up?

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



Re: One view to bind them all?

2009-04-14 Thread Joseph Roberts

Thanks, Brian. That is exactly what I needed.

On Apr 13, 1:40 pm, brian  wrote:
> On Mon, Apr 13, 2009 at 2:06 PM, Joseph Roberts
>
>
>
>  wrote:
>
> > Greetings fellow bakers,
>
> > I need help with a development project where I work at a rescue
> > mission. I am creating a volunteer management system that involves
> > many models such as: groups, jobs, volunteers, skeleton_jobs and
> > scheduled_jobs. Being new to CakePHP, this is my quandary: How do I
> > implement MVC in this case?
>
> > I would like to haveoneview, let's call it volunteer_manager.ctp,
> > that accesses information fromallthese aforementioned models and
> > displays the data in  tags in an iTunes-esque display so that
> > everything is ononescreen (i.e. mini calendar, scrollable divs for
> > lists of groups, volunteers and jobs). I have a prototype working with
> > drag and drop capability, but am running into issues with
> > requestAction. Some resources I've read have said requestAction is a
> > "bad practice."
>
> > That being said, how to I utilize data from a number of MVC
> > relationships in a singleviewwithout using requestAction? Should I
> > turn the groups, departments, volunteers, and jobs into elements that
> > are included within volunteer_manager.ctp? Each of these elements
> > requires the basic CRUD functions. Perhaps I'm not conceptualizing
> > elements properly, but from the Cookbook's description they seem to be
> > rather limited display aids rather than full blown MVC relationships.
> > I need help understanding elements or a viable alternative because the
> > relationships in this app are getting complicated and I don't want to
> > design myself into a corner.
>
> > For instance, when I click on a date in the mini calendar not only is
> > the calendar div updated, but the jobs div should be updated to
> > reflectallavailable jobs for that day AND the groups, volunteers,
> > and scheduled jobs should be updated as well. This requires a number
> > of requestAction calls as it now stands.
>
> > Perhaps I should get away from Ajax calls to update the individual
> >  tags in volunteer_manager.ctp, but I don't want to reload the
> > screen (and reload every bit of data in the divs) just becauseonediv
> > element needs to change.
>
> You can use a generalised manager ontroller to fetch the data from
> several models. Whether you include those other models in the
> controller's $uses array or use ClassRegistry::init() as needed is up
> to you (maybe you don't wantallof the models loaded for every
> action).
>
> You can still use ajax to make changes. Just point the requests to the
> appropriate controller. The link may be in aviewfor
> volunteer_manager but it can point to any other controller.

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



One view to bind them all?

2009-04-13 Thread Joseph Roberts

Greetings fellow bakers,

I need help with a development project where I work at a rescue
mission. I am creating a volunteer management system that involves
many models such as: groups, jobs, volunteers, skeleton_jobs and
scheduled_jobs. Being new to CakePHP, this is my quandary: How do I
implement MVC in this case?

I would like to have one view, let's call it volunteer_manager.ctp,
that accesses information from all these aforementioned models and
displays the data in  tags in an iTunes-esque display so that
everything is on one screen (i.e. mini calendar, scrollable divs for
lists of groups, volunteers and jobs). I have a prototype working with
drag and drop capability, but am running into issues with
requestAction. Some resources I've read have said requestAction is a
"bad practice."

That being said, how to I utilize data from a number of MVC
relationships in a single view without using requestAction? Should I
turn the groups, departments, volunteers, and jobs into elements that
are included within volunteer_manager.ctp? Each of these elements
requires the basic CRUD functions. Perhaps I'm not conceptualizing
elements properly, but from the Cookbook's description they seem to be
rather limited display aids rather than full blown MVC relationships.
I need help understanding elements or a viable alternative because the
relationships in this app are getting complicated and I don't want to
design myself into a corner.

For instance, when I click on a date in the mini calendar not only is
the calendar div updated, but the jobs div should be updated to
reflect all available jobs for that day AND the groups, volunteers,
and scheduled jobs should be updated as well. This requires a number
of requestAction calls as it now stands.

Perhaps I should get away from Ajax calls to update the individual
 tags in volunteer_manager.ctp, but I don't want to reload the
screen (and reload every bit of data in the divs) just because one div
element needs to change.

I hope this makes sense. If not, I'm sure y'all will let me know :)

Joe

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