Monday, October 31, 2011

Re: Subscriptions

+1

On Oct 31, 4:49 pm, Nate <nathanle...@gmail.com> wrote:
> There's a few Paypal plugins available out there that I'll get into
> when I begin coding.  Those seem to handle taking the initial payment,
> and communicating with PayPal to ensure that the payment was
> successful or a failure for whatever reason.
>
> That's fine, for a one time payment - but how would a subscription
> plan work?
>
> User buys a 30 day subscription and the software updates to allow the
> user access to features for 30 days.  At the end of that 30 days, how
> would the program check with PayPal to ensure that the subscription is
> still valid? How would we tell the system that the user has cancelled
> their subscription through the PayPal website?
>
> Thanks :)

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Implementing a search functionality

I hope we all know that I was being ironic. ^^

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 1 Nov 2011, at 03:48, Yves wrote:

There actually is a search engine plugin called joogle.

On Oct 31, 2011, at 11:20 PM, Ryan Schmidt <google-2010@ryandesign.com> wrote:


On Oct 31, 2011, at 08:45, Jeremy Burns | Class Outfit wrote:

I didn't search there. I used another little know search engine called Joogle (or something like that):

You probably meant "Google".


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: CakePHP 2.0 Model relation alias, am I getting it wrong?

Maybe it was caching?

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Oct 2011, at 21:48, John wrote:

Made a new database with just two tables to clean test this scenario
and worked as documented. Then went back to the real (more complex)
database where it doesn't and I still couldn't find anything wrong.

So I created a new working folder redoing the models with bake from
the start and there it works. Now the strange part, there doesn't seem
to be any difference in code (the $hasMany property in question or in
general) between the working and non working model class file. I've
diffed it just to prove to myself I'm not crazy!

So thanks for your time to reply, I appreciate it. I guess I shouldn't
have jumped on the subject without clean testing it first and although
I don't know what was wrong, it's solved so I'll move on...

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: spit out the sql code just for one line?

Use Debug Kit..It will help to see all the executed SQL and u will come to know ...!!!

On Tue, Nov 1, 2011 at 8:49 AM, Ryan Schmidt <google-2010@ryandesign.com> wrote:

On Oct 31, 2011, at 03:16, AD7six wrote:

> On Oct 31, 6:04 am, iphone5 <sk.koiz...@gmail.com> wrote:
>> $this -> Question-> deleteAll( array( 'survey_question_id' =>
>> $question[ 'SurveyQuestion'][ 'id' ] ) );
>> Is there any way to show the sql code for this line?
>> I know if I turn on the debug = 2 it will show all the sql code for
>> the whole page but I just want to do it for a single line of code.
>
> You put half the answer in the question.

Since you seem to know it, what is the entire answer? Are you suggesting he should set debug=2 and just ignore all the other lines in the output that he's not interested in, or is there a more direct answer to his question hidden in your reply?



--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php



--
Thanks and Regards,

Nitin Hittalamani.

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Implementing a search functionality

There actually is a search engine plugin called joogle.

On Oct 31, 2011, at 11:20 PM, Ryan Schmidt <google-2010@ryandesign.com> wrote:

>
> On Oct 31, 2011, at 08:45, Jeremy Burns | Class Outfit wrote:
>
>> I didn't search there. I used another little know search engine called Joogle (or something like that):
>
> You probably meant "Google".
>
>
> --
> 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Making radio button labels clickable?

On Oct 31, 2011, at 11:29, dave wrote:

> What I want to achieve:
>
> <input type="radio" value="1" class="list required" id="1"
> name="data[Member][gender]">
> <label for="1">Male</label>
> <input type="radio" value="2" class="list required" id="2"
> name="data[Member][gender]">
> <label for="2">Female</label>

For the record, "1" and "2" are not valid HTML IDs. IDs must begin with a letter. Some browsers enforce this.


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Implementing a search functionality

On Oct 31, 2011, at 08:45, Jeremy Burns | Class Outfit wrote:

> I didn't search there. I used another little know search engine called Joogle (or something like that):

You probably meant "Google".


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: spit out the sql code just for one line?

On Oct 31, 2011, at 03:16, AD7six wrote:

> On Oct 31, 6:04 am, iphone5 <sk.koiz...@gmail.com> wrote:
>> $this -> Question-> deleteAll( array( 'survey_question_id' =>
>> $question[ 'SurveyQuestion'][ 'id' ] ) );
>> Is there any way to show the sql code for this line?
>> I know if I turn on the debug = 2 it will show all the sql code for
>> the whole page but I just want to do it for a single line of code.
>
> You put half the answer in the question.

Since you seem to know it, what is the entire answer? Are you suggesting he should set debug=2 and just ignore all the other lines in the output that he's not interested in, or is there a more direct answer to his question hidden in your reply?

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

We need a Cake/PHP Expert for a Project

Hello,

Are you a Cake/PHP expert? Looking for a challenging project with a
great company?

We have a penny auction site that we need help with. The first
project will include helping us implement a caching solution
(memcached) that will allow our app to scale across multiple app
servers. It runs pretty well today on one app server, but with our
growth, we need this to scale to additional servers.

If you know mysql, that's a bonus.

Must be US based.
Must be a Cake/PHP expert.

If you are interested, please respond to admin@winthehunt.com.

We have multiple projects in our plan. If the first project goes
well, there will be many more.

Thank You!

Dave

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: How to use and connect alternative database config when it's failed to connect to DB?

Anyone?

