Saturday, January 31, 2009

Re: Debugging Auth component

Andrea:

Check and make sure you don't have caching enabled. If you do, clean
up the /tmp/ directory and try again. This sometimes when in dev. mode
causes problems.

Regards,

Alfredo


On Sat, Jan 31, 2009 at 5:18 AM, Andrea Cardinale <mirthis@gmail.com> wrote:
>
> Hi guys, I'm getting quite crazy with the auth component.
> Some days ago I followed the 'Simple Acl controlled Application'
> tutoriale and everything worked fine. After that I start adding stuff
> to my user model and user controller and now Auth doesn't work
> anymore. I can login correctly but every action not declared as
> allowed is not accessible even from the User who belongs to the
> administrators group.
> I don't know where to start to debug Auth calls and to see where it
> get stuck. Any suggestion?
> Thanks.
>
> Andrea
>
> >
>

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

Re: Help Cake newbie (i really want to bake succesfully)

Hi

thanks for the response. I am not sure if I have this figured out but
I believe its not working for me because my database is a myISAM db.
From what I read I think cake only suports INNODB joins automatically
(as to say it can only automatically relate tables based on foreign
keys which are only possible in an INNODB database). Am I right?

If not and I am still missing something here is the code you
requested.

views/authors/index.ctp
<?php foreach($authors as $author): ?><h2><?php echo $author['Author']
['name'] ?></h2><hr /><h3>Book(s):</h3><ul><?php foreach($author
['Book'] as $book): ?><li><?php echo $book['title'] ?></li><?php
endforeach; ?></ul><?php endforeach; ?>

/controllers/authors_controller.php

<?php
class AuthorsController extends AppController {
var $name = 'Authors';
function index() {
$this->Author->recursive = 1;
$authors = $this->Author->find('all');
$this->set('authors', $authors); }
}
?>


On Jan 31, 10:32 pm, brian <bally.z...@gmail.com> wrote:
> As you're in the authors view, I'll assume that you're trying to
> retrieve associated Books for Author. If you post the contents of your
> view action, as well as the $hasMany and $belongsTo arrays for Author
> and Book respectively, I'm sure someone can help you sort it out.
>
> Also, if you're using $this->Author->paginate() instead of find(),
> post your controller's $paginate array.
>
>
>
> On Sat, Jan 31, 2009 at 8:48 PM, CP <in...@leatherbelts.com> wrote:
>
> > I followed this artcielhttp://www.packtpub.com/article/working-with-simple-associations-usin...
>
> > But when was unable to get everything working correctly.
> > I got everything working up to a point but at this point "Retrieving
> > Related Model Data in One-To-Many Relation" is where I started having
> > problems.
>
> > the error I am getting is below:
>
> > Notice (8): Undefined index:  Book [APP/views/authors/index.ctp, line
> > 1]
>
> > Anyone have any suggestions? Perhaps I have created the foreign key
> > incorrectly? I have been trying to figure it out for the past hour and
> > no luck. I hope someone can help me.
>
> > Signed
>
> > new baker- Hide quoted text -
>
> - Show quoted text -

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

i wants to know how can i import contacts from Google, yahoo or others using cakephp

hi all,


i am doing an application which requires importing contacts from the mail servers like Google , yahoo and hot mail.


how can i get Google API for contacts.....

can any body tell this. what i have to do first.

please reply me if you know.


thank u.

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

Re: Help Cake newbie (i really want to bake succesfully)

As you're in the authors view, I'll assume that you're trying to
retrieve associated Books for Author. If you post the contents of your
view action, as well as the $hasMany and $belongsTo arrays for Author
and Book respectively, I'm sure someone can help you sort it out.

Also, if you're using $this->Author->paginate() instead of find(),
post your controller's $paginate array.

On Sat, Jan 31, 2009 at 8:48 PM, CP <indie@leatherbelts.com> wrote:
>
> I followed this artciel http://www.packtpub.com/article/working-with-simple-associations-using-cakephp
>
> But when was unable to get everything working correctly.
> I got everything working up to a point but at this point "Retrieving
> Related Model Data in One-To-Many Relation" is where I started having
> problems.
>
> the error I am getting is below:
>
> Notice (8): Undefined index: Book [APP/views/authors/index.ctp, line
> 1]
>
> Anyone have any suggestions? Perhaps I have created the foreign key
> incorrectly? I have been trying to figure it out for the past hour and
> no luck. I hope someone can help me.
>
> Signed
>
> new baker
>
>
> >
>

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

Help Cake newbie (i really want to bake succesfully)

I followed this artciel http://www.packtpub.com/article/working-with-simple-associations-using-cakephp

But when was unable to get everything working correctly.
I got everything working up to a point but at this point "Retrieving
Related Model Data in One-To-Many Relation" is where I started having
problems.

the error I am getting is below:

Notice (8): Undefined index: Book [APP/views/authors/index.ctp, line
1]

Anyone have any suggestions? Perhaps I have created the foreign key
incorrectly? I have been trying to figure it out for the past hour and
no luck. I hope someone can help me.

Signed

new baker


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

Re: How to load HABTM Joining model in a plugin?

You just saved me hours of work.

Note to anyone else who stumbles upon this, you can see this problem
as well even if you're not using "with" in either of your HABTM
models, at least if you've "modelized" your join tables. Once I added
"with" to both sides of all my HABTM model associations, all worked
like a charm.

