Fatal error for Feed_Parser_Model.

2006-10-31 Thread Eric

Hi everyone,
I am try to set a RSS parser for my project. And I follow the steps as
follow.
http://www.thinkingphp.org/2006/06/14/cakephp-rss-20-feed-parser-model/


BUT I got an fatal error like this "Fatal error: Call to undefined
function curl_init() in D:\Program
Files\xampp\htdocs\cake\app\web_model.php on line 91"

Can anyone help me to figure it out?

And Also I try the SimplePie for CakePHP, ALSO, got error message like
can't use SIMPLE_ITEMS.

Is there any tutorial or sample for rookie like me to show how to do it
? 

Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: problem with adding and editing in blog tutorial

2006-10-31 Thread clam

I had actually deleted the entire app/views/posts directory.

I tried adding $name='Posts' in PostsController, and the problem
remained :(

I had also figured out earlier (before trimming all the code down to
just the scaffold) that $this->Post->save($this->data) in the add()
function in PostsController was returning false.  Is there any way to
get more detailed info on why save() wasn't working?

On Oct 31, 7:17 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Do you still have add.thtml or edit.thtml files in app/views/posts
> directory?  If so, make sure you delete them.  Maybe also try var $name
> = 'Posts'; in your PostsController.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Nested categories controller and routing

2006-10-31 Thread gremlin

I have thought of all of this before and none of these solutions quite
seems to solve my problem.

I need to be able to recover the id for the category entry in order to
reference various related models to generate the content.

The number of parameters in the url needs to be dynamic and must
control a mysql self join. The results of this self join need to
populate the category model.

I can not pass the id into the controller in this case. I also can't
use a findall or findallbyname since the names of a category might not
be unique. I need to be able to handle an url like the following
examples. All of them.

domain.ext/categories/books/
domain.ext/categories/books/programming
domain.ext/categories/programming/
domain.ext/categories/software/
domain.ext/categories/software/product/
domain.ext/categories/software/product/downloads
domain.ext/categories/software/product/reviews

where the parameters passed to the categories controller will determine
what else happens. I can control the rest but I can't seem to get
around populating the category model with the information it needs. I
can get the param count and construct the query manually - is there a
trick to approaching this problem from such an angle? Am I missing
something entirely.

I cant split the controllers up. I need this to work from a single
categories_controller and I need to get the id of the category from the
nested url in a single query if at all possible. A self join will do
this. I can manage the sql generation easily enough.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Component problem.

2006-10-31 Thread [EMAIL PROTECTED]

Maybe startup is not the best method to set a controller variable in.
Are you sure startup is even being called?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: problem with adding and editing in blog tutorial

2006-10-31 Thread [EMAIL PROTECTED]

Do you still have add.thtml or edit.thtml files in app/views/posts
directory?  If so, make sure you delete them.  Maybe also try var $name
= 'Posts'; in your PostsController.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: How To Load Divs Asynchronous For Index.php?

2006-10-31 Thread Eric

I put the code below between head. It works!
For the function doAjaxCall( ), I really don't know where should I put.
So, I just combine the two parts together. Now, I know the logic to do
it.

Thanks.Tim
Have a good Day!!



event('window','load',$ajax->remoteFunction(array("url"=>"/posts/index/","update"=>"posts_view","type"=>"asynchronous")),false)?>



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



problem with adding and editing in blog tutorial

2006-10-31 Thread clam

I'm new to Cake and I've been following the blog tutorial.  Everything
seems to work fine as I've been able to view and delete posts.
However, nothing happens when I click 'Save' on the form page for edit
or add post.  (I just get the form back.)

I couldn't find any error in my code, so I trimmed everything down to
just the scaffold, but adding and editing still didn't work!  I set the
DEBUG level to 3, and this is the SQL query when I click 'Save' on the
Edit form page:

SELECT COUNT(*) AS count FROM `posts` WHERE (`id` = 2)

And there's no SQL query shown when I click 'Save' on the Add post form
page.

Any suggestion on what's going on?

For completeness, I'm using PHP5 with Apache on Windows XP.  Now my
posts_controller.php file just uses the scaffold:



And my post.php is




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Dynamic Scaffolding

2006-10-31 Thread gwoo

Not all databases support enum, so it is not included in anything  
other than basic scaffolding for mysql.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: gaining access to Sessions

2006-10-31 Thread Grant Cox

This looks fine to me.  You can use $this->data instead of
$this->params['data'] if you like, too.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Nested categories controller and routing

2006-10-31 Thread Olivier Percebois-Garve

hi

-routes are like Controller/Action/Param/Param
-the 'index' is the default action

Take your 'Categories' structure and name it articles, so that the route 
will be domain.ext/
then use the index() method. feed it with you article name's and convert 
them to id to do your article management.
Something like that:

class ArticlesController extends AppController{

function index($name=null){
$row = $this->findAllByName($name);
  $id = $row['id'];
  //then get your article content
}

}

you'll need to convert your id to names for your links by using 
findAllById($id). You need also to make sure that your article names are 
uniques
and that your are using an appropriate way to pass special characters in 
the url.

HTH

olivvv



gremlin wrote:
> If I create a model with a relationship to itself ie a nested
> categories model with a belongs to and has many relationship I can
> easily enough get a set of nested categories data.
>
> The problem for me is that if I wish to reference the content related
> to that category I must either reference it directly or set a nesting
> depth limit on the parameters I pass via the url. More clearly I can't
> figure out how I could set a controller to read category information
> from an url that might have no parameters or 5 or 13 or any other
> number.
>
> Is there a way to take a structure like so :
> Categories
> __
> id   -   parent_id   -   value
> __
> 0   -   null-   null
> 1   -  0-   articles
> 2   -  0-   files
> 3   -  1-   programming
> 4   -  3-   php
>
> etc..
>
> and represent the actual hierarchy in the url as parameters?
> domain.ext/
> domain.ext/articles
> domain.ext/articles/php
>
> particulary in the case where in the future I might want to add a
> sub-category to "php" thus making the url into
> domain.ext/articles/php/cake or similiar?
>
>
> >
>
>   


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: correct urls

2006-10-31 Thread Grant Cox

Either use cake urls, or absolute urls.

$html->url( "/users/login" );
$html->url( "/img/somepicture.jpg" );
$html->url( "http://www.google.com"; );
$html->url( "#anchor" );
$html->url( "mailto:[EMAIL PROTECTED]" );

etc.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Dynamic Scaffolding

2006-10-31 Thread [EMAIL PROTECTED]

I recently started working with cakephp. I liked the scaffolding, and
the bake.php script. However, one obvious short coming to the bake.php
script is it's failure to handle enum fields in the controller.

What is so strange is that the scaffold script handles enum fields, and
the view protion of Bake expects enum values, but Bake doesn't include
them in the controller.

If you use enum fields in your database, you might want to check out
this script to "fix" bake.php
http://cakeforge.org/snippet/detail.php?type=snippet&id=143

On Oct 31, 3:16 pm, "AC" <[EMAIL PROTECTED]> wrote:
> I was wondering if Cake has the ability to generate the model, the
> controller, and all of the views for you when it comes to CRUD.  Much
> like Ruby on Rails.  I know that Cake has the "scaffold" option, but
> what I want is base level code generation for creating production CRUD.
>  Much like $ ruby script/generate scaffold .  Can bake scripts do
> this for me?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: THTML files not working

2006-10-31 Thread barry_normal

Hey guys.

Thanks all for the help. I think I need to follow grant's advice. At
least I appreciate the general area from which my problems are issuing!

All the best
BN


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Redirect - redirects to blank page

2006-10-31 Thread Syl

Hey Time - Thanks for your reply :-).  Clutching at straws is better
than clutching at air  :p