On Oct 30, 8:22 pm, seandy <seand...@gmail.com> wrote:
> Hi all,
> My Question is How to use and connect alternative database config when
> it's failed to connect to DB?
>
> Based on my question above, just give you the idea that on traditional
> php programming, we can do like this :
>
> $db_configs=array(
>
> 0=>array('host'=>'localhost1','user'=>'root1','password'=>'password1'),
>
> 1=>array('host'=>'localhost2','user'=>'root2','password2'=>'password2')
> );
>
> foreach($db_configs as $db_config)
> {
>    if(!mysql_connect($db_config['host'],$db_config['user'],
> $db_config['password'])
>    {
>       // DB Connection Failed, do nothing and try next db config...
>    }
>    else
>    {
>      echo 'DB Connection Success, Break';
>      break;
>    }
>
> }
>
> So the idea is, the script try to reconnect to database when it's
> failed and using alternative config variable.
>
> How can we do like that on CakePHP ?
>
> Thank you.

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: ACL and mapActions problem

$this->Auth->authorize = 'actions';
should have been.
$this->Auth->authorize = 'crud';

On 29 okt, 14:51, Stollie <remco.raaymak...@gmail.com> wrote:
> Hello all :)
>
> I have a problem with the ACL en Auth mapActions  function. I can't
> set the rights (read, edit, add, delete) to each function in de
> controller as I want. With the plugin I use I have to set all the
> right to true to even view a dashboard page at the page controller.
>
> So want I'm using.
> CakePHP 1.3.13 and a plugin to manage the ACL,https://github.com/interlock/acl_plugin.
>
> I build the acos list with the build_acl function provided in the cake
> book. The rights I want to mange by groups so I have set that up in
> the models of users en goups.
>
> I have the following code at my pages controller:
>         function beforeFilter() {
>                 parent::beforeFilter();
>                 $this->Auth->mapActions(
>                         array(
>                                 'read' => array('display','dashboard')
>                         )
>                 );
>         }
>
> By setting this it should be able to set read to true in my aros_acos
> row for the Pages controller, right?
> controllers > Pages    delete -> false update -> false  read -> true
> create -> false.
>
> I did this for my editors group, but I still cant view this dashboard
> as an editor. I get an end less refresh so the browser stops it.
> Probably to refresh to the login page. When I set all right true I can
> see the page.
>
> The code is avaible here to view.https://bitbucket.org/Davidvdv/sociale-kaart/src/bef7409f36b1/app
>
> What should I change to make this work?

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: CakePHP 2.0 Model relation alias, am I getting it wrong?

Made a new database with just two tables to clean test this scenario
and worked as documented. Then went back to the real (more complex)
database where it doesn't and I still couldn't find anything wrong.

So I created a new working folder redoing the models with bake from
the start and there it works. Now the strange part, there doesn't seem
to be any difference in code (the $hasMany property in question or in
general) between the working and non working model class file. I've
diffed it just to prove to myself I'm not crazy!

So thanks for your time to reply, I appreciate it. I guess I shouldn't
have jumped on the subject without clean testing it first and although
I don't know what was wrong, it's solved so I'll move on...

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: View with underscores is missing

Solved!!!
Ty for all help ^__^

On 31 oct, 12:58, euromark <dereurom...@googlemail.com> wrote:
> did you try name your view file "ver_articulo"?
>
> On 31 Okt., 17:55, Mirdrack <mirdr...@gmail.com> wrote:
>
>
>
> > Hi:
> > I have my project in local host and works ok but when i upload to my
> > server
> > linux x26_64
> > apache 2.2.19
> > php 5.2.1
> > 5.0.92-community
>
> > cakephp 2.0 send me the error of missing view but just in actions in
> > controllers with camelCase
> > like verArticulo and views like ver_Articulo.
>
> > This is a list of actions
>
> > controller: articulos_controller
> > action: lista
> > view: lista.ctp  OK
> > action: add
> > view: add.ctp OK
> > action: verArticulo
> > view: ver_Articulo: Missing View
>
> > controller: categorias_controller
> > action: lista
> > view: lista.ctp  OK
> > action: add
> > view: add.ctp OK
> > action: verArticulo
> > view: ver_Categoria: Missing View
>
> > I dont know what is the problem my server or is a bug of cake
> > Any help is welcome
> > Thnks- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Subscriptions

There's a few Paypal plugins available out there that I'll get into
when I begin coding. Those seem to handle taking the initial payment,
and communicating with PayPal to ensure that the payment was
successful or a failure for whatever reason.

That's fine, for a one time payment - but how would a subscription
plan work?

User buys a 30 day subscription and the software updates to allow the
user access to features for 30 days. At the end of that 30 days, how
would the program check with PayPal to ensure that the subscription is
still valid? How would we tell the system that the user has cancelled
their subscription through the PayPal website?

Thanks :)

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Why specify the controller in the view?

I got a pet peeve about being 'lazy' :-) .  Too often it leaves vague code that some poor soul needs to update years after the fact, with little understanding of what's going on.

I'll specify the exact controller.

On Mon, Oct 31, 2011 at 3:41 PM, euromark <dereuromark@googlemail.com> wrote:
both will work exactly the same WITHIN the controller
you may leave it out in this case.
its always good practice to specify the controller, as well, though.

but if you are outside of this controller you MUST specify it
so better include it everywhere. especially if you move code around
(copy and paste)
or if you make it an element (which could be included in any other
view/controller/layout.

so better safe than sry :)
we programmers are just lazy sometimes


On 31 Okt., 20:28, "Yves S. Garret" <yoursurrogate...@gmail.com>
wrote:
> I just noticed this in the cakephp book.  In the first example, you have
> the following line(s) in index.ctp:
>
> http://book.cakephp.org/view/1536/Creating-Post-Views
>
> <?php echo $this->Html->link($post['Post']['title'], array('controller' =>
> 'posts', 'action' => 'view', $post['Post']['id'])); ?> <--- this is the
> first example of a view
>
> http://book.cakephp.org/view/1540/Editing-Posts
>
> <?php echo $this->Html->link($post['Post']['title'], array('action' =>
> 'view', $post['Post']['id']));?>  <--- this is a later example, when you're
> editing the post.
>
> The question is about this line: 'controller' => 'posts' <--- this doesn't
> seem to affect the way info is posted.  index.ctp is already tied to the
> index method in the PostsController, so what role does this play?

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Why specify the controller in the view?

both will work exactly the same WITHIN the controller
you may leave it out in this case.
its always good practice to specify the controller, as well, though.

but if you are outside of this controller you MUST specify it
so better include it everywhere. especially if you move code around
(copy and paste)
or if you make it an element (which could be included in any other
view/controller/layout.

so better safe than sry :)
we programmers are just lazy sometimes


On 31 Okt., 20:28, "Yves S. Garret" <yoursurrogate...@gmail.com>
wrote:
> I just noticed this in the cakephp book.  In the first example, you have
> the following line(s) in index.ctp:
>
> http://book.cakephp.org/view/1536/Creating-Post-Views
>
> <?php echo $this->Html->link($post['Post']['title'], array('controller' =>
> 'posts', 'action' => 'view', $post['Post']['id'])); ?> <--- this is the
> first example of a view
>
> http://book.cakephp.org/view/1540/Editing-Posts
>
> <?php echo $this->Html->link($post['Post']['title'], array('action' =>
> 'view', $post['Post']['id']));?>  <--- this is a later example, when you're
> editing the post.
>
> The question is about this line: 'controller' => 'posts' <--- this doesn't
> seem to affect the way info is posted.  index.ctp is already tied to the
> index method in the PostsController, so what role does this play?

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Why specify the controller in the view?