On Jan 18, 8:10 am, Martin Westin <martin.westin...@gmail.com> wrote:
> In case someone else wants to avoid spending an afternoon inside the
> ClassRegistry.
> Here is the wisdom I was lacking:
>
> When specifying "with" for a HABTM... you MUST specify this on both
> ends of the association.
>
> You cannotuse the "less changes = less errors" and start by trying
> to get one side (A->B) correct and then fill in the other side when it
> works from the first side. This is because if Cake chooses to load
> Class B first (even though I am in ControllerA and A tops B
> alphabetically) the registry will have created an AppModel called AB
> (joiningmodel) and when A loads, that Class is reused (as it
> should).  In a word: GAAAAAARRRRGHGHHH!!!
>
> It may sound dumb as h*** but it took me hours trawling line for line
> throughModel, ClassRegistry and App before I figured this out. I
> don't know how my associatedmodelmanaged to load first but I think
> I'll leave it here and get on with something productive.
>
> Keep Baking!
> /Martin
>
> On Jan 15, 8:42 am, Martin Westin <martin.westin...@gmail.com> wrote:
>
> > Sure. This is from the NewsMessage side of things
>
> > var $hasAndBelongsToMany = array(
> >     'NewsSubscriber' => array(
> >         'className'             => 'News.NewsSubscriber',
> >         'joinTable'             => 'news_messages_news_subscribers',
> >         'with'                  => 'News.NewsMessagesNewsSubscriber',
> >         'foreignKey'            => 'news_message_id',
> >         'associationForeignKey' => 'news_subscriber_id',
> >         'conditions'            => '',
> >         'order'                 => '',
> >         'limit'                 => '',
> >         'unique'                => true,
> >         'finderQuery'           => '',
> >         'deleteQuery'           => '',
> >         'insertQuery'           => ''
> >         )
> >     );
>
> > I have tried removing the "News." prefix.
> > I have tried putting the joinmodelin the "root" application.
> > (just to make see if anything happened)
>
> > /Martin
>
> > On Jan 14, 10:57 pm, Webweave <webwe...@gmail.com> wrote:
>
> > > Can you post your HABTM from your models ?
>
> > > It looks like you have themodelfilein the right place, so my guess
> > > is that the problem is in there.
>
> > > On Jan 14, 4:59 am, Martin Westin <martin.westin...@gmail.com> wrote:
>
> > > > Hi everyone,
>
> > > > This is the first time I have tried to make a realmodelfor a joining
> > > > table and I got really stuck on this seemingly simple thing. I just
> > > > cant get it to work. Does anyone know how thisfileshould be named?
>
> > > > I have a HABTM association between two models in a plugin. I have now
> > > > created a joiningmodelto be able to capture some callbacks and write
> > > > custom "behaviours". Problem is Cake doesnotload themodelbut
> > > > resorts to creating its magic "empty"modelbased on AppModel. It does
> > > >noteven seem to find themodel'sfile.
>
> > > > The facts:
>
> > > > News.NewsMessage habtm News.NewsSubscriber
>
> > > > --- among other things in NewsMessage
> > > > 'with' => 'News.NewsMessagesNewsSubscriber',
> > > > ---
>
> > > > --- NewsMessagesNewsSubscriber
> > > > debug('NewsMessagesNewsSubscriberfilewas loaded');
> > > > class NewsMessagesNewsSubscriber extends NewsAppModel {
> > > >     var $name = 'NewsMessagesNewsSubscriber';
> > > >     function afterFind() {
> > > >         debug('NewsMessagesNewsSubscriber class was used in a find');
> > > >     }}
>
> > > > ---
>
> > > > I have but debug lines straight into themodelfileto see if it loads
> > > > at all and nothing. So I guess I have to name it something special I
> > > > can't figure out.
>
> > > > I have tried the following files placed in app/plugins/news/models/
> > > > news_messages_news_subscriber.php <-- should be this one, right?
> > > > news_message_news_subscriber.php
> > > > news_messages_news_subscribers.php
>
> > > > If you know what I should call thisfile, please reply while I have a
> > > > few hairs left on my head ;)
> > > > thanks
>
> > > > Martin Westin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: AJAX update of related model

I can't say for sure, as I'm unfamiliar with Cake's ajax stuff (I use
jquery) but it looks to me like your validation rules may be the
problem. The last param to saveField is true, thus triggering
validation. Check the model's validationErrors:

Debugger::log($this->PhdUser->validationErrors);
$this->set('error', true);

On Sat, Jan 31, 2009 at 4:05 PM, Al <al.scheuring@gmail.com> wrote:
>
> Hello All,
> I have two models PhdUser and PhdApplication.
> I'm trying to update information in PhdApplication using the following
> controller. (note: this works fine with data in PhdUser, and their
> linked correctly)
>
> function ajaxupdate($userID = null,$sub) {
>
> //Step 1. Update the value in the database
> $value = $this->params['form']['value']; //new value to save
> $this->PhdUser->id = $userID;
> if (!$this->PhdUser->saveField($sub, $value,true)) { // Update the
> field
> $this->set('error', true);
> }
>
> //Step 2. Set the view variable and render the view.
> $this->set('value',$value);
> $this->beforeRender();
> $this->layout = 'ajax';
> }
>
> And I'm using this as the editor:
>
> <?php
> echo $ajax->editor(
> 'divSubmitted',
> array(
> 'controller' => 'PhdUsers',
> 'action' => 'ajaxupdate',
> $phd_users['PhdUser']['userID'],
> '/submitted'
> ),
> array('collection' => array(array('no','no'), array('yes','yes'))));
>
> However I'm not getting it to save to PhdApplication.
>
> Is there something obvious I'm missing? Do I need to put an ajaxupdate
> function in each controller?
>
> thanks so much for taking the time to look this over (if you've gotten
> this far)
> >
>

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

Re: if then isn't working

If you want to do alternating rows:

if ($counter % 2)

NOW if you want to do it at say every 5 rows:

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

Re: if then isn't working

Thank you very much, I used your comments along with suggestions (and
suggestions to comment :) ) to make it perfect.