HmmmI haven't messed around with routes.php, I don't quite get it
yet.  But, I am hoping that because all my other redirects are
workingthis one should too ?

Yep, I'm declaring the models at the top of the controller.

Nothing weird with the validation.  I just copied and renamed my code
from one of the views.

S


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Redirect - redirects to blank page

2006-10-31 Thread Tim

Code looks alright to my (very) untrained eye.  Clutching at straws
here...

What does your routes.php look like...  I expect you've checked that
though.
Are you declaring the models in your uses var at the top of the
controller?
Also have you got anything weird going on with the validation in your
models?

sorry couldn't help much more.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: How To Load Divs Asynchronous For Index.php?

2006-10-31 Thread Tim

Hi Zou,

>  Is the Right code for body Tag ?

No, I don't think this will work as it stands.

>  But I am not clear about what is the 'window' and 'load'.

The Window object is the highest level js object which corresponds
to the web browser window.  The 'load' is the argument that you are
passing into
the 'event' function,  corresponding to the type of event you are
attaching to.  If you want an
onclick event, you pass in 'click', for onblur->'blur' etc.  The
function
prepends it with 'on' depending on the type of browser that you have.

>  Is the part of onload event or what ? I can't find any refrence.

Hmm.  If you want to do it this way (there are a few ways to do this)
then the
body tag could just stay like this:



In your  (maybe) you should have a script tag or a call to a .js
with the following:




// attach the event to the body tag and attach the doAjaxCall() to the
event
$javascript->event('window','load', 'doAjaxCall()', false);

function doAjaxCall () {

$ajax->remoteFunction(array("url"=>"/posts/load/","update"=>"posts_view","type"=>"asynchronous"));
}



I haven't tested this, so you'll probably need to play with it to get
it to work.
Hope this helps...

Cheers


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



SmartyView+SmartyHelpers

2006-10-31 Thread [EMAIL PROTECTED]

There are several messages floating around without great answers about
Smarty integration and I wanted to let other know about some
developments.

A few days back I broke away from development on a homegrown mvc
framework and shifted to cake (decision was hard but the transition has
been smooth).

I know all the arguments against using Smarty, no need to reiterate.  I
think it is arguable that with a properly configured Smarty setup (with
caching) you can rival/beat straight thtml calls.
But regardless, there are people that will sacrifice a bit of
performance to be able to use Smarty.

I've updated phpnut's SmartyView example to include:
  - thtml fallback for views (increases the filesize as it overrides
_getViewFileName -- adding 4 lines) -- I talked to phpnut about
allowing app/views thtml fallback in core (already does for libs/views)
but he refused (somewhat understandably, though I think it can be
accomplished cleanly).
- I also added the ability to place smarty plugins in
views/smarty_plugins instead of w/smarty in /vendor.
- Additionally I coded brief examples of providing smarty function
wrapping of helper class methods to allow 'native' smarty calls.

This gets around the 'array(' issue in smarty templates, allowing you
to do something like this:
{html_input fieldName=User/username class="test" size=30}
(vs)
input('User/username',
array('class'=>'test','size'=30); ?>
(or even uglier previous smarty method)

Other than expanding the wrappers I have a short todo that will
increase functionality/usability but I think it's at an acceptable
state now.

No need for the 'but it's another layer!!!111' comments, we've been
through them already =)

I personally don't mind much how the vanilla template styles look in
most cases but this helped soften the fall from moving away from my
prior work.

See:
http://cakeforge.org/snippet/detail.php?type=package&id=30  (SmartyView
+ SmartyHelpers)
http://cakeforge.org/snippet/detail.php?type=snippet&id=6 (Straight
SmartyView)
Also, placed a bit of doc here:
http://bakery.cakephp.org/articles/view/124  (made a small edit, went
back to moderation).