I just noticed this in the cakephp book.  In the first example, you have the following line(s) in index.ctp:

http://book.cakephp.org/view/1536/Creating-Post-Views

<?php echo $this->Html->link($post['Post']['title'], array('controller' => 'posts', 'action' => 'view', $post['Post']['id'])); ?> <--- this is the first example of a view

http://book.cakephp.org/view/1540/Editing-Posts

<?php echo $this->Html->link($post['Post']['title'], array('action' => 'view', $post['Post']['id']));?>  <--- this is a later example, when you're editing the post.

The question is about this line: 'controller' => 'posts' <--- this doesn't seem to affect the way info is posted.  index.ctp is already tied to the index method in the PostsController, so what role does this play?

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Contain Getting Ignored Again (cake 2.0)

That had some effect, but made something else break.  I added...

$params['fields'][] = 'Project.contact_id'; 

to force the contained relationship foreign key to be included, and it completed the query, but then the virtualField defined in the Project::__construct() method stopped working and I would get an "index does not exist error" for the displayField.  (even after making sure that it remained in the fields list)

$this->displayField = 'displayName';

What I mostly don't get why it works from other plugins by not this particular plugin when they both make calls to the Project model. 

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Contain Getting Ignored Again (cake 2.0)

Do you need some ids in arrays keys to complete the join (to Contact.id) - perhaps Project.contact_id?

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Oct 2011, at 18:48, zuha wrote:

I've posted about this before, but previously it was because AppModel wasn't getting loaded (I have made sure that it and containable is being loaded this time).  But even though they are being loaded, I'm again having a problem where 'contain' stops working.   I go to the beforeFind method and print out the $queryData, and sure enough contain is in the array, and I get this sql error because there is no join in the sql on the contact table. 

Column not found: 1054 Unknown column 'Contact.name' in 'field list'
 

With this Query ::  SELECT `Project`.`id`, (CONCAT(`Project`.`name`, " ", `Contact`.`name`, "")) AS `Project__displayName` FROM `projects` AS `Project` INNER JOIN `used` AS `Used` ON (`Used`.`foreign_key` = `Project`.`id` AND `Used`.`model` = 'Project' AND `Used`.`user_id` = 1) WHERE 1 = 1 ORDER BY `Project`.`name` ASC 

Mind you this query works in every other place in our app because the Contact table is automatically joined with containable.  Just in this one plugin it seems to be impossible to get contain to work when its called from this plugin to another plugin.

Here is the line that is creating this query in TimesheetsController.php : 
$projects = $this->TimesheetTime->Project->find('list');

Here is the output from beforeFind($queryData) { debug($queryData) } in the Project model  (most notably is that 'contain' => Contact.name exists in the queryData)

Array (     [conditions] =>      [fields] => Array         (             [0] => Project.id             [1] => Project.displayName         )      [joins] => Array         (             [0] => Array                 (                     [table] => used                     [alias] => Used                     [type] => INNER                     [conditions] => Array                         (                             [0] => Used.foreign_key = Project.id                             [1] => Used.model = 'Project'                             [2] => Used.user_id = 1                         )                  )          )      [limit] =>      [offset] =>      [order] => Array         (             [0] => Array                 (                     [0] => Project.name                 )          )      [page] => 1     [group] =>      [callbacks] => 1     [contain] => Array         (             [0] => Contact.name         )      [recursive] => -1     [list] => Array         (             [groupPath] =>              [valuePath] => {n}.Project.displayName             [keyPath] => {n}.Project.id         )  )



--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: View with underscores is missing

did you try name your view file "ver_articulo"?


On 31 Okt., 17:55, Mirdrack <mirdr...@gmail.com> wrote:
> Hi:
> I have my project in local host and works ok but when i upload to my
> server
> linux x26_64
> apache 2.2.19
> php 5.2.1
> 5.0.92-community
>
> cakephp 2.0 send me the error of missing view but just in actions in
> controllers with camelCase
> like verArticulo and views like ver_Articulo.
>
> This is a list of actions
>
> controller: articulos_controller
> action: lista
> view: lista.ctp  OK
> action: add
> view: add.ctp OK
> action: verArticulo
> view: ver_Articulo: Missing View
>
> controller: categorias_controller
> action: lista
> view: lista.ctp  OK
> action: add
> view: add.ctp OK
> action: verArticulo
> view: ver_Categoria: Missing View
>
> I dont know what is the problem my server or is a bug of cake
> Any help is welcome
> Thnks

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Contain Getting Ignored Again (cake 2.0)

I've posted about this before, but previously it was because AppModel wasn't getting loaded (I have made sure that it and containable is being loaded this time).  But even though they are being loaded, I'm again having a problem where 'contain' stops working.   I go to the beforeFind method and print out the $queryData, and sure enough contain is in the array, and I get this sql error because there is no join in the sql on the contact table. 

Column not found: 1054 Unknown column 'Contact.name' in 'field list'
 

With this Query ::  SELECT `Project`.`id`, (CONCAT(`Project`.`name`, " ", `Contact`.`name`, "")) AS `Project__displayName` FROM `projects` AS `Project` INNER JOIN `used` AS `Used` ON (`Used`.`foreign_key` = `Project`.`id` AND `Used`.`model` = 'Project' AND `Used`.`user_id` = 1) WHERE 1 = 1 ORDER BY `Project`.`name` ASC 

Mind you this query works in every other place in our app because the Contact table is automatically joined with containable.  Just in this one plugin it seems to be impossible to get contain to work when its called from this plugin to another plugin.

Here is the line that is creating this query in TimesheetsController.php : 
$projects = $this->TimesheetTime->Project->find('list');

Here is the output from beforeFind($queryData) { debug($queryData) } in the Project model  (most notably is that 'contain' => Contact.name exists in the queryData)

Array (     [conditions] =>      [fields] => Array         (             [0] => Project.id             [1] => Project.displayName         )      [joins] => Array         (             [0] => Array                 (                     [table] => used                     [alias] => Used                     [type] => INNER                     [conditions] => Array                         (                             [0] => Used.foreign_key = Project.id                             [1] => Used.model = 'Project'                             [2] => Used.user_id = 1                         )                  )          )      [limit] =>      [offset] =>      [order] => Array         (             [0] => Array                 (                     [0] => Project.name                 )          )      [page] => 1     [group] =>      [callbacks] => 1     [contain] => Array         (             [0] => Contact.name         )      [recursive] => -1     [list] => Array         (             [groupPath] =>              [valuePath] => {n}.Project.displayName             [keyPath] => {n}.Project.id         )  )


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Validation is done, where?