On Jan 31, 12:00 pm, brian <bally.z...@gmail.com> wrote:
> To add to Xoubaman's response, it's best if you specify *what* errors
> you're getting if you want help.
>
> btw, if anyone's confused, "bucle" means "loop" (or "circuit") in french ;-)
>
> On Sat, Jan 31, 2009 at 11:13 AM, Xoubaman <xouba...@gmail.com> wrote:
>
> > echo("<tr><td width='225px'>")  only happens if $j==4, but echo("</
> > td></tr>"); happens in every first bucle iterations, so you are
> > closing lots os rows and columns.
>
> > On Jan 31, 3:56 pm, thankyou <gregbo...@gmail.com> wrote:
> >> ** im a beginner :)
>
> >> I'm trying to get this to make 20 rows of 5 colums each and I'm
> >> continuing to get errors. Any idea what's wrong?  Here's the code:
>
> >> <table width='100%' border='0'>
> >> <tr>
> >> <td width='100%' align='center'>
> >>         <table>
> >> <?php
> >>               $text = ' area code';
> >>               for($i = 0; $i < 10; $i++)
> >>                 {
> >>                         for($j = 0; $j < 10; $j++)
> >>                         {
>
> >>                             if($j == 4)
> >>                            {
> >>                                 echo("<tr><td width='225px'>");
> >>                                }
> >>                                 echo($html->link($firstNumber . $i. $j . $text , "/AreaCodes/
> >> detail/". $firstNumber . $i. $j, array('class'=>'area_code_link')));
> >>                                 echo("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
> >>                         }
> >>                         echo("</td></tr>");
> >>                 }
>
> >> ?>
> >> </table>
> >> </td>
> >> </tr>
> >> </table>
>
> >> <?
> >>         }
> >> ?>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Upgrade to Cake 1.2.1 stable problems

Why is there a dollar sign before the model? Are you calling a model
dynamically? $this->$documentsTagsModel?

On Jan 31, 12:40 pm, Mathew <nfoscar...@yahoo.com> wrote:
> Looks like they have changed HABTM so that it calls "new AppModel" for
> the join table. Even if a model exists that is of the same name as the
> join table. So if I list the HABTM table and the join table in my uses
> for the controller, then it will not load the associations for the
> join model.
>
> Is this a bug?
>
> I might be able to work around this by renaming my join model to
> something else, but then it no longer follows the Cake naming
> convention.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: if then isn't working

Sorry, I wasn't clear enough.
The error I was getting was just a blank page.

I had the 1-10 for i and j as they are actually written in the
columns. For example it would say 00, 01, 02, 03, 04 in the first
row, then in the next row it would say 05, 06, 07, 08, 09 followed by
the third row of 10, 11,12,13, etc... upto 99

How could I tweak the above for that?

Thank you

On Jan 31, 12:00 pm, brian <bally.z...@gmail.com> wrote:
> To add to Xoubaman's response, it's best if you specify *what* errors
> you're getting if you want help.
>
> btw, if anyone's confused, "bucle" means "loop" (or "circuit") in french ;-)
>
> On Sat, Jan 31, 2009 at 11:13 AM, Xoubaman <xouba...@gmail.com> wrote:
>
> > echo("<tr><td width='225px'>")  only happens if $j==4, but echo("</
> > td></tr>"); happens in every first bucle iterations, so you are
> > closing lots os rows and columns.
>
> > On Jan 31, 3:56 pm, thankyou <gregbo...@gmail.com> wrote:
> >> ** im a beginner :)
>
> >> I'm trying to get this to make 20 rows of 5 colums each and I'm
> >> continuing to get errors. Any idea what's wrong?  Here's the code:
>
> >> <table width='100%' border='0'>
> >> <tr>
> >> <td width='100%' align='center'>
> >>         <table>
> >> <?php
> >>               $text = ' area code';
> >>               for($i = 0; $i < 10; $i++)
> >>                 {
> >>                         for($j = 0; $j < 10; $j++)
> >>                         {
>
> >>                             if($j == 4)
> >>                            {
> >>                                 echo("<tr><td width='225px'>");
> >>                                }
> >>                                 echo($html->link($firstNumber . $i. $j . $text , "/AreaCodes/
> >> detail/". $firstNumber . $i. $j, array('class'=>'area_code_link')));
> >>                                 echo("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
> >>                         }
> >>                         echo("</td></tr>");
> >>                 }
>
> >> ?>
> >> </table>
> >> </td>
> >> </tr>
> >> </table>
>
> >> <?
> >>         }
> >> ?>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

AJAX update of related model

Hello All,
I have two models PhdUser and PhdApplication.
I'm trying to update information in PhdApplication using the following
controller. (note: this works fine with data in PhdUser, and their
linked correctly)

function ajaxupdate($userID = null,$sub) {

//Step 1. Update the value in the database
$value = $this->params['form']['value']; //new value to save
$this->PhdUser->id = $userID;
if (!$this->PhdUser->saveField($sub, $value,true)) { // Update the
field
$this->set('error', true);
}

//Step 2. Set the view variable and render the view.
$this->set('value',$value);
$this->beforeRender();
$this->layout = 'ajax';
}

And I'm using this as the editor:

<?php
echo $ajax->editor(
'divSubmitted',
array(
'controller' => 'PhdUsers',
'action' => 'ajaxupdate',
$phd_users['PhdUser']['userID'],
'/submitted'
),
array('collection' => array(array('no','no'), array('yes','yes'))));

However I'm not getting it to save to PhdApplication.

Is there something obvious I'm missing? Do I need to put an ajaxupdate
function in each controller?

thanks so much for taking the time to look this over (if you've gotten
this far)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Upgrade to Cake 1.2.1 stable problems

Looks like they have changed HABTM so that it calls "new AppModel" for
the join table. Even if a model exists that is of the same name as the
join table. So if I list the HABTM table and the join table in my uses
for the controller, then it will not load the associations for the
join model.

Is this a bug?

I might be able to work around this by renaming my join model to
something else, but then it no longer follows the Cake naming
convention.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Upgrade to Cake 1.2.1 stable problems

Hi,

I was running Cake 1.2.0.7692 RC3 with a model that has a $belongsTo
from the PortfolioTag table to the Portfolio table. I could run this
Find statement.

$count = $this->$documentsTagsModel->find('count',array
('conditions'=>array('tag_id'=>$tagRecord
['id'],'published'=>1,'front_page'=>1),'recursive'=>2));

And it out generate this SQL statement.

SELECT COUNT(*) AS `count` FROM `portfolio_tags` AS `PortfolioTag`
LEFT JOIN `portfolio` AS `Portfolio` ON (`PortfolioTag`.`portfolio_id`
= `Portfolio`.`id`) LEFT JOIN `tags` AS `Tag` ON
(`PortfolioTag`.`tag_id` = `Tag`.`id`) WHERE `tag_id` = 1 AND
`published` = 1 AND `front_page` = 1

After upgrading to Cake 1.2.1 Stable the same Find generates this SQL
statement which missing the LEFT JOIN so it fails.

SELECT COUNT(*) AS `count` FROM `portfolio_tags` AS `PortfolioTag`
WHERE `tag_id` = 7 AND `published` = 1 AND `front_page` = 1

How do I fix this?

Changing the recursive value for the find doesn't seem to fix the
problem.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Accessing $javascript->object() results

I found one link finally on google, but it doesn't provide enough
detail. Seems he uses jQuery, but I don't know anything about jQuery.

http://debuggable.com/posts/passing-controller-variables-to-your-javascript:48b4f0c6-c718-47b2-bca1-05794834cda3

Here it is for reference. I still would like to know a more basic
method, either with plain javascript or prototype as that is what cake
uses.

On Jan 29, 4:26 pm, Pyrite <thelette...@gmail.com> wrote:
> I have found many blogs talking about how you can have your controller
> send to your view the results of some:
>
> $data = $this->MyModel->find('all', array('some params'));
> $this->set('data', $data);
>
> And then in your view:
>
> echo $javascript->object($data);
>
> Now, how the heck in the view using Javascript do I access the results
> of that method. I know it outputs a JSON string, and I figured I would
> probably want to output it in a javascript var in my layout like:
>
> <script type="text/javascript">
> var myJsonObject = <?php echo $javascript->object($data); ?>;
> </script>
>
> So how (using Javascript) in my view do I access the data in
> myJsonObject???
>
>  Like I want to populate some select dropdowns with it. Just not sure
> of the syntax to access myJsonObject.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: if then isn't working

The I and J both need to go from 0 to 9, as it need it to say 100,
101, 102, .....999 in those rows. I don't think the below will do
that since i is going upto 20

On Jan 31, 12:00 pm, brian <bally.z...@gmail.com> wrote:
> To add to Xoubaman's response, it's best if you specify *what* errors
> you're getting if you want help.
>
> btw, if anyone's confused, "bucle" means "loop" (or "circuit") in french ;-)
>
> On Sat, Jan 31, 2009 at 11:13 AM, Xoubaman <xouba...@gmail.com> wrote:
>
> > echo("<tr><td width='225px'>")  only happens if $j==4, but echo("</
> > td></tr>"); happens in every first bucle iterations, so you are
> > closing lots os rows and columns.
>
> > On Jan 31, 3:56 pm, thankyou <gregbo...@gmail.com> wrote:
> >> ** im a beginner :)
>
> >> I'm trying to get this to make 20 rows of 5 colums each and I'm
> >> continuing to get errors. Any idea what's wrong?  Here's the code:
>
> >> <table width='100%' border='0'>
> >> <tr>
> >> <td width='100%' align='center'>
> >>         <table>
> >> <?php
> >>               $text = ' area code';
> >>               for($i = 0; $i < 10; $i++)
> >>                 {
> >>                         for($j = 0; $j < 10; $j++)
> >>                         {
>
> >>                             if($j == 4)
> >>                            {
> >>                                 echo("<tr><td width='225px'>");
> >>                                }
> >>                                 echo($html->link($firstNumber . $i. $j . $text , "/AreaCodes/
> >> detail/". $firstNumber . $i. $j, array('class'=>'area_code_link')));
> >>                                 echo("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
> >>                         }
> >>                         echo("</td></tr>");
> >>                 }
>
> >> ?>
> >> </table>
> >> </td>
> >> </tr>
> >> </table>
>
> >> <?
> >>         }
> >> ?>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: sorting/ordering with foreign key

I think that needs to be:

$this->Invoice->find('all',array(),array(), 'invno_id DESC')

When using find() in that way, the $order param isn't an array and, in
any case, the way you had it would be a syntax error.

Personally, I always set up my find like:

$filters = array(
'conditions' => array(...),
'order' => array('Invoice.invno_id' => 'DESC'),
etc.
);

$this->Invoice->find('all', $filters);

On Sat, Jan 31, 2009 at 2:27 AM, forrestgump <vikhyat86@gmail.com> wrote:
>
> Hey Guys,
> Consider the following example
> I have 2 tables....
>
> table1: invnos
> fields: id,invno
>
> table2: invoices
> fields: id,invno_id
>
> now i wish to write a query that will order my find in the invoices
> table according to the invno in the invnos table
>
> can someone help me out with it...the best i could write is...
>
> $this->Invoice->find('all',array(),array(),'order' => 'invno_id DESC')
>
> but it seems to be ordering by the invno_id that i stored in the
> invoices table
>
> thanx in advance,
> Forrestgump
> >
>

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

Re: if then isn't working

To add to Xoubaman's response, it's best if you specify *what* errors
you're getting if you want help.

btw, if anyone's confused, "bucle" means "loop" (or "circuit") in french ;-)

On Sat, Jan 31, 2009 at 11:13 AM, Xoubaman <xoubaman@gmail.com> wrote:
>
> echo("<tr><td width='225px'>") only happens if $j==4, but echo("</
> td></tr>"); happens in every first bucle iterations, so you are
> closing lots os rows and columns.
>
> On Jan 31, 3:56 pm, thankyou <gregbo...@gmail.com> wrote:
>> ** im a beginner :)
>>
>> I'm trying to get this to make 20 rows of 5 colums each and I'm
>> continuing to get errors. Any idea what's wrong? Here's the code:
>>
>> <table width='100%' border='0'>
>> <tr>
>> <td width='100%' align='center'>
>> <table>
>> <?php
>> $text = ' area code';
>> for($i = 0; $i < 10; $i++)
>> {
>> for($j = 0; $j < 10; $j++)
>> {
>>
>> if($j == 4)
>> {
>> echo("<tr><td width='225px'>");
>> }
>> echo($html->link($firstNumber . $i. $j . $text , "/AreaCodes/
>> detail/". $firstNumber . $i. $j, array('class'=>'area_code_link')));
>> echo("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
>> }
>> echo("</td></tr>");
>> }
>>
>> ?>
>> </table>
>> </td>
>> </tr>
>> </table>
>>
>> <?
>> }
>> ?>
>
> >
>

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

Re: Using Jquery

Yes, Cake's ajax stuff is all Prototype-based. I read somewhere that
they're planning to move to jquery but I don't know the specifics (or,
whether it's true, for that matter).

But jquery is generally so easy to work with that losing Cake's ajax
help shouldn't be too big a deal. You'll just need to include some JS
code yourself.

On Sat, Jan 31, 2009 at 12:25 AM, WidePixels <dave@widepixels.com> wrote:
>
> I am new and I know this is a laughable question so I am prepared for
> the laugher but here goes.
>
> If you are using Jquery rather than the Protoype and Scriptauculous,
> is the
> $ajax->xxx useless? Can you use the ajax helper at all? If not what do
> you do when you want to use ajax. Example
>
> $ajax->form becomes what if you are using jQuery?
>
> Bring it on...laugh away... :)
>
> Dave
>
> >
>

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

Re: $scripts_for_layout breaks in seperated header

My advice is to leave the head section in the layout. Elements/views
are rendered before the layout. Moving the head section to there would
mean, as you're finding out, that you may as well rewrite both the
HtmlHelper & JavascriptHelper yourself.

As far as inline js/css goes, I think you missed some parameters for
those methods:

HtmlHelper::css( $path, $rel = NULL, $htmlAttributes = array ( ),
$inline = true )
JavascriptHelper::link( $url, $inline = true )
JavascriptHelper::codeBlock( $script = NULL, $options = array ( ) )

The last one's a little confusing. Just add 'inline' => false to the
options array. I think the Cake devs chose the wrong default for
$inline for all of these but that's just me.

Echo the basic javascript tags required in your head (in the layout)
followed by the $scripts_for_layout var. Any other scripts you may
require can be echoed in the view/element with $inline set to false
and it'll be added to the $scripts_for_layout var (and, ultimately, to
the head eection).


On Fri, Jan 30, 2009 at 7:11 PM, mlecho <saltlessbread@gmail.com> wrote:
>
> hi-
> in my app, i have sperated the header and footer as new elements
> (header.ctp/footer.ctp). The default.ctp uses $this->element('header')
> for example, to retrieve the header. I am doing this becuase i have
> to change headers/footers from layout to layout (sometimes). Anyway,
> by seperating the header $scripts_for_layout suddenly becomes broken:
> Notice (8): Undefined variable: scripts_for_layout, leavine me with
> the only option of inline css/js. Ugh.
>
> is there a way to work around this? In the views i would like to call
> specific javascripts or css, as some js/css is not pertinant to other
> pages. Thanks
>
> >
>

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

Re: if then isn't working

On Jan 31, 4:56 pm, thankyou <gregbo...@gmail.com> wrote:
> ** im a beginner :)
>
> I'm trying to get this to make 20 rows of 5 colums each and I'm
> continuing to get errors. Any idea what's wrong?  Here's the code:
>
> <table width='100%' border='0'>
> <tr>
> <td width='100%' align='center'>
>         <table>
> <?php
>               $text = ' area code';
for ( $i = 0; $i < 20; $i++ ) // Number of rows!
>                 {
>                         for($j = 0; $j < 10; $j++)
>                         {
>
>                             if($j == 4)
>                            {
>                                 echo("<tr><td width='225px'>");
>                                }
>                                 echo($html->link($firstNumber . $i. $j . $text , "/AreaCodes/
> detail/". $firstNumber . $i. $j, array('class'=>'area_code_link')));
>                                 echo("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
>                         }
>                         echo("</td></tr>");
>                 }
>
> ?>
> </table>
> </td>
> </tr>
> </table>
>
> <?
>         }
> ?>

Correct your code! Use comments more, so you understand it yourself!

for ( $i = 0; $i < 20; $i++ ) // Number of rows! 0 to 19 = 20
{
echo "<tr>";
for ( $j = 0; $j < 5; $j++ ) // Number of columns in a row! 0 to 4
= 5
{
echo "<td>"; // Start of column
echo $html->link($firstNumber . $i. $j . $text , "/AreaCodes/
detail/". $firstNumber . $i. $j, array('class'=>'area_code_link'));
echo "</td>"; // End of column
}
echo "</tr>\n"; // End of row
}

Next time, do write what errors you are getting! That will help a lot!
Enjoy
John

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

Re: Ajax Forms

It's pointing to edit() automatically because Cake found the Artist
ID. You need to specify the form action to override that behavior:

$form->create('Artists', array('action' => 'edit_artists'));

On Sat, Jan 31, 2009 at 12:20 AM, WidePixels <dave@widepixels.com> wrote:
>
> Wondering how to create form that will edit on a specific table.
> Example is I have a User that on their Profile has data that relates
> to a HABTM set up. For example on the user Profile there are blocks of
> data that represent Artists, Genres, and Favorites which all belong to
> the User.
>
> So when the User is viewing their own Profile they can edit specific
> areas and not 1 big form. So if they click edit artists, its a form
> that only shows the Artists part of the profile.
>
> I copied the edit function straight from baking and renamed it
> edit_artists and copied the edit form removing all the elements except
> for the artists part, and shows just the artists as I want.
> But the form when I check the rendered HTML seems to still be using
> the edit function to save the data, not my edit_artists function.
>
> The edit_artists form looks like:
>
> <div class="update artists form">
> <?php echo $form->create('Artists');?>
> <fieldset>
> <legend><?php __('Update artists');?></legend>
> <?php
> echo $form->hidden('id');
> echo $form->hidden('user_id');
> ?>
> <div class="user_checks"><?php echo $form->input('Artists',array
> ('multiple'=>'checkbox', 'label' => 'Artists:'));?></div>
> </fieldset>
> <?php echo $form->end('Submit');?>
>
> It works but is that how its supposed to work?
>
> Thanks,
> Dave
>
>
> >
>

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

Re: if then isn't working

echo("<tr><td width='225px'>") only happens if $j==4, but echo("</
td></tr>"); happens in every first bucle iterations, so you are
closing lots os rows and columns.

On Jan 31, 3:56 pm, thankyou <gregbo...@gmail.com> wrote:
> ** im a beginner :)
>
> I'm trying to get this to make 20 rows of 5 colums each and I'm
> continuing to get errors. Any idea what's wrong?  Here's the code:
>
> <table width='100%' border='0'>
> <tr>
> <td width='100%' align='center'>
>         <table>
> <?php
>               $text = ' area code';
>               for($i = 0; $i < 10; $i++)
>                 {
>                         for($j = 0; $j < 10; $j++)
>                         {
>
>                             if($j == 4)
>                            {
>                                 echo("<tr><td width='225px'>");
>                                }
>                                 echo($html->link($firstNumber . $i. $j . $text , "/AreaCodes/
> detail/". $firstNumber . $i. $j, array('class'=>'area_code_link')));
>                                 echo("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
>                         }
>                         echo("</td></tr>");
>                 }
>
> ?>
> </table>
> </td>
> </tr>
> </table>
>
> <?
>         }
> ?>

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

if then isn't working

** im a beginner :)

I'm trying to get this to make 20 rows of 5 colums each and I'm
continuing to get errors. Any idea what's wrong? Here's the code:


<table width='100%' border='0'>
<tr>
<td width='100%' align='center'>
<table>
<?php
$text = ' area code';
for($i = 0; $i < 10; $i++)
{
for($j = 0; $j < 10; $j++)
{

if($j == 4)
{
echo("<tr><td width='225px'>");
}
echo($html->link($firstNumber . $i. $j . $text , "/AreaCodes/
detail/". $firstNumber . $i. $j, array('class'=>'area_code_link')));
echo("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
}
echo("</td></tr>");
}

?>
</table>
</td>
</tr>
</table>

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

Re: Cache not configured properly on Mac OS X

yep - didn't work for me though. Can't be bothered to look into it the
as I'm the only one using my server.

On Jan 30, 5:17 pm, Rick <will...@gmail.com> wrote:
> Instead of setting permissions on all tmp files/directories you can
> just chown the ownership of the tmp directory to "www" (the user that
> apache runs under).
>
> sudo chown -R www <tmp directory>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: Using Jquery

Yes I believe the ajax helper is useless at the point. I usually
create my own jquery helper.

On Jan 30, 9:25 pm, WidePixels <d...@widepixels.com> wrote:
> I am new and I know this is a laughable question so I am prepared for
> the laugher but here goes.
>
> If you are using Jquery rather than the Protoype and Scriptauculous,
> is the
> $ajax->xxx useless? Can you use the ajax helper at all? If not what do
> you do when you want to use ajax. Example
>
> $ajax->form becomes what if you are using jQuery?
>
> Bring it on...laugh away... :)
>
> Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: html select State/Country dropdown in CakePHP ?

Usually the states/countries would need to be stored in the db, or
json, or xml, etc.

On Jan 30, 4:59 pm, cedec <cdecroz...@free.fr> wrote:
> Hi,
>
> I've put a State/Country dropdown AJAX updated select box using CakePHP
> example on my blog.
> Here is the link :
>
> http://www.croyantdebridiers.com/?p=52
>
> I hope that helps.
>
> butangphp wrote:
>
> > Hey, I was wondering if there Cake has a way to automatically generate
> > a list of states/countries in the form of a dropdown menu.  Maybe
> > using the form helper or html helper ?   Any help would be greatly
> > appreciated.  Thanks!
>
> --
> View this message in context:http://www.nabble.com/html-select-State-Country-dropdown-in-CakePHP--...
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

How to disable datetime field?

Hi,
I need to disable a datetime field and enable it when user clicked on
a radiobuutton, there is no problem in enabling because every single
field has an id but I don't know how can I disable datetime fields?!!
this is how I tried to do it:

$form->dateTime('Customer.switch','MY','NONE',time(),array('minYear'
=> date('Y'),'disabled'=>'disabled'),false);

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

Re: __mergeHasMany causing EXTREMELY slow data retrieval

Hi Dan,

this isn't a major flaw in CakePHP, it's the price you pay for the
ease of development. Fortunately Cake allows you very easy access to
SQL itself if you need it - although you may end up having to do some
more "old school" management of your result set rather than having
cake turn everything into handy arrays for you.

It's also possible that you'll be able to get the data you want by
turning your find() call around. I think you might look at this as a
call on your OrderLineItem model rather than Order, so inside the
OrderLineItems Controller you could do this:

$this->OrderLineItem->recursive = -1;
$orderlineitems = $this->OrderLineItem->find('all',array
('contain'=>array('Order')));
$this->set( compact('orderlineitems') );

(or inside the model by skipping the "->OrderLineItem" bit)

That will be fast, and I think won't need any "merging".


You said you had simplifed your example so it might not work in which
case you really will have to do something like:

$this->Order->execute(' some kind of SQL in here ')

and manually manage the result set.

Hope that helps

Pete


On Jan 30, 4:47 pm, Dan <grip...@gmail.com> wrote:
> No one has feedback on this? It seems like a MAJOR issue if you can't
> load more than a few thousand rows from "has many" relationship tables.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Security-Component-form-checks?

When I use the form-Helper and the security-component, do I have to
check if the user changes the value of hidden fields (like id, and
foreign keys like author_id) or do the security-component auto-check
that through the data[_Token][key]?

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

Debugging Auth component

Hi guys, I'm getting quite crazy with the auth component.
Some days ago I followed the 'Simple Acl controlled Application'
tutoriale and everything worked fine. After that I start adding stuff
to my user model and user controller and now Auth doesn't work
anymore. I can login correctly but every action not declared as
allowed is not accessible even from the User who belongs to the
administrators group.
I don't know where to start to debug Auth calls and to see where it
get stuck. Any suggestion?
Thanks.

Andrea

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

Friday, January 30, 2009

sorting/ordering with foreign key

Hey Guys,
Consider the following example
I have 2 tables....

table1: invnos
fields: id,invno

table2: invoices
fields: id,invno_id

now i wish to write a query that will order my find in the invoices
table according to the invno in the invnos table

can someone help me out with it...the best i could write is...

$this->Invoice->find('all',array(),array(),'order' => 'invno_id DESC')

but it seems to be ordering by the invno_id that i stored in the
invoices table

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

Re: Data container classes and pagination?

Thanks for such a great response! I think I'm struggling because I
used to do lots of WebObjects work and unlearning some of those design
patterns is tough.


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

Re: html select State/Country dropdown in CakePHP ?

Hi,

I've put a State/Country dropdown AJAX updated select box using CakePHP
example on my blog.
Here is the link :

http://www.croyantdebridiers.com/?p=52

I hope that helps.


butangphp wrote:
>
>
> Hey, I was wondering if there Cake has a way to automatically generate
> a list of states/countries in the form of a dropdown menu. Maybe
> using the form helper or html helper ? Any help would be greatly
> appreciated. Thanks!
> >
>
>

--
View this message in context: http://www.nabble.com/html-select-State-Country-dropdown-in-CakePHP---tp17909838p21758544.html
Sent from the CakePHP mailing list archive at Nabble.com.


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

$scripts_for_layout breaks in seperated header

hi-
in my app, i have sperated the header and footer as new elements
(header.ctp/footer.ctp). The default.ctp uses $this->element('header')
for example, to retrieve the header. I am doing this becuase i have
to change headers/footers from layout to layout (sometimes). Anyway,
by seperating the header $scripts_for_layout suddenly becomes broken:
Notice (8): Undefined variable: scripts_for_layout, leavine me with
the only option of inline css/js. Ugh.

is there a way to work around this? In the views i would like to call
specific javascripts or css, as some js/css is not pertinant to other
pages. Thanks

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

Re: Wordpress and cakephp

So for a client I am starting to play around with a datasource kind of
idea to be able to do large page editing in wordpress (client has an
existing blog and is used to the wordpress 'way') for relating body
content for other models. and to keep some content in sync

On Fri, Jan 30, 2009 at 12:42 PM, Ross.Haggart@googlemail.com
<Ross.Haggart@googlemail.com> wrote:
>
> Thanks everyone, great response. Just taking a look at wildflower
> now, really interesting.
>
> R
>
> On Jan 25, 8:22 pm, Sam Sherlock <sam.sherl...@gmail.com> wrote:
>> +1 for wf.
>>
>> The plugin version is available on githubhttp://github.com/klevo/wildflower/tree/master
>>
>> Merging two different systems can end up like Frankensteins monster - and
>> may be more complex than a complete cake version
>>
>> There are some other cake CMS's on github two - not sure how complete these
>> are
>>
>> 2009/1/25 jason m <ippatsu.ya...@gmail.com>
>>
>>
>>
>> > +1 for wildflower. I'm not sure if it's done yet but I think the
>> > wildflower developer wanted to make it into a plugin so you could just
>> > pop it into your plugin folder and use it right away, while the rest
>> > of your app is separate.
>>
>> > On Jan 24, 6:15 pm, "ache...@gmail.com" <ache...@gmail.com> wrote:
>> > > You might look into using something like wildflower (http://
>> > > code.google.com/p/wildflower/) to handle this. It has a blog and basic
>> > > CMS as well as some other really nice features. Just an idea though.
>> > > That way no one is reinventing the wheel.
>>
>> > > On Jan 23, 6:21 am, "Ross.Hagg...@googlemail.com"
>>
>> > > <Ross.Hagg...@googlemail.com> wrote:
>> > > > Hi
>>
>> > > > I'm looking to use wordpress and cakephp to develop a site. I would
>> > > > like to use wordpress for basic cms functionality i.e. administration,
>> > > > news & events, uploading publications etc. with cakephp being used for
>> > > > functionality on the site, registration, members area etc. I could
>> > > > attempt all in cakephp, but wordpress would cut down a lot of work.
>> > > > Can anyone give me advice on this, experience, am i going down the
>> > > > wrong path?
>>
>> > > > Many thanks
>>
>> > > > Ross
> >
>

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

Re: Wordpress and cakephp

Thanks everyone, great response. Just taking a look at wildflower
now, really interesting.

R

On Jan 25, 8:22 pm, Sam Sherlock <sam.sherl...@gmail.com> wrote:
> +1 for wf.
>
> The plugin version is available on githubhttp://github.com/klevo/wildflower/tree/master
>
> Merging two different systems can end up like Frankensteins monster - and
> may be more complex than a complete cake version
>
> There are some other cake CMS's on github two - not sure how complete these
> are
>
> 2009/1/25 jason m <ippatsu.ya...@gmail.com>
>
>
>
> > +1 for wildflower. I'm not sure if it's done yet but I think the
> > wildflower developer wanted to make it into a plugin so you could just
> > pop it into your plugin folder and use it right away, while the rest
> > of your app is separate.
>
> > On Jan 24, 6:15 pm, "ache...@gmail.com" <ache...@gmail.com> wrote:
> > > You might look into using something like wildflower (http://
> > > code.google.com/p/wildflower/) to handle this. It has a blog and basic
> > > CMS as well as some other really nice features. Just an idea though.
> > > That way no one is reinventing the wheel.
>
> > > On Jan 23, 6:21 am, "Ross.Hagg...@googlemail.com"
>
> > > <Ross.Hagg...@googlemail.com> wrote:
> > > > Hi
>
> > > > I'm looking to use wordpress and cakephp to develop a site.  I would
> > > > like to use wordpress for basic cms functionality i.e. administration,
> > > > news & events, uploading publications etc. with cakephp being used for
> > > > functionality on the site, registration, members area etc.  I could
> > > > attempt all in cakephp, but wordpress would cut down a lot of work.
> > > > Can anyone give me advice on this, experience, am i going down the
> > > > wrong path?
>
> > > > Many thanks
>
> > > > Ross
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

[Newbie] Data container classes and pagination?

I think I'm missing something.....

When I fetch with the pagination function, it returns an array of
associative arrays rather than an array of objects based on my
model.

Questions...

1) Is the model class supposed to be used as a data container where
you can extend it with custom accessor methods etc. Or is it more of
for abstraction of database operations?

2) Is there an elegant mechanism in Cake (or PHP for that matter) that
will take the result set (array) and convert it into an object (either
based on it's model class or an entirely separate data container
class)?

3) Let's take an overly simplified example. I want a derived value
that multiple controllers/views will need to use. I don't want to
repeat the business logic in each controller and I'd preferably like
it in 1 place. Where does one do it? Here's a straw man that I hope
someone can use to help me understand this better.....

Option 1. Custom accessor method in the model or some other data
container....
ex. $fullname = $person->fullName();
This is ideal because it's a built into a data object. But cake
doesn't return objects.

Option 2. Static method in the model.
ex. $fullname = person::fullName($row);
I can live with this and my guess is that the model is more of a
toolbelt than a container

Option 3. Shared function (where should I put things like these?)
ex. $fullname = fullNameFromPersonRow($row);

Thanks.

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

Re: svn or git?

I use the Textmate Bundle SVNMate (http://ciaranwal.sh/2007/11/29/
svnmate-update
) its really wonderfull working with. And on office
where we use svn+ssh protocol it even supports that to.

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

Re: New api template =(

Thank you ever so much!
So much easier.

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

Re: newb question: autoRendering a view, even if I specify autoRender=false!

Dr. Loboto,
Thanks; makes sense about autoRender=false. I removed it.

here's what the message displays when debug is on:
___
"Missing View
Error: The view for ReviewsController::deleteSection() was not found.

Error: Confirm you have created the file: /Library/WebServer/Documents/
spr4/app/views/elements/reviews/create/40.ctp

Notice: If you want to customize this error message, create app/views/
errors/missing_view.ctp"
-----
what I am doing is displaying a view (spr4/app/views/elements/reviews/
create/) on a specific record id (40)
I'm then clicking on a link to delete a line item from that view,
which fires the ajax script, and then the action called deleteSection.
I pass in the section ID to be deleted (187 in this case), and the
delete is completed successfully.
I then want to refresh the original view, without showing the item
that was just deleted. That is the point at which I receive this
message.

Thanks for any help!


On Jan 30, 3:49 am, "Dr. Loboto" <drLob...@gmail.com> wrote:
> 1. Turn debug ON and read complete error messages.
> 2. autoRender needs to be false ONLY if you do not render anything at
> this action. As you call $this->render() explicitly, you should not
> touch $this->autoRender.
> 3. It is unclear what do you want to achieve. In normal flow render
> occurs just after action. In your case too.
>
> On Jan 30, 5:44 am, mark <markman...@gmail.com> wrote:
>
> > Basic question, hopefully with a simple answer. I've got a view that I
> > *do* want to re-render after an ajax delete. The delete works properly
> > and the view attempts to re-render, but instead displays the dreaded
> > "requested address was not found" message (basically acting as if it's
> > trying to render a page automatically). This is odd because I specify
> > autoRender=false. It seems like that is not working properly
> > Here's the controller:
> > I'm passing values to the controller appropriately(confirmed
> > already): /reviews/deleteSection/40/187
>
> >         function deleteSection($id = null, $sectionID = null)
> >         {
> >                 $this->Section->del($sectionID);
> >                 $this->autoRender=false;
> >                 $this->layout = 'ajax';
> >                 $this->render("../elements/reviews/create/".$id);
> >         }
> > The create/40 view attempts to reload, but then I get the message:
> >  "Not Found
> >   Error: The requested address '/reviews/deleteSection/40/187' was not
> > found on this server."
>
> > I thought I understood about rendering, but maybe I'm missing
> > something. Can anyone help? Thanks in advance! I'm still learning!

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

Re: Model::saveAll() fails with validate = first and belongsTo associations

This has been fixed in the svn head. :)

-Mark

On Jan 30, 7:11 am, Papagurana <maas.tors...@googlemail.com> wrote:
> Hello,
>
> I recently updated from RC2 to 1.2.1.8004 and I've got problems when
> doing a saveAll with two new datasets.
>
> Example:
> 1. Model Profile belongsTo User
> 2. ProfileController::add() => $this->Profile->saveAll($this->data,
> array('validate' => 'first'))
>
> The Controller::data is something like:
> array(
>     'Profile' => array(
>         'salutation_id' => 'xx'
>     ),
>     'User' => array(
>         'username' => 'papagurana',
>         'password' => 'xxxxx'
>     )
> );
>
> In the Model::saveAll method in line 1516 the belongsTo association
> will be removed after the first loop iteration. That could not be
> correct, because line 1514 ($this->__save(...)) will not save the
> belongsTo association but only validates the belongsTo model (The user
> model in this case).
>
> This problem can be easily fixed with:
> if($options['validate'] != 'first') {
>     unset($data[$association]);
>
> }
>
> This problem only occurs if both datasets are new and must be inserted
> in the database and the foreign key is not already set.
>
> Greetings and sorry for my english
>
> papagurana
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: __mergeHasMany causing EXTREMELY slow data retrieval

On Jan 30, 5:47 pm, Dan <grip...@gmail.com> wrote:
> No one has feedback on this? It seems like a MAJOR issue if you can't
> load more than a few thousand rows from "has many" relationship tables.

IMO, quite simply you're using the wrong approach. check the group for
csv dumps and the likes.

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

Re: Problem with App::import with classes containing a dot.

Any idea ?

App::import('Vendor',null, true, array('wshelper'),
'IPReflectionClass.class.php');

Returns True ; but then

$refl = new IPReflectionClass('test'); cause an error :

Fatal error: Class 'IPReflectionClass' not found in /Applications/
xampp/xamppfiles/htdocs/cakebase/app/controllers/
service_controller.php on line 18

If anyone have an idea ...

Thanks !
Xav

On 29 jan, 15:25, Xav <xstde...@gmail.com> wrote:
> Hi,
> The following code returns FALSE and don't load the Class :
>
> App::import('Vendor', 'IPReflectionClass', array('file' =>
> 'wshelper'.DS.'lib'.DS.'soap'.DS.'IPReflectionClass.class.php'));
>
> when I want to load the class in the following directory :
> .../vendors/wshelper/lib/soap/IPReflectionClass.class.php
>
> So, what's wrong ?
>
> Thx,
> Xav
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Re: __mergeHasMany causing EXTREMELY slow data retrieval

No one has feedback on this? It seems like a MAJOR issue if you can't
load more than a few thousand rows from "has many" relationship tables.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

$scaffold and bake don't match up

I am new to cakephp and I used the scaffolding and then decided to
bake my views and controllers. I have some Associations setup that
showed up in the views when using scaffolding but don't show up after
baking the views. Did I do something wrong or is there not a way to
generate the scaffolding as it appears? Thanks any help would be
appreciated. Thanks.

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

Re: for create home.ctp page

Read the cookbook, and then run 'cake bake' to build your skeleton
views is the easiest thing: http://book.cakephp.org/view/108/The-CakePHP-Console


On Jan 29, 11:18 pm, sagu <sarvaiya.sag...@gmail.com> wrote:
> Hey group  I am just beginner with cake php framework..
> So how to create .ctp  file
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---