Travis


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Dynamic Scaffolding

2006-10-31 Thread AC

Thanks John.

On Oct 31, 12:20 pm, "John David Anderson (_psychic_)"
<[EMAIL PROTECTED]> wrote:
> On Oct 31, 2006, at 1:16 PM, AC wrote:
>
>
>
> > I was wondering if Cake has the ability to generate the model, the
> > controller, and all of the views for you when it comes to CRUD.  Much
> > like Ruby on Rails.  I know that Cake has the "scaffold" option, but
> > what I want is base level code generation for creating production
> > CRUD.
> >  Much like $ ruby script/generate scaffold .  Can bake
> > scripts do
> > this for me?Yes.
> 
> $php cake/scripts/bake.php
> 
> -- John


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Redirect - redirects to blank page

2006-10-31 Thread Syl

Hey all !!

So, I've hit my head against a wall for the last several hours, and
done all the searches I can think of.and, I just cannot think of
any other way of tackling this problem.

I've created a view/controller that do not have a model.  Based on a a
choice the user makes, the controller saves to one of  three other
models.

Here is my controller code :
=
function newkeyword() {
if (empty ($this->data)) {
$this->render();
} else {
$this->cleanUpFields();
$type = $this->data['Keyword']['Type'];
$mdlName = null;
switch ($type) {
case "help" :
$mdlName = 'HelpCategory';
break;
case "cat" :
$mdlName = 'Category';
break;
case "sub" :
$mdlName = 'SubCategory';
break;

}

$saveData[$mdlName]['frText'] =  
$this->data['Keyword']['frText'];
$saveData[$mdlName]['engText'] =  
$this->data['Keyword']['engText'];

if ($this->$mdlName->save($saveData)) {
debug('SAVED');
$this->redirect('/keywords/keywordlist');
debug('AFTER Redirect');
} else {
debug('ERROR');
$this->Session->setFlash('Please correct errors 
below.');
}
}
}
=
The debug statements and looking at the DB shows that the save has
occurred successfully.  But, rather than re-direct-ing to the
keywordslist page, the same page is reloaded (namely,
keywords/newkeyword).

What am I missing ?  It seems to make perfect sense to me that this
should work.

Thanks all !

Syl


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Dynamic Scaffolding

2006-10-31 Thread John David Anderson (_psychic_)


On Oct 31, 2006, at 1:16 PM, AC wrote:

>
> I was wondering if Cake has the ability to generate the model, the
> controller, and all of the views for you when it comes to CRUD.  Much
> like Ruby on Rails.  I know that Cake has the "scaffold" option, but
> what I want is base level code generation for creating production  
> CRUD.
>  Much like $ ruby script/generate scaffold .  Can bake  
> scripts do
> this for me?

Yes.

$php cake/scripts/bake.php

-- John

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Dynamic Scaffolding

2006-10-31 Thread AC

I was wondering if Cake has the ability to generate the model, the
controller, and all of the views for you when it comes to CRUD.  Much
like Ruby on Rails.  I know that Cake has the "scaffold" option, but
what I want is base level code generation for creating production CRUD.
 Much like $ ruby script/generate scaffold .  Can bake scripts do
this for me?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



gaining access to Sessions

2006-10-31 Thread mike091

Hi, I just have a quick question regarding the best way of doing
smething. I want the username from the Session to be inserted into the
comments table when a user adds a comment. very simple. I can think of
various ways of doing it but not sure what's best. One way I thought of
was to put ..

$this->params['data']['Comment']['user'] =
$this->Session->read('User.username');

..in the Comments controller. However i'm not sure if this will work or
is the best way.

Any thoughts very welcome.
Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Component problem.

2006-10-31 Thread Bernard Grosperrin

Ok, I have made couple of components working well, but this one give me 
a error all the time, and I am unable to see what's wrong:


class StockRequestComponent extends Object
{
   var $controller = true;
   // I have to find a way to have a function here which can receive 
parameters(or not)
   // and would find only the locations for the current user
 
  function startup (&$controller)
   {
   $this->controller = &$controller;
   $Product = new Product;
   $data = $Product->findAll();
   
$this->controller->set('StockRequest',$data); 

   }  
}

The view is:




controller->name == 'Stocks')
{
echo '';
echo '';
echo 'http://cake.bgsoftfactory.com/stocks/index/1/0";>-- 
Select a Section --';
foreach ($StockRequest as $output):
echo 'http://cake.bgsoftfactory.com/stocks/index/1/' . 
$output['Product']['description'] . '">' . 
$output['Product']['description'];
endforeach;
echo '';
echo '';
} 
  ?>


the error is: " Undefined variable: StockRequest in.."etc

A very similar component, on a different table, works just fine. Thanks 
for your help,

Bernard


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



composite query

2006-10-31 Thread Bernard Grosperrin

I have 2 problems I need help with, but I will post 2 messages.

first: What would be the best way to have an interactive query?

I need to have users able to make a selection in 6 different columns, to 
build a query with WHERE this and that (6 this and that..), knowing they 
may select 1, or 2, or 3 or 4 or 5 or 6 values.

I would like to avoid making 36 ( 6* 6) elseif 

Also, visually, I would like to have  this on he same page displaying 
the data. Should it be a component, or can I have a form AND a view 
simultaneously?

I am not working often enough with Cake to be fully fluent, so any help 
will be greatly appreciated.

Bernard



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Fetching data with join over 3 tables

2006-10-31 Thread lloydhome

I have used CakePHP for several months and answered a few posts without
needing to post and I probably don't need to now but I cannot find the
answer.