If you read the next page in the tutorial (http://book.cakephp.org/
view/1538/Data-Validation
) you will find out.

HTH, Paul

On Oct 31, 6:15 pm, "Yves S. Garret" <yoursurrogate...@gmail.com>
wrote:
> Was going through the book and noticed the last sentence on the web-page:
>
> http://book.cakephp.org/view/1537/Adding-Posts
>
> I noticed this part:
>
> Calling the save() method will check for validation errors and abort the
> save if any occur. We'll discuss how those errors are handled in the
> following sections.
>
> Where is this take care of, server side?

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Validation is done, where?

Was going through the book and noticed the last sentence on the web-page:

http://book.cakephp.org/view/1537/Adding-Posts

I noticed this part:

Calling the save() method will check for validation errors and abort the save if any occur. We'll discuss how those errors are handled in the following sections.


Where is this take care of, server side?

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Going back to school: ACL

Hey Eric, 
Not sure what else I could explain other than posting some code (which isn't 100% tested quite yet).  Basically we use prefix routing just to get the $this->request->params['prefix'] variable filled, then reroute getting rid of the prefix from the method.  (a call which would normally go to admin_index()  becomes a a call to index() method)  

If you want more info, I would suggest starting a new thread with a question, because it would steer this original post way too far off topic.  

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Can't get Plugin model to work / be noticed at all

My bet is that you don't have a plugin defined somewhere.  I had the same problem in a couple of places after the upgrade because I had forgotten to name which plugin the model could be found in.   

belongsTo = array(
    className = [PLUGIN].[MODEL]

instead of...

belongsTo = array(
    className = [MODEL]


And this goes for all relationships, and you might have just missed one. 

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

ACL is not working for groups

I want to utilise the concept of groups in ACL. I am very new to
cakephp, and messed up with ACL. My database tables are as follows:
CREATE TABLE IF NOT EXISTS `gcfa_groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
);

CREATE TABLE IF NOT EXISTS `gcfa_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`password` varchar(50) NOT NULL,
`active` tinyint(4) NOT NULL DEFAULT '1',
`email` varchar(255) DEFAULT NULL,
`group_id` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
);

id is being used as username.

My model files are as follows:
class User extends AppModel {
var $name = 'User';

var $hasMany = array('UserBank', 'UserNominee', 'Payment');
var $belongsTo = array(
'Group' => array('className' => 'Group',
'foreignKey' => 'group_id'
)
);
public $actsAs = array('Acl' => array('type' => 'requester'));

public function parentNode() {
if (!$this->id && empty($this->data)) {
return null;
}
$data = $this->data;
if (empty($this->data) || empty($this->data['User']['group_id']))
{
$data = $this->read();
}

if (!$data['User']['group_id']) {
return null;
} else {
$this->Group->id = $data['User']['group_id'];
$groupNode = $this->Group->node();
return array('Group' => array('id' => $groupNode[0]['Aro']
['foreign_key']));
}
}

public function bindNode($object) {
if (!empty($object[$this->alias]['group_id'])) {
return array('model' => 'Group', 'foreign_key' => $object[$this-
>alias]['group_id']);
}
}


function isAuthorized($user, $controller, $action) {
return true;
}

}

class Group extends AppModel {
public $displayField = 'name';
var $hasMany = array('User');

public $actsAs = array('Acl' => array('requester'));

public function parentNode() {
return null;
}
}

I just baked the controller and view files for these models using
shell. I have setup my ACL as follows:
id parent_id model foreign_key alias lft rght
1 NULL Group 1 SuperUser 1 2
2 NULL Group 2 Administrator 3 4
3 NULL Group 3 Manager 5 6
4 NULL Group 4 Author 7 8

Whenever I am going to edit any user it is giving me error :
Warning (512): AclNode::node() - Couldn't find Aro node identified by
"Array
(
[Aro0.model] => User
[Aro0.foreign_key] => 2
)
" [CORE/Cake/Model/AclNode.php, line 179]

Do I need to make separate entry of every user in aros table? If yes,
then what is the use of groups in this case? If I want to bypass this
creation of new entry in acos table, is it possible? I think if I am
able to override AclBehaviour::afterSave method then I can do that.
I dont want to create a separate entry for every user in the ACL.

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

View with underscores is missing

Hi:
I have my project in local host and works ok but when i upload to my
server
linux x26_64
apache 2.2.19
php 5.2.1
5.0.92-community

cakephp 2.0 send me the error of missing view but just in actions in
controllers with camelCase
like verArticulo and views like ver_Articulo.

This is a list of actions

controller: articulos_controller
action: lista
view: lista.ctp OK
action: add
view: add.ctp OK
action: verArticulo
view: ver_Articulo: Missing View

controller: categorias_controller
action: lista
view: lista.ctp OK
action: add
view: add.ctp OK
action: verArticulo
view: ver_Categoria: Missing View

I dont know what is the problem my server or is a bug of cake
Any help is welcome
Thnks

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Making radio button labels clickable?

More info: Just to make it clear, clicking either the Male or Female
label currently sets the male radio button as selected. Also, I'm
guessing my issue is probably in the options array...

On Oct 31, 4:29 pm, dave <davespa...@gmail.com> wrote:
> Got quite lengthy when writing it, but essentially my question below
> is how to make radio button labels clickable. Pls read on...
>
> Quite new to Cakephp, and very pleased with results so far, but
> perplexed by radio buttons. More accurately, adding labels with the
> correct 'for' attribute to make them clickable alongside the correct
> radio button (ie where the radio button 'id' and the label 'for' are
> the same for each individual radio button).
>
> The form looks perfect, and indeed works perfectly if the user clicks
> the actual radio button - but I feel the label should be clickable (am
> I getting too anal here?)
>
> What I want to achieve:
>
> <input type="radio" value="1" class="list required" id="1"
> name="data[Member][gender]">
> <label for="1">Male</label>
> <input type="radio" value="2" class="list required" id="2"
> name="data[Member][gender]">
> <label for="2">Female</label>
>
> What I'm getting:
>
> <input type="radio" value="1" class="list required" id="MemberGender"
> name="data[Member][gender]">
> <label for="MemberGender">Male</label>
> <input type="radio" value="2" class="list required" id="MemberGender"
> name="data[Member][gender]">
> <label for="MemberGender">Female</label>
>
> (for info the controller is members_controller.php, using LoadModel to
> incorporate the Question model)
>
> So my question is how do I get the correct values in 'id' on the input
> and 'for' on the label. I know it should be simple, and have tried
> many many variations of what's going into my options array
> etc...........any help would be much appreciated.
>
> Here's my code as it stands:
>
> $options = array();
> $c = 0;
> while ($c < count($question['Reply'])) {
>         $options[$question['Reply'][$c]['id']] = $question['Reply'][$c]
> ['value'];
>         $c++;
>
> }
>
> echo $this->Form->input($question['Question']['name'], array(
>         'type' => 'radio',
>         'class' => 'list required',
>         'options' => $options
> ));
>
> All taken from two tables, questions and replies - related via
> question.id and reply.question_id
>
> Questions have many replies, so relationship in the Question model is:
>
>     var $hasMany = array(
>         'Reply' => array(
>             'className'     => 'Reply',
>             'foreignKey'    => 'question_id',
>             'dependent'=> true
>         )
>     );
>
> The output from doing a find all of a certain question_id (in this
> case gender) is:
> (
>     [0] => Array
>         (
>             [Question] => Array
>                 (
>                     [id] => 15
>                     [group_id] => 1
>                     [name] => gender
>                     [text] => Gender?
>                     [abbr_text] => Gender
>                 )
>
>             [Reply] => Array
>                 (
>                     [0] => Array
>                         (
>                             [id] => 1
>                             [question_id] => 15
>                             [value] => Male
>                         )
>
>                     [1] => Array
>                         (
>                             [id] => 2
>                             [question_id] => 15
>                             [value] => Female
>                         )
>
>                 )
>
>         )
>
> Sorry for length, hope someone can help. Thanks...D

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Making radio button labels clickable?

Got quite lengthy when writing it, but essentially my question below
is how to make radio button labels clickable. Pls read on...

Quite new to Cakephp, and very pleased with results so far, but
perplexed by radio buttons. More accurately, adding labels with the
correct 'for' attribute to make them clickable alongside the correct
radio button (ie where the radio button 'id' and the label 'for' are
the same for each individual radio button).

The form looks perfect, and indeed works perfectly if the user clicks
the actual radio button - but I feel the label should be clickable (am
I getting too anal here?)

What I want to achieve:

<input type="radio" value="1" class="list required" id="1"
name="data[Member][gender]">
<label for="1">Male</label>
<input type="radio" value="2" class="list required" id="2"
name="data[Member][gender]">
<label for="2">Female</label>

What I'm getting:

<input type="radio" value="1" class="list required" id="MemberGender"
name="data[Member][gender]">
<label for="MemberGender">Male</label>
<input type="radio" value="2" class="list required" id="MemberGender"
name="data[Member][gender]">
<label for="MemberGender">Female</label>

(for info the controller is members_controller.php, using LoadModel to
incorporate the Question model)

So my question is how do I get the correct values in 'id' on the input
and 'for' on the label. I know it should be simple, and have tried
many many variations of what's going into my options array
etc...........any help would be much appreciated.

Here's my code as it stands:

$options = array();
$c = 0;
while ($c < count($question['Reply'])) {
$options[$question['Reply'][$c]['id']] = $question['Reply'][$c]
['value'];
$c++;
}

echo $this->Form->input($question['Question']['name'], array(
'type' => 'radio',
'class' => 'list required',
'options' => $options
));


All taken from two tables, questions and replies - related via
question.id and reply.question_id

Questions have many replies, so relationship in the Question model is:

var $hasMany = array(
'Reply' => array(
'className' => 'Reply',
'foreignKey' => 'question_id',
'dependent'=> true
)
);

The output from doing a find all of a certain question_id (in this
case gender) is:
(
[0] => Array
(
[Question] => Array
(
[id] => 15
[group_id] => 1
[name] => gender
[text] => Gender?
[abbr_text] => Gender
)

[Reply] => Array
(
[0] => Array
(
[id] => 1
[question_id] => 15
[value] => Male
)

[1] => Array
(
[id] => 2
[question_id] => 15
[value] => Female
)

)

)

Sorry for length, hope someone can help. Thanks...D

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: The new 2.0 Exceptions

It doesn't matter if the rest pass, there is a fail. No point in
seeing if any others are broken if you know the test is already done.

-Mark

On Oct 29, 8:48 pm, euromark <dereurom...@googlemail.com> wrote:
> One needs to get used to them, I guess.
> My current problem is that exceptions jump out of the current method
> if triggered.
>
> So in test cases for example not all tests get executed.
> This can be a good thing.
> But sometimes it would be better if it behaved like errors in 1.3
>
> lets say we are testing an Inflector method.
> And we use a testInflector() method and 10-20 asserts.
> If the first one fails, all others won't even be triggered. What if
> all would pass except the first one?
> It would help to see them all at once.
>
> Or the other way around.
> The first one fails - and it displays: 1 fail. (it used to display all
> fails - like 14 fails).
> Now we could make the false assumption that 13 of 14 pass...
> At the beginning I didnt even notice that most of the asserts of some
> test cases are not checked due to a single fail.
>
> Yes, I could make an own method for each and every assert.
> But I was kinda hoping that they can be adjusted to not jump out of
> the current method...
> at least for test cases this would help :)

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: any one else having trouble with table prefixes in 2.0?

OK... it happens on normal views as well
just a simple find(first) with 2 contained hasMany relations

same problem
even worse - it has nothing to do with the cache here (cache
deactivated)
joins seem to kill the site_ prefix!
this is quite a problem since the whole application seems to be pretty
non-functional now

On 31 Okt., 14:37, euromark <dereurom...@googlemail.com> wrote:
> if the model cache is renewed everything is fine
> but as soon as cake uses the model cache the table prefix is lost and
> causes sql errors
>
> the prefix is "site_"
>
> query with cached data from /tmp/cache/models:
>
> Error: SQLSTATE[42S02]: Base table or view not found: 1146 Table
> 'cake.addresses' doesn't exist
>
> SQL Query: SELECT `Address`.`id`, `Address`.`foreign_id`,
> `Address`.`model`, `Address`.`country_id`, `Address`.`first_name`,
> `Address`.`last_name`, `Address`.`street`, `Address`.`postal_code`,
> `Address`.`city`, `Address`.`lat`, `Address`.`lng`,
> `Address`.`last_used`, `Address`.`formatted_address`,
> `Address`.`type_id`, `Address`.`created`, `Address`.`modified` FROM
> `addresses` AS `Address` WHERE `Address`.`foreign_id` = 4 AND
> `Address`.`model` = 'Restaurant'
>
> Notice: If you want to customize this error message, create site/View/
> Errors/pdo_error.ctp
>
> Stack Trace
>
> #0 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(436):
> PDOStatement->execute(Array)
> #1 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(403):
> DboSource->_execute('SELECT `Address...', Array)
> #2 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(645):
> DboSource->execute('SELECT `Address...', Array, Array)
> #3 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(1205):
> DboSource->fetchAll('SELECT `Address...', false)
> #4 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(1226):
> DboSource->queryAssociation(Object(Restaurant), Object(Address),
> 'hasOne', 'Address', Array, Array, true, Array, 0, Array)
> #5 /srv/www/.../trunk/lib/Cake/Model/Datasource/DboSource.php(1065):
> DboSource->queryAssociation(Object(Coupon), Object(Restaurant),
> 'belongsTo', 'Restaurant', Array, Array, true, Array, 1, Array)
> #6 /srv/www/.../trunk/lib/Cake/Model/Model.php(2458): DboSource->read(Object(Coupon), Array)
>
> #7 /srv/www/.../trunk/site/Plugin/Tools/Lib/MyModel.php(417): Model->find('all', Array, NULL, NULL)
>
> #8 /srv/www/.../trunk/site/Controller/CouponsController.php(470):
> MyModel->find('all', Array)
> #9 [internal function]: CouponsController->homepage()
> #10 /srv/www/.../trunk/lib/Cake/Controller/Controller.php(473):
> ReflectionMethod->invokeArgs(Object(CouponsController), Array)
> #11 /srv/www/.../trunk/lib/Cake/Routing/Dispatcher.php(107):
> Controller->invokeAction(Object(CakeRequest))
> #12 /srv/www/.../trunk/lib/Cake/Routing/Dispatcher.php(89): Dispatcher->_invoke(Object(CouponsController), Object(CakeRequest),
>
> Object(CakeResponse))
> #13 /srv/www/.../trunk/site/webroot/index.php(96): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
>
> #14 {main}
>
> it should have been
> "FROM `site_addresses` AS `Address`"

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: CakePHP 2.0 Model relation alias, am I getting it wrong?

Are you getting an empty array key or no array key? What does your find query look like? Are you using the Containable behaviour? What is recursive set to?

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Oct 2011, at 12:52, John wrote:

Hey guys, I'm rather new in CakePHP although I've developed a couple
small projects back in the 1.1 era.

I've been puzzled with the model relation alias behavior in 2.0
(behavior here used as literal english word not as the cakePHP
entity).

According to the docs one can name different model relation aliases
for the same model class, i.e.

class testExample extends AppModel {
 public $hasMany = array(
'testRelation1' => array( //that's the alias
'className' => 'testRelation', //an existing model here
'foreignKey' => 'test_relation1_id' //existing key in database
),
'testRelation2' => array(
'className' => 'testRelation',
'foreignKey' => 'test_relation2_id' //another existing key in the
database
),
}

When the queries run, they return the expected results but those
results are not shown on page data, probably suppressed at some point.
The "Related Test Relation1" and "Related Test Relation2" come empty.

They only reason to get the data is to have the alias exactly as the
model class name:
 public $hasMany = array(
'testRelation' => array( //same as model class name
'className' => 'testRelation',
'foreignKey' => 'test_relation1_id',
)

Even if you have just one relation like the last example and the alias
is not exactly the model name it doesn't work again.

Is this expected behavior?

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: CakePHP 2.0 Model relation alias, am I getting it wrong?

what happens if you use the official convention? CamelCase (not
camelBack)
'className' => 'TestRelation' etc


On 31 Okt., 13:52, John <spil...@gmail.com> wrote:
> Hey guys, I'm rather new in CakePHP although I've developed a couple
> small projects back in the 1.1 era.
>
> I've been puzzled with the model relation alias behavior in 2.0
> (behavior here used as literal english word not as the cakePHP
> entity).
>
> According to the docs one can name different model relation aliases
> for the same model class, i.e.
>
> class testExample extends AppModel {
>   public $hasMany = array(
>                 'testRelation1' => array( //that's the alias
>                         'className' => 'testRelation', //an existing model here
>                         'foreignKey' => 'test_relation1_id' //existing key in database
>                 ),
>                 'testRelation2' => array(
>                         'className' => 'testRelation',
>                         'foreignKey' => 'test_relation2_id' //another existing key in the
> database
>                 ),
>
> }
>
> When the queries run, they return the expected results but those
> results are not shown on page data, probably suppressed at some point.
> The "Related Test Relation1" and "Related Test Relation2" come empty.
>
> They only reason to get the data is to have the alias exactly as the
> model class name:
>   public $hasMany = array(
>                 'testRelation' => array( //same as model class name
>                         'className' => 'testRelation',
>                         'foreignKey' => 'test_relation1_id',
>                 )
>
> Even if you have just one relation like the last example and the alias
> is not exactly the model name it doesn't work again.
>
> Is this expected behavior?

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Looking to hire cake, ajax, jquery expert

Hi.

First off, I am really sorry if this is the wrong place to post such a
request, but I could not find anywhere else!?!

I am looking to hire a cake developer that have excellent ajax +
jquery skills.

This is for a project I am working on, and I am looking to have a
FILTER content function that uses ajax, jquery on frontend.

I am a complete noob regarding ajax and jquery, so instead of using
alot of time to figure this out myself, I was wondering if there are
any skilled developers that would like some fast money to their paypal
or whatever? =)

Here are some details about my setup:
Cake 1.3.12

- Categories (nested)
- Tags
- Content

Navigation will be like this:
- Filter on content type (type1, type2)
- Filter content on what Tag assigned
- Filter content on what sub-sub category assigned

Looking for a similar filter function that example templatemonster are
using to filter templates.

All controllers, models/db rows and what not are present, only the
views/elements/js and functions to do this filtering on my frontend is
remaining.

Interested? Drop me an email @ metz80 at gmail-com

Thanks!
-Tom

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

CakePhp - Array to find conditions

This here is the query that the system does to collection types:

[PHP] CakePHP - Consultation with or without conditions http://pastebin.com/aBazvz4D

Now I'm trying to do a calculation to play in conditions of a second
consultation, which depends on the results of the first.

CakePHP - Second consultation with or without conditions http://pastebin.com/xiwJJYdh

The thing here is this: these queries must return a single block at
the end of consultations.

He had no other way to perform this calculation because it depends on
the data first.

Any suggestions?

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: DebugKit Toolbar timeline isn't adding up

On Sun, Oct 30, 2011 at 4:59 PM, AD7six <andydawson76@gmail.com> wrote:
>
> It doesn't necessarily have to add up. Timers have a start and an end
> time - and apparently a lot happened inbetween your controller action
> and the render process.

Thanks Andy - it's a good point.

> > Any ideas where this may be coming from?  This is v1.2.7.
>
> Well that's an old version of cake.

Granted.

> Maybe by investigating the old fashioned way - from the numbers you've
> posted you can start by investigating if it comes from: some code that
> gets executed inbetween your controller and view rendering.

I'm not overly familiar with Cake's core architecture, so what code
would this be? i.e. something in component / helper / behavior? I
was wrongly under the impression that the rendering would start as
soon as the controller action had finished...

> If debug kit is not the first component in your components array
> (that's a bad idea), that would explain both the holes and the numbers
> - I'd fix that first if I were you.

It wasn't the first component but it is now!

Thanks for any help you can give Andy.

--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Re: Implementing a search functionality

I didn't search there. I used another little know search engine called Joogle (or something like that): http://cakedc.com/downloads/view/cakephp_search_plugin

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 31 Oct 2011, at 13:30, Yves S. Garret wrote:

I looked in the book on cakephp.org and didn't find the search behavior.  Do you mean some other book?  Did I miss what you're describing?

On Fri, Oct 28, 2011 at 10:38 PM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
The answer (again) is in the error message. 'set' is a controller function and you are using it in a behaviour. set 'sets' a variable in the controller and passes it to the view. Here's the chain of events:

- user clicks a link or submits a form to a specified url
- that url is routed to a controller action (/controller/action/[parameters])
- the controller action does the stuff you tell it to
- this usually means calling some model functions, in your case the search method of the Provider model
- the model can use a behaviour method, in your case the search method of the Searchable behaviour (when a behaviour is attached to a model its methods are available as if they were native to the model)
- the model/behaviour performs database activity/business logic and returns variables to the calling controller function (note: 'return')
- the controller function receives those variables and 'sets' them ready for the view
- the controller then renders the view (generally of the same name as the controller action)
- the view renders html and can refer to the variables set and passed by the controller

Your code is not doing this.

Yves - can I recommend that you read the Cookbook? Amongst other things there is a really good Searchable behaviour out there that will do what you need.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 28 Oct 2011, at 22:11, Yves S. Garret wrote:

This is the structure of my folder tree and all of the pertinent files:
app\
  controllers\
    providers_controller.php [  http://bin.cakephp.org/view/1496172779  ]
  models\
    behaviors\
      searchable.php [  http://bin.cakephp.org/view/1269850925  ]
    provider.php [  http://bin.cakephp.org/view/1936681668  ]
  views\
    providers\
      view_admit_lookup.ctp [  http://bin.cakephp.org/view/1887805610  ]

The issue that I'm having is that when I try to search (say the word Smith), I get this error:

Fatal error: Call to undefined method SearchableBehavior::set() in D:\Inetpub\wwwroot-clinical\pythia-admit-lookup\app\models\behaviors\searchable.php on line 4

I find this confusing.  I'm already setting the last_name in my view... so shouldn't it be grabbing that info?

On Tue, Oct 25, 2011 at 3:00 PM, Yves S. Garret <yoursurrogategod@gmail.com> wrote:
Jeremy, thanks for your help.  I'll take the time to go through the blog tutorial at the moment.  I was kind of forced into this development process with little prep work or understanding of what's going on (the same would be to have you write a project in APL :-] ).

I'll get back to this thread after learning more about how Cake works and what it is capable of.


On Tue, Oct 25, 2011 at 2:30 PM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
Your controller function sets variables and passes them to a view of the same name as the function. In your case, your function is called search_admit_lookup, so it will try to render a view called search_admit_lookup. That view will contain the logic to present whatever variables are set in the function and passed to the view. You can use whatever html you want in the view.


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 25 Oct 2011, at 18:23, Yves S. Garret wrote:

It does not.  What I would like to do is to output the search results on a table right below the text box and search button.

Gonna look into that now.

On Tue, Oct 25, 2011 at 12:46 PM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
The clue is in the error. Does that view exist? Your bin paste shows view_admit_lookup.ctp, not search_admit_lookup.ctp.


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 25 Oct 2011, at 17:34, Yves S. Garret wrote:

Well, as annoying as it sounds, I just cleaned up the mess that was my previous implementation.

When I run the search, I'm getting this error:

Error: The view for ProvidersController::search_admit_lookup() was not found.

Error: Confirm you have created the file: D:\Inetpub\wwwroot-clinical\pythia-admit-lookup\app\views\providers\search_admit_lookup.ctp

Notice: If you want to customize this error message, create app\views\errors\missing_view.ctp


I got a meeting that I need to be at, I'll have a look after about 2 hours (hopefully it ends by then).


On Tue, Oct 25, 2011 at 11:38 AM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
It's OK....

Yup - looks better now, and you are right you are setting the provider variable - I was looking at the wrong function. ^^

So are you all in the clear now?


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 25 Oct 2011, at 16:26, Yves S. Garret wrote:

Oh, wait, God that was one hell of a copy/paste goof.  Sorry about that.

provider.php (Model):
providers_controller.php (Controller):
view_admit_lookup.ctp (View):


On Tue, Oct 25, 2011 at 11:07 AM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
OK - but you still haven't applied all of the changes I outlined.

This line in your controller:
  1.     function view_admit_lookup() {
  2.         $this->set('provider'$this->paginate());

...is setting a variable called $provider with a value. That will be available in the view (view_admit_lookup) as $providers.

In your view you are looping through a variable called $Providers.

 <?php foreach ($Providers as $i => $prov)?>

$providers does not equal $Providers.

I'd change the controller to:

  1.     function view_admit_lookup() {
  2.         $this->set('providers'$this->paginate());

... and the view to

 <?php foreach ($providers as $i => $prov)?>

Also see my comment about your form name in the view (and the use of $form). To save you the tiresome task of actually reading anything and carrying out the instructions, let me correct it for you:

  1.     echo $this->Form->create("Provider"array('action' => 'search'));
  2.     echo $this->Form->input("doc_last_name"array('label' => 'Doctor Last Name'));
  3.     echo $this->Form->submit('Search');
  4.     echo $this->Form->end();

Also, the form is specifying that it posts to an action 'search' - does this exist in your providers controller? I can't see it.


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 25 Oct 2011, at 15:57, Yves S. Garret wrote:

Yes, they're wrong.  But being new I was sure how correct/incorrect my approach was.  I'm working off of the stuff of another developer (who made the said file names).

This is what I have setup now:

app\
  controllers\
    providers_controller.php
  models\
    provider.php
  views\
    providers\
      view_admit_lookup.ctp

provider.php:
http://bin.cakephp.org/view/1833911095
providers_controller.php:



On Tue, Oct 25, 2011 at 10:10 AM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
Why. Not. Read. My. Post? And the guide? With the link I sent you?

From this tree I can tell you that the model file should be lower case and that view is not named correctly. Lower case, with underscores, to match the controller function name (as I mention in my post(s)).

Once you have read the answers to your questions, applied the advice and adhered to conventions, please come back with any other errors.


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 25 Oct 2011, at 14:19, Yves S. Garret wrote:

This time I'll include the file names and where they are:

app\
  controllers\
    providers_controller.php (has ProvidersController class)
  models\
    Provider.php (has Provider class)
  views\
    providers\
      viewAdmitLookup.ctp (contains all of the view display stuff)

On Tue, Oct 25, 2011 at 9:16 AM, Yves S. Garret <yoursurrogategod@gmail.com> wrote:
Thanks, this is the structure of my directory tree, tell me if I need to re-name anything:

app\
  controllers\
  models\
  views\
    providers\

Should I rename the providers directory to provider?


On Mon, Oct 24, 2011 at 11:33 PM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
Your conventions are all over the place. Its best to stick to them.

Did you change the code inside the controller as suggested in my first post?

  1. class ProvidersController extends AppController {
  2.     var $name = 'Providers';

The filename is view_admit_lookup, yet the controller function is viewAdmitLookup - they should match. Change the function name to view_admit_lookup

In the view, you have this:

echo $form->create("Providers"array('action' => 'search'));

It'll create a form that tries to find the Providers model, not the Provider model. Change it to:

echo $form->create("Provider"array('action' => 'search'));

Change Providers to Provider throughout the view code.

In your controller function you have $this->set('providers'... which sends a variable $providers into the view, yet in the view you are iterating through a variable called $Providers. Change the variable in the view to $providers.

Your are using $form-> when you should be using $this->Form (that's the syntax for helpers in general, so $this->Html etc).

See this section of the book on conventions:


You can deviate from them with additional work, but it is not worth the effort else you'll run into issues like this.


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 24 Oct 2011, at 22:39, Yves S. Garret wrote:

Ok, now I'm getting this when I turned everything to plural.

Missing Controller

Error: ProviderController could not be found.

Error: Create the class ProviderController below in file: app\controllers\provider_controller.php

<?php class ProviderController extends AppController {  	var $name = 'Provider'; } ?> 

Notice: If you want to customize this error message, create app\views\errors\missing_controller.ctp


Model:

http://bin.cakephp.org/view/361596401

View:

http://bin.cakephp.org/view/1786526282

Controller:

http://bin.cakephp.org/view/1385185838


On Mon, Oct 24, 2011 at 4:56 PM, Yves S. Garret <yoursurrogategod@gmail.com> wrote:
Yup.  CakePHP 1.3.  The view is in \app\views\providers\view_admit_lookup.ctp

The controller file name is providers_controller.php.  I added the variable that you suggested to the model file (which is called Provider.php) and I get the same error :-( .


On Mon, Oct 24, 2011 at 2:03 PM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
Did you change anything? This is 1.3, right?

The filename should be providers_controller.php
Change the code as per my post below.
The view should be in /app/views/providers/
Add $var $name = 'Provider'; to the beginning of the Provider model file.


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 24 Oct 2011, at 18:40, Yves S. Garret wrote:

This is my view:
This is my controller:
This is my model:

This is the error that I'm getting:

Missing Controller

Error: ProviderController could not be found.

Error: Create the class ProviderController below in file: app\controllers\provider_controller.php

<?php class ProviderController extends AppController {  	var $name = 'Provider'; } ?> 

Notice: If you want to customize this error message, create app\views\errors\missing_controller.ctp


:-/


On Mon, Oct 24, 2011 at 1:31 PM, Jeremy Burns | Class Outfit <jeremyburns@classoutfit.com> wrote:
Your controller names should be plural; try:

  1. class ProvidersController extends AppController {
  2.     var $name = 'Providers';


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 24 Oct 2011, at 18:24, Yves S. Garret wrote:

Ok, this is weird.

I found this tutorial on doing searches.

That's good.  Now, this is my Model:
View:
Controller:

Now, when I run the search based on someone, I get something like this:

Missing Controller

Error: ProvidersController could not be found.

Error: Create the class ProvidersController below in file: app\controllers\providers_controller.php

<?php class ProvidersController extends AppController {  	var $name = 'Providers'; } ?> 

Notice: If you want to customize this error message, create app\views\errors\missing_controller.ctp

Now, I don't have Providers, I have Provider (singular only), so where is it getting the plural from?







On Fri, Oct 21, 2011 at 12:30 PM, Yves S. Garret <yoursurrogategod@gmail.com> wrote:
My question in that case would be, why am I getting that error?


On Thu, Oct 20, 2011 at 5:12 PM, Yves S. Garret <yoursurrogategod@gmail.com> wrote:
I have a decent understanding of what the tutorial is trying to do.  However, trying it to move it into my project is my present issue.

Here is my model:
Here is my controller:
Here is my view:

The issue that I get when I run Search:

Missing Controller

Error: ProvidersController could not be found.

Error: Create the class ProvidersController below in file: app\controllers\providers_controller.php

<?php class ProvidersController extends AppController {  	var $name = 'Providers'; } ?> 

Notice: If you want to customize this error message, create app\views\errors\missing_controller.ctp


provider_controller.php has a var $name = 'Providers'; as the name... 


On Tue, Oct 18, 2011 at 3:27 PM, Dee Johnson <devariojay@gmail.com> wrote:
my apologies, I saw where you said you wanted to make the tutorial simpler and i assumed that you already knew how to make calls etc. 

The tutorial is using a search behavior (which probably does the calls - i haven't looked to verify)

but to answer your question from above, I would recommend doing the tutorial OUTSIDE of your current project just to familiarize yourself with what it is asking you to do. 

Once you get that up and running you would have a much better understanding of what direction you would rather go in as a developer. 

so...yes...follow all steps in the tut. 

Now, if you are going away from the tutorial, you can just the data that comes back in the $this->data collection from your search box in the view and use that model call I used above.  If you dont understand this last bit, it is best you try the tutorial out first with a fresh install etc...so as not to disrupt your project or in the very least back it up.


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php




--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php



--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php



--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php



--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php


--
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php