I have tried setting the recursive var to 2, 3, 4, 5 and no help to my
problem.  I have a User model that has a belongsTo a Subarea that
belongsTo an Area that belongsTo a Region.  The associations are corret
(I think) because the recursion works in the case described above.  My
problem is when a field is in a condition that is not 'close' to the
first model.

regions
--
region_id int primary key,
region_name varchar(50) not null unique key
...snip...

areas
--
area_id int primary key,
area_regionid int references regions(region_id),
area_name varchar ...
...snip...

subareas
--
subarea_id int primary key,
subarea_areaid int references areas(area_id),
subarea_name varchar ...
...snip...

users
--
u_id int primary key,
u_subareaid int references subareas(subarea_id),
login_name varchar(50) not null unique key,
...snip...

class Region extends AppModel {
  var $name = 'Region';
  var $primaryKey = 'region_id';
  var $hasMany = array(
'Area'=>array('className'=>'Area','association'=>'Area','foreignKey'=>'area_regionid')
);
}
class Area extends AppModel {
  var $name = 'Area';
  var $primaryKey = 'area_id';
  var $belongsTo = array('Region'=>
array('className'=>'Region','association'=>'Region',
'foreignKey'=>'area_regionid') );
  var $hasMany = array(
'Subarea'=>array('className'=>'Subarea','association'=>'Subarea','foreignKey'=>'subarea_areaid')
);
}
class Subarea extends AppModel {
  var $name = 'Subarea';
  var $primaryKey = 'subarea_id';
  var $recursive = 2;
  var $belongsTo = array('Area'=>
array('className'=>'Area','association'=>'Area',
'foreignKey'=>'subarea_areaid') );
// ...snip business logic...
}
class User extends AppModel {
  var $name = 'User';
  var $belongsTo = array('Subarea'=>
array('className'=>'Subarea','association'=>'Subarea',
'foreignKey'=>'u_subareaid') );
  var $primaryKey = 'u_id';
// ...snip business logic...
}

if I query from my controller ...
  $result_count =
$this->User->findCount(array('Region.region_name'=>'Canada'), 4);

I get an error in this generated query:
SELECT COUNT(*) AS count FROM `users` AS `User` LEFT JOIN `subareas` AS
`Subarea` ON `User`.`u_subareaid` = `Subarea`.`subarea_id` WHERE
(`Region`.`region_name` = 'Canada')
  1109: Unknown table 'Region' in where clause

If I commit a cardinal sin and modify dbo_source.php and insert the
following 10 lines into the read method before the comment here:
//DAL: HACK in recursive query joins!
if ($model->recursive > 1) {
foreach($model->__associations as $type) {
foreach($model->{$type} as $assoc => 
$assocData) {
$linkModel =& 
$model->{$assocData['className']};


$this->__dal__generateRecursiveQuery($model, $linkModel,
$queryData, $model->recursive);
}
}
}

---> before
// Build final query SQL

and add the methed mentioned:
  function __dal__generateRecursiveQuery(&$model, &$linkModel,
&$queryData, $recursive) {
if ($recursive>0) {
foreach($linkModel->__associations as $type) {
foreach($linkModel->{$type} as $assoc => $assocData) {
$newLinkModel =& 
$linkModel->{$assocData['className']};
$external = isset($assocData['external']);
$null=null;
if ($newLinkModel && $model->useDbConfig ==
$newLinkModel->useDbConfig) {

$this->generateAssociationQuery($linkModel, $newLinkModel, $type,
$assoc, $assocData, $queryData, $external, $null);

$this->__dal__generateRecursiveQuery($model,$newLinkModel,$queryData,$recursive-1);
}
}
}
}
  }

It gets better.  Now modify the REALLY weird code in the
__filterResults method
if (isset($model->{$className}) 
&&
is_object($model->{$className})) {
$data = 
$model->{$className}->afterFind(array(array($key =>
$results[$i][$key])));
} else {
   //DAL: this
makes no sense.  The 'if' above proves it is not an object to call ...
   //DAL:
$data = $model->{$className}->afterFind(array(array($key =>
$results[$i][$key])));


$data[0][$key]=& $results[$i][$key];
}

AND IT WORKS!  But I get suspicious when I go modifying the core 
One caveat to my 

correct urls

2006-10-31 Thread [EMAIL PROTECTED]

how i must to use path with/without $html->url() use absolute or
relative paths? I mean urls must work in any kind of installations.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Cake PHP Help

2006-10-31 Thread Gayathiri

Hi!
Thanks for your reply.
I am using Apache webserver.
Need to configure index.php in the app/webroot/ directory?  i.e. to
change

- define ('ROOT', dirname (dirname (dirname (__FILE__;
- define ('APP_DIR', basename (dirname (dirname (__FILE__;
- define ('CAKE_CORE_INCLUDE_PATH', ROOT);

Which file is to be run in the browser to view the output either the
http://localhost/cake/app/webroot  or
http://localhost/cake/app/views/notes/ ?



Eric C Blount wrote:
> Your URL should be http://localhost/cake/notes (I think...without actually
> seeing your setup). What webserver are you using? If it's not Apache, you
> might try http://localhost/cake/index.php/notes (right guys? correct me if
> I'm wrong).
>
> HTH,
> Eric
>
>
> On 10/31/06, Gayathiri Balachandran <[EMAIL PROTECTED]> wrote:
> >
> > Hello!
> >
> > Please help me in finding answer to this.
> >
> > I am new to Cake PHP. I have downloaded the Cake PHP and worked out the
> > example show in the site
> > http://www.sitepoint.com/article/application-development-cakephp. I had
> > done all the coding as per in the example,
> >
> >  -Create a table (notes),
> >
> > -   database.php (app/config),
> >
> > -   note.php (app/models),
> >
> > -   notes_controller.php (app/controllers).
> >
> >
> > Creating *.thtml leads to an error. I just copy the code and save it as
> > index.thtml (app/views/notes) and run in the browser (
> > http://localhost/cake/app/views/notes ), it simply displays the coding.
> >
> >
> >
> > The database is configured correctly. http://localhost/cake/ shows
> >
> > "*Your database configuration file is present. *
> >
> > *Cake is able to connect to the database*."
> >
> >
> > Cake Version: 3632
> >
> > PHP Version: PHP5
> >
> > Database: MySQL
> >
> >
> > Thanks in advance for all your help!!
> >
> > Regards,
> > Gayathiri.
> >
> > >
> >
>
> --=_Part_3921_17049280.1162285848585
> Content-Type: text/html; charset=ISO-8859-1
> X-Google-AttachSize: 4174
>
> Your URL should be  href="http://localhost/cake/notes";>http://localhost/cake/notes (I 
> think...without actually seeing your setup). What webserver are you using? If 
> it's not Apache, you might try  href="http://localhost/cake/index.php/notes";>
> http://localhost/cake/index.php/notes (right guys? correct me if I'm 
> wrong).
>  
> HTH,
> Eric 
> On 10/31/06,  class="gmail_sendername">Gayathiri Balachandran < href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]> wrote:
> 
> Hello! 
> Please help me in finding answer to 
> this.
> I am new to Cake PHP. I have downloaded 
> the Cake PHP and worked out the example show in the site  href="http://www.sitepoint.com/article/application-development-cakephp"; 
> target="_blank">
> http://www.sitepoint.com/article/application-development-cakephp. I had 
> done all the coding as per in the example,
> 
>  -    Create a table (notes), 
>  style="FONT-WEIGHT: normal">-
>    
> database.php 
> (app/config),
>  style="FONT-WEIGHT: normal">-
>    
> note.php 
> (app/models),
> -
>    
> notes_controller.php 
> (app/controllers). 
> Creating *.thtml leads to an error. I 
> just copy the code and save it as index.thtml (app/views/notes) and run in 
> the browser ( href="http://localhost/cake/app/views/notes"; target="_blank">
> http://localhost/cake/app/views/notes ), it simply displays the coding. 
> 
>  
> The database is configured correctly.  onclick="return top.js.OpenExtLink(window,event,this)" 
> href="http://localhost/cake/"; target="_blank">http://localhost/cake/ 
> shows
>
> "Your database configuration file 
> is present. 
> Cake is able to connect to the 
> database."
> 
> Cake Version: 3632
> PHP Version: PHP5
> Database: MySQL
>  Thanks in advance for all your 
> help!!  
>  
> Regards,Gayathiri.
> --=_Part_3921_17049280.1162285848585--


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Mac development (Dreamweaver 8) trying to connect to MS-SQL Server

2006-10-31 Thread TangoSquared

Mixed environment - need mac os x (10.4.8) using dreamweaver to work on
windows development server running cakephp w. microsoft sql server
backend.
Any suggestions?
Thanks,
Thom


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Multi Step Search

2006-10-31 Thread Mikee Freedom

ok, I've thrown something together in the end. don't know if it is the
best method but it works for the time being. maybe someone else might
find it useful, or refine it.

1. search terms entered, search button clicked by user
2. search terms recorded to session
3. "Currently Processing" view output to users screen which includes a
hidden iframe
4. within iframe the processing action is called
5. once this action has completed it's work it outputs a simple
javascript call to reload the top frame
6. top frame outputs the returned search results.

I've also put a refresh on the top frame after a sufficient number of
seconds as a fail safe to the javascript call.

until i spend some quality time with ajax, this is what i'm going to
run with for now.

thanks again for the help fellas, much appreciated :)

cheers,
mikee

On 30/10/06, Mikee Freedom <[EMAIL PROTECTED]> wrote:
> Hey AD7six,
>
> Thanks for your response, I would love to play around with Ajax but
> for the moment I haven't the time to get my head around it. I would
> like it to work in a non-JS environment anyway so am looking to start
> there and I will ajaxify later on.
>
> So, based on your non-JS answer:
>
> > --> If js is disabled, after rendering the results page for the first
> > time, process and cache the results page
> > --> If js is disabled after a sufficient number of seconds redirect to
> > the same url and display the results
>
> The part I'm not quite clear on, is how do I render the results page
> the first time (prior to processing) and then go about processing the
> query and the second phase results page??
>
> I know that might seem like a completely idiotic question but...
>
> At the moment, I store the request in the session, render the action,
> and then carry on with the processing after the render call. My
> question is, will this first results page display on the user's screen
> immediately and then the controller carry on with the processing
> behind the scenes. or will it not appear until the processing is
> complete? using $controller->render() that is.
>
> or am i being daft?
>
> thanks again mate,
> mikee
>
> On 30/10/06, AD7six <[EMAIL PROTECTED]> wrote:
> >
> > Hi Mikee,
> >
> > Here's one approach:
> > User submits form via ajax
> > using Js you display a "processing" message
> > Controller action processes the form and redirects* the user to the url
> >
> > Here's another:
> > User submits the form normally
> > User is redirected to the url for their search results
> > --> If js is disabled, after rendering the results page for the first
> > time, process and cache the results page
> > --> If js is disabled after a sufficient number of seconds redirect to
> > the same url and display the results
> >
> > --> If js is enabled on loading make an ajax request to process and
> > cache the results page - updating the contents of your page.
> >
> > The results in all cases would be pretty similar, for the latter you
> > would need to sniff a little to know if js is enabled (could simply use
> > js to change a value in the submitted form).
> >
> > * To 'redirect' from an ajax call you would use requestAction.
> >
> > HTH,
> >
> > AD7six
> > Please note:
> > The manual/bakery is a good place to start any quest for info.
> > The cake search (at the time of writing) erroneously reports less/no
> > results for the google group.
> > The wiki may contain incorrect info - read at your own risk (it's
> > mainly user submitted) :)
> > You may get your answer quicker by asking on the IRC Channel (you can
> > access it with just a browser here: http://irc.cakephp.org).
> >
> > On Oct 30, 6:18 am, "Mikee Freedom" <[EMAIL PROTECTED]> wrote:
> > > has anyone done anything similar to this in Cake before? or any other
> > > application?
> > >
> > > If the question is seen to be more of a generic one then fair enough.
> > > but if anyone knew of a method within CakePHP to display a processing
> > > screen while PHP performs a function behind the scenes it would be
> > > much appreciated.
> > >
> > > even a nudge in the right direction...
> > >
> > > thanks,
> > > mikee
> > >
> > > On 29/10/06, Mikee Freedom <[EMAIL PROTECTED]> wrote:
> > >
> > > > hey bingo,
> > >
> > > > had a look at it and it was useful in a way. however it seems the
> > > > multi step was more in processing the data rather than any kind of
> > > > display to the user. i've got a handle on how i am searching for the
> > > > data and it is using the very handy findAll method with some creative
> > > > use of bindModel, unbindModel and conditions.
> > >
> > > > however, when my DB grows i think the request to the DB could take
> > > > some time, and then i process the results at the controller /
> > > > component level which will again soak up milliseconds.
> > >
> > > > what i would like is the ability to display an intermediate screen
> > > > while this processing goes on behind the scenes. i didn't really see
> > > > mention of such functionality in that discussion.
>

Re: How To Load Divs Asynchronous For Index.php?

2006-10-31 Thread Eric

Thanks.

I am getting clear about 'S 'and 'A'.

I think I should add a event-onload to the body tag, to do it when the
page is loading and let the divs to load Asynchronous.

I chech the remoteFunction:
Creates JavaScript function for remote AJAX call.

This function creates the javascript needed to make a remote call it is
primarily used as a helper for linkToRemote.

I am not so clear about the defination. For remote AJAX call?
I have an idea just add an onload event using Ajax.Updater in the body
tag. Like u said it converts it to use the Ajax.Updater.

Is it the same function?  Just another name in Cakephp rather than
called Ajax.Updater in prototype? 

Thanks.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Automatic plugin detection

2006-10-31 Thread Christian Winther








Hello bakers 

 

I’ve been thinking about how to cake recognize
my plugins automatic – and adapt my views to the plugins there is active
on the app (Adding menu’s / features )

Does anyone have a good idea on how this
could be done ? 

 

My solution (partly) was something like: 

 

plugins/$name/$name_install.php  
  file
for activating the plugin ( setting up database fields )

plugins/$name/$name_information.php     basic
information about the plugin ( version, description, friendly name )

plugins/$name/$name_uninstall.php    file
for deactivating the plugin ( removing tables )

 

and then somehow the plugin should ‘publish’
itself to cake what menu options it has, and what features it should add where
and how 

 

Have anything like this been made in Cake
before ? Or perhaps some other framework where it would be possible to get ‘inspiration’
?

 

/Jippi




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---






Re: Dynamic Elements

2006-10-31 Thread Tim

You might want to think about 'baking' your element instead, if it
doesn't change too regularly:

http://wiki.cakephp.org/tutorials:dynamic-menu

This ought to take the load off your db server.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



RE: Cake PHP Help

2006-10-31 Thread Adrian Godong








More information about the error?

 



From: cake-php@googlegroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of Gayathiri Balachandran
Sent: 31 Oktober 2006 13:43
To: cake-php@googlegroups.com
Subject: Cake PHP Help



 

Hello!


Please
help me in finding answer to this.

I
am new to Cake PHP. I have downloaded the Cake PHP and worked out the example
show in the site http://www.sitepoint.com/article/application-development-cakephp.
I had done all the coding as per in the example,


-    Create a table (notes), 

-
  database.php
(app/config),

-
  note.php
(app/models),

-
  notes_controller.php
(app/controllers).
 

Creating
*.thtml leads to an error. I just copy the code and save it as index.thtml
(app/views/notes) and run in the browser (http://localhost/cake/app/views/notes
), it simply displays the coding. 

 

The
database is configured correctly. http://localhost/cake/
shows

"Your
database configuration file is present. 

Cake is able
to connect to the database."

 

Cake
Version: 3632

PHP
Version: PHP5

Database:
MySQL

 
Thanks in advance for all your
help!!  


Regards,
Gayathiri.






--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---






Re: How To Load Divs Asynchronous For Index.php?

2006-10-31 Thread Eric

Is the Right code for body Tag ?  But I am not clear about what is the
'window' and 'load' . Is the part of onload event or what ? I can't
find any refrence.

"/posts/load/",
  "update"=>"posts_view",
  "type"=>"asynchronous"
)

  ) ); ">


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Nested categories controller and routing

2006-10-31 Thread Tim

> More clearly I can't
> figure out how I could set a controller to read category information
> from an url that might have no parameters or 5 or 13 or any other
> number.

The pages controller has these two methods in them:

  if (!func_num_args()) {
$this->redirect('/'); }

  $path=func_get_args();

Is that the functionality you were after?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



[OT] Books suggestion on Web Server Management

2006-10-31 Thread Marcelo de Moraes Serpa
Hi folks,It hasn't been much time since I've got my first dedicated server. It's running Fedore Core 5 Linux. So far I'm doing well, but I would like to ask for suggestions on books about linux, web server management, server architecture, web server architecture (DNS, etc), in sum, any good material towards web server in general. What would you suggest? There are so many books out there that I don't know where to start! What I want is to build a solid foundation so I don't feel or get lost on the management of my own server.
And of course, CakePHP is there :)Marcelo.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Scaffold: A few more features

2006-10-31 Thread [EMAIL PROTECTED]

John David Anderson (_psychic_) wrote:

> I think a feature like this would entice new users to use their
> scaffolding more than is needed.
>
> If you'd like to start customizing what is shown, and how things are
> presented, it's time to bake.
>
> -- John

John,

What about extensions to Bake? The current version is wonderful, and I
would love to have some more code generation. Many more templates could
be implemented. I looked at the Bake code and it appeared to me (and I
may be wrong) that it is highly specific to the existing templates and
not easily extensible as currently written.

Should I be waiting for a future Cake release which includes more code
generation, or should I be writing my own?

There are open source code generation tools. For example,

http://freshmeat.net/projects/codeworker/

though I haven't tried to customize any of the generators yet.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Repeating models in a single form: how to validate?

2006-10-31 Thread Grant Cox

In your form, you can have model and field names that don't actually
correspond to your actual model files, or database fields.  So, in your
form you could have:

$html->input("Sender/name")
$html->input("Sender/email")

$html->input("Receiver1/name")
$html->input("Receiver1/email")

...

$html->input("Receiver2/name")
$html->input("Receiver2/email")


then in your controller, loop over the form data (
$this->data['Reciever1'] will be set ), and validate each email address
inside the controller.  Use the same regular expression as the model
validation would :

if ( preg_match(VALID_EMAIL, $this->data['Reciever1']['email']) )

Any fields that fail validation, set a message.  It would be good to
use the Model invalidate() function, but I don't think it work with
these made up model names (Receiver1 etc).  Anyway, if there are no bad
email addresses, then save the sender and receiver objects.  These may
still fail validation and not save, as you may have additional Model
validation.  Saving is really easy, just pass the appropriate part of
the data array

if ( $this->Receiver->save( $this->data['Receiver1'] ) )


Hope that helps.


On Oct 31, 5:51 am, "flemieux" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> maybe this has been answered before, and I couldn't find the answer in
> my extensive search (or I was not looking for the right ting), but I am
> having a hard time figuring out a way to do this in Cake elegantly.
>
> Basically, I have to do a very simple "Send to a friend" form, where a
> sender (name, email) has the ability to send an email to up to "n"
> receivers (name, email). The sender has the ability to "Add" boxes to
> fill in more emails.
>
> I'm trying to do this using existing helpers and model structure (I use
> html helper for form rendering), and I have 2 models (Sender and
> Receiver), but I can't seem to find how I could "validate" the form,
> save everything in the DB, and send the appropriate email given the
> structure of the platform.
>
> Will I have to program the whole thing by workarounds and such, or has
> anyone ever found a clever solution to this common problem?
>
> Enlighten me, tell me I oversaw something :D
> 
> Thanks,
> 
> flemieux--


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Nested categories controller and routing

2006-10-31 Thread Sonic Baker
On 10/31/06, Eric C Blount <[EMAIL PROTECTED]> wrote:
A really quick search of the group for "routing" came up with many examples, but all you need to do is put something like the following in your /app/config/routes.php:$Route->connect('/articles/:param1', array('controller' => 'yourController', 'action' => 'yourAction'));
$Route->connect('/articles/:param1/:param2', array('controller' => 'yourController', 'action' => 'yourAction'));Then you can access the data with $this->params['param1'] and $this->params['param2'].
EricHi guys,Just wondering. Wouldn't using routes mean adding a route for every combination of params you want to use?Have you looked at the 'Nested Set' model in cakeforge?
Sonic

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Deleting and habtm associations

2006-10-31 Thread Gonçalo Marrafa

On Tue, 31 Oct 2006 02:04:12 -0800
"MicroAngelo" <[EMAIL PROTECTED]> wrote:

> 
> Hi Gonçalo,
> 
> Although I assume that your actual models aren't really called "Foo"
> and "Bar" and you're just using the classic metasyntactic variables for
> your example, I did want to point out that the Cake convention for join
> tables is to go alphabetically, and so the join table should be named
> "bar_foo" rather than "foo_bar".

You're right about the names, of course. I didn't know about the
convention though. Thanks.

> As I said, this probably isn't your problem, but I thought I'd chuck it
> in just in case you weren't aware of the convention.
> 

That's not my problem. At least i think it's not because everything else
works fine. 

Thanks.

-- 
Gonçalo Marrafa <[EMAIL PROTECTED]>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: This Mailing List Isn't on Google For No Reason

2006-10-31 Thread Sonic Baker
On 10/29/06, Jon Bennett <[EMAIL PROTECTED]> wrote:
> Having run a mailing list that ran into just such growing pains, I can> suggest splitting up this group into two groups. One group will be for> New Cake Users, aka "newbies," and the other one will be for
> intermediate to advanced users.I think that's a great idea.Sonic 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Deleting and habtm associations

2006-10-31 Thread MicroAngelo

Hi Gonçalo,

Although I assume that your actual models aren't really called "Foo"
and "Bar" and you're just using the classic metasyntactic variables for
your example, I did want to point out that the Cake convention for join
tables is to go alphabetically, and so the join table should be named
"bar_foo" rather than "foo_bar".

As I said, this probably isn't your problem, but I thought I'd chuck it
in just in case you weren't aware of the convention.

Cheers,

Chris


Gonçalo Marrafa wrote:
> Hi bakers.
>
> I'm trying to delete a record from a model Foo that has a habtm association
> with a model Bar, through a foo_bar table. The problem is that when i try
> to delete the Foo record i get a constraint violation error because it is
> still referenced from the record at foo_bar!
>
> Shouldn't Cake delete the records of foo_bar that reference the record of
> Foo i'm deleting? I'm setting delete's cascade parameter to true.
>
> Am i missing something?
>
> Thanks in advance.
> 
> -- 
> Gonçalo Marrafa <[EMAIL PROTECTED]>


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Repeating models in a single form: how to validate?

2006-10-31 Thread Jose da Silva

I think you should exemplify your doubt, i'd like to help you bu i
can't understand your problem.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Need Help On ACL

2006-10-31 Thread AD7six

Hi,

This and the follow up article might help:
www.noswad.me.uk/MiBlog/ACLPart1

There is a plugin that you can download to adminster your acl objects
(there's an online demo to play with also).

HTH,

AD7six
Please note:
The manual/bakery is a good place to start any quest for info.
The cake search (at the time of writing) erroneously reports less/no
results for the google group.
The wiki may contain incorrect info - read at your own risk (it's
mainly user submitted) :)
You may get your answer quicker by asking on the IRC Channel (you can
access it with just a browser here: http://irc.cakephp.org).

On Oct 31, 10:21 am, "georgeL" <[EMAIL PROTECTED]> wrote:
> the available acl in cake is more like a raw toolset. this is on
> purpose so you can implement the acl completly free.
> the other side of this freedom is that you need to define your acl ARO
> and ACO objects yourself.
> 
> i was also looking for a dummi guide :-)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Scaffold: A few more features

2006-10-31 Thread Jose da Silva

Ok,
I agree with your scaffolf point of view, i think the bake feature is
just fine for 99% of cases.

regards
jose


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Need Help On ACL

2006-10-31 Thread georgeL

the available acl in cake is more like a raw toolset. this is on
purpose so you can implement the acl completly free.
the other side of this freedom is that you need to define your acl ARO
and ACO objects yourself. 

i was also looking for a dummi guide :-)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: data and views

2006-10-31 Thread Eric C Blount
Do the "bit of magic" in another method in the controller which returns the array. Call the method from each action. And if the array is based on data from a specific model, you should probably put the new function in that model.

 
Eric 
On 10/31/06, jamdown <[EMAIL PROTECTED]> wrote:
Hi:I'm new to cake and need a bit of help.Here's my problem, I have 2 actions, action A and action B. Action A
does a bit of magic and creates an array which is passed to its view.Now, action B needs to pass that same array to its view as well.However, action B only needs this array when a link located on actionA's view is clicked. The array could get very large, so breaking up and
sending as URL params back to B is not an option.I'm sure this is easy enough, but i'm just not seeing it. Any help willbe appreciated.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Cake PHP Help

2006-10-31 Thread Eric C Blount
Your URL should be http://localhost/cake/notes (I think...without actually seeing your setup). What webserver are you using? If it's not Apache, you might try 
http://localhost/cake/index.php/notes (right guys? correct me if I'm wrong).
 
HTH,
Eric 
On 10/31/06, Gayathiri Balachandran <[EMAIL PROTECTED]> wrote:

Hello! 
Please help me in finding answer to this.
I am new to Cake PHP. I have downloaded the Cake PHP and worked out the example show in the site 
http://www.sitepoint.com/article/application-development-cakephp. I had done all the coding as per in the example,
 -    Create a table (notes), 
-
   database.php (app/config),
-
   note.php (app/models),
-
   notes_controller.php (app/controllers). 
Creating *.thtml leads to an error. I just copy the code and save it as index.thtml (app/views/notes) and run in the browser (
http://localhost/cake/app/views/notes ), it simply displays the coding. 
 
The database is configured correctly. http://localhost/cake/ shows

"Your database configuration file is present. 
Cake is able to connect to the database."

Cake Version: 3632
PHP Version: PHP5
Database: MySQL
 Thanks in advance for all your help!!   
Regards,Gayathiri.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Nested categories controller and routing

2006-10-31 Thread Eric C Blount
A really quick search of the group for "routing" came up with many examples, but all you need to do is put something like the following in your /app/config/routes.php:$Route->connect('/articles/:param1', array('controller' => 'yourController', 'action' => 'yourAction'));
$Route->connect('/articles/:param1/:param2', array('controller' => 'yourController', 'action' => 'yourAction'));Then you can access the data with $this->params['param1'] and $this->params['param2'].
EricOn 10/31/06, gremlin <[EMAIL PROTECTED]> wrote:> > If I create a model with a relationship to itself ie a nested> categories model with a belongs to and has many relationship I can
> easily enough get a set of nested categories data.> > The problem for me is that if I wish to reference the content related> to that category I must either reference it directly or set a nesting
> depth limit on the parameters I pass via the url. More clearly I can't> figure out how I could set a controller to read category information> from an url that might have no parameters or 5 or 13 or any other
> number.> > Is there a way to take a structure like so :> Categories> __> id   -   parent_id   -   value> __> 0   -   null-   null
> 1   -  0-   articles> 2   -  0-   files> 3   -  1-   programming> 4   -  3-   php> > etc..> > and represent the actual hierarchy in the url as parameters?
> domain.ext/> domain.ext/articles> domain.ext/articles/php> > particulary in the case where in the future I might want to add a> sub-category to "php" thus making the url into
> domain.ext/articles/php/cake or similiar?> > > > > 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


data and views

2006-10-31 Thread jamdown

Hi:

I'm new to cake and need a bit of help.

Here's my problem, I have 2 actions, action A and action B. Action A
does a bit of magic and creates an array which is passed to its view.
Now, action B needs to pass that same array to its view as well.
However, action B only needs this array when a link located on action
A's view is clicked. The array could get very large, so breaking up and
sending as URL params back to B is not an option.

I'm sure this is easy enough, but i'm just not seeing it. Any help will
be appreciated.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---