Re: need suggestion on changing url

2007-06-11 Thread Geoff Ford

Who knows what search engines rank on these days.  Personally I think
the title in the url is good for users, they know what is at the link
before they go there.  Where possible I try to use titles, I dont
think the integer vs text search is all that import.  You should have
an index on the slug field if you're really worried about performance.

The site looks nice, and I didn't see the Memento typo but there is
one in "search this artincle" :)

On Jun 12, 4:07 pm, bingo <[EMAIL PROTECTED]> wrote:
> hi AD,
>
> I thought of doing so, but somehow I am not feeling comfortable with
> finding articles by title. Its much easier and efficient (I believe)
> to find articles by id as they are integers as compared to title which
> will require text search. Is there a way to use some redirect kind of
> facility.
>
> I think it will help to briefly explain the context. Is it true that
> search engines give higher ranking to websites that have more
> meaningful url ? If this is not true than I don't need to worry about.
>
> PS: I am not sure what do you mean by title bar. I looked at the
> webpage title, and tab title and both have right spelling.
>
> Thanks for your suggestion. I hope you can clear my doubts.
>
> Regards,
> bingohttp://findnwrite.com
>
> On Jun 11, 10:21 pm, AD7six <[EMAIL PROTECTED]> wrote:
>
> > On Jun 12, 5:54 am, bingo <[EMAIL PROTECTED]> wrote:
>
> > > hi,
>
> > > I have website that currently uses article id in the url. So my url
> > > looks something likehttp://findnwrite.com/memento/articles/details/2303. 
> > > Here 2303 is
> > > article id.
>
> > > Instead of article id, I would like to use article title in the url so
> > > it is optimized for search engine. But I also don't want to increase
> > > the number of queries in my controller (to determine article id from
> > > title).  Can I use clean url for this purpose. If so, can anyone point
> > > me how to do that. Or if clean url is not a solution, what other way I
> > > can achieve this transformation of url.
>
> > Why consider using clean url?
>
> > how about using $this->Article->findByIdOrTitle($id,$id); No extra
> > queries. and it would work with either the id or the title then.
>
> > hth,
>
> > AD
> > PS Memento is spelt wrong in the title bar.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: need suggestion on changing url

2007-06-11 Thread AD7six



On Jun 12, 8:07 am, bingo <[EMAIL PROTECTED]> wrote:
> hi AD,
>
> I thought of doing so, but somehow I am not feeling comfortable with
> finding articles by title. Its much easier and efficient (I believe)
> to find articles by id as they are integers as compared to title which
> will require text search. Is there a way to use some redirect kind of
> facility.

No matter what solution you do, you cannot avoid that you need to be
able to find an article by title, or find the article id which
corresponds to the title to do what you are asking. I see no point in
using a 3rd party service, or hosting another service on your own
server to translate /look-arnt-i-pretty to /2, when the time and
hassle to do that would be more than just handling it in your own
code. If you were going to put such a service on your own server that
would mean that user goes to url /a/url, a service rewrites that to /
another/url, mod_rewrite then rewrites that to index.php?/another/url
and cake then checks that against your routes definitions to figure
out what to do with it. That's at least 1 too many steps imo, and the
only way that the first step can work is if it looks in a db/
lookup table which seems to be what you are trying to avoid, but
infact just moving the logic to somewhere else (?).

Have a look at the slug behavior on the bakery.

Perhaps I put too much weight in the words "text search" but finding a
unique string value in a table will be marginally slower than finding
an integer, but only marginally. All a db does in such cases it looks
in the index (or sorts the table and then looks there if you don't
have an index - which of course you will want) and look up the first
value that matches.

Alternatively, you can make your links of the form /$id/$title, and if
the title in the url doesn't match the title of the article perform a
redirect to the correct url - but in that case you may be loading each
article twice.

>
> I think it will help to briefly explain the context. Is it true that
> search engines give higher ranking to websites that have more
> meaningful url ? If this is not true than I don't need to worry about.

Yes allegedly they do, because if your url contains "Investigating
Ontologies for Simulation Modeling" it is supposed that that page will
be about those (key) words rather than 'just' being a page that
contains them.

>
> PS: I am not sure what do you mean by title bar. I looked at the
> webpage title, and tab title and both have right spelling.

Go here http://findnwrite.com/memento/. I see "Mememnto - Mozilla
Firefox"

hth,

AD


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: need suggestion on changing url

2007-06-11 Thread bingo

hi AD,

I thought of doing so, but somehow I am not feeling comfortable with
finding articles by title. Its much easier and efficient (I believe)
to find articles by id as they are integers as compared to title which
will require text search. Is there a way to use some redirect kind of
facility.

I think it will help to briefly explain the context. Is it true that
search engines give higher ranking to websites that have more
meaningful url ? If this is not true than I don't need to worry about.

PS: I am not sure what do you mean by title bar. I looked at the
webpage title, and tab title and both have right spelling.

Thanks for your suggestion. I hope you can clear my doubts.

Regards,
bingo
http://findnwrite.com


On Jun 11, 10:21 pm, AD7six <[EMAIL PROTECTED]> wrote:
> On Jun 12, 5:54 am, bingo <[EMAIL PROTECTED]> wrote:
>
> > hi,
>
> > I have website that currently uses article id in the url. So my url
> > looks something likehttp://findnwrite.com/memento/articles/details/2303. 
> > Here 2303 is
> > article id.
>
> > Instead of article id, I would like to use article title in the url so
> > it is optimized for search engine. But I also don't want to increase
> > the number of queries in my controller (to determine article id from
> > title).  Can I use clean url for this purpose. If so, can anyone point
> > me how to do that. Or if clean url is not a solution, what other way I
> > can achieve this transformation of url.
>
> Why consider using clean url?
>
> how about using $this->Article->findByIdOrTitle($id,$id); No extra
> queries. and it would work with either the id or the title then.
>
> hth,
>
> AD
> PS Memento is spelt wrong in the title bar.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: need suggestion on changing url

2007-06-11 Thread Geoff Ford

I didn't realise you could do findByField1OrField2().  Is this a 1.2
feature or has it alwys been in cake.

On Jun 12, 3:21 pm, AD7six <[EMAIL PROTECTED]> wrote:
> On Jun 12, 5:54 am, bingo <[EMAIL PROTECTED]> wrote:
>
> > hi,
>
> > I have website that currently uses article id in the url. So my url
> > looks something likehttp://findnwrite.com/memento/articles/details/2303. 
> > Here 2303 is
> > article id.
>
> > Instead of article id, I would like to use article title in the url so
> > it is optimized for search engine. But I also don't want to increase
> > the number of queries in my controller (to determine article id from
> > title).  Can I use clean url for this purpose. If so, can anyone point
> > me how to do that. Or if clean url is not a solution, what other way I
> > can achieve this transformation of url.
>
> Why consider using clean url?
>
> how about using $this->Article->findByIdOrTitle($id,$id); No extra
> queries. and it would work with either the id or the title then.
>
> hth,
>
> AD
> PS Memento is spelt wrong in the title bar.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: need suggestion on changing url

2007-06-11 Thread AD7six



On Jun 12, 5:54 am, bingo <[EMAIL PROTECTED]> wrote:
> hi,
>
> I have website that currently uses article id in the url. So my url
> looks something likehttp://findnwrite.com/memento/articles/details/2303. Here 
> 2303 is
> article id.
>
> Instead of article id, I would like to use article title in the url so
> it is optimized for search engine. But I also don't want to increase
> the number of queries in my controller (to determine article id from
> title).  Can I use clean url for this purpose. If so, can anyone point
> me how to do that. Or if clean url is not a solution, what other way I
> can achieve this transformation of url.

Why consider using clean url?

how about using $this->Article->findByIdOrTitle($id,$id); No extra
queries. and it would work with either the id or the title then.

hth,

AD
PS Memento is spelt wrong in the title bar.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



$db object being closed after query with association

2007-06-11 Thread Allan Wang

Trying both 1.1.15.5144 and 1.2.0.5146alpha, and svn trunk, I cannot
get a simple, two-table app with only scaffolding to work properly. No
one on IRC has been able to help either.

I am using postgresql, with two tables: tournaments -> draws

My models are:

class Draw extends AppModel
{
var $name = 'Draw';
var $belongsTo = array(
'Tournament' => array(
'className' => 'Tournament',
'foreignKey' => 'tournament_id'
)
);
}

class Tournament extends AppModel
{
var $name = 'Tournament';
var $hasMany = array(
'Draw' => array(
'className' => 'Draw',
'dependent' => true,
'foreign_key' => 'tournament_id'
)
);
}

I am just using scaffolding, but anytime the code tries to read the
Tournament, the database object seems to close automatically (causing
the SQL log table to be displayed at the top of the page, instead of
the end). As a result, the edit pages are broken.

I added a debug_print_backtrace() to DBO_Source::destruct(), and it
shows this:

#0  DboSource->__destruct() called at [cake/libs/model/model.php:1451]
#1  DboSource->read(Tournament Object ([name] => Tournament,[hasMany]
=> Array ([Draw] => Array ([className] => Draw,[dependent] => 1,
[foreign_key] => tournament_id,[foreignKey] => tournament_id, ...)
called at [cake/libs/model/model.php:1451]
#2  Model->findAll(Array ([Tournament.id] => 3), , , 1, , ) called at
[cake/libs/model/model.php:1378]
#3  Model->find(Array ([Tournament.id] => 3), ) called at [cake/libs/
model/model.php:947]
#4  Model->read() called at [cake/libs/controller/scaffold.php:225]
#5  Scaffold->__scaffoldView(Array ([controller] => tournaments,
[action] => view, ...)  called at [cake/libs/controller/scaffold.php:
454]
...

No other error messages are displayed, so I cannot find the cause of
this problem. I am thinking it may be an issue with postgresql, but
I'm not sure. I am hoping a developer would be able to figure out why
this would happen. Or perhaps it's a problem with my code I cannot
see.

(I am running SVN trunk for now)

I made a ticket on the trac about this before I realized that there
was a google group for cakephp, so please disregard that.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Validate using multiple error messages

2007-06-11 Thread pbland

I've followed this article:
http://bakery.cakephp.org/articles/view/multiple-rules-of-validation-per-field-in-cakephp-1-2
but I'm getting this error:


Warning: preg_match() expects parameter 1 to be string, array given in
C:\Program Files\Apache Group\Apache2\htdocs\3Bids\cake\libs\model
\model_php4.php on line 1367

Here's my model code:

var $validate = array(
'firstname' => VALID_NOT_EMPTY,
'lastname' => VALID_NOT_EMPTY,
'username' => array('required' => VALID_NOT_EMPTY,
 'length' => array('rule' => 
array('minLength',
6))),
'password' => VALID_NOT_EMPTY
);

I've got v1.2 so I don't see what I'm doing wrong that the article
isn't also doing. Anyone?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Three table connection

2007-06-11 Thread Joey

Testing

On Jun 8, 4:29 pm, Joshua Benner <[EMAIL PROTECTED]> wrote:
> Well, the most direct answer:
>
> Items belongsTo Types
> Types hasAndBelongsToMany Questions
> Questions hasAndBelongsToMany Answers
> (you can add relations in the other direction, too)
>
> Then when you retrieve an item, you would need recursive=3, and you'd
> have access to all the data in an array following the association hierarchy.
>
> Now, I don't know the specific application you're working on, but my
> instinct suggests that you might not want to be pulling every question
> for each type that any given item is related to. So I would pull items
> with recurisve=1, provide links to the types, and pull types one at a
> time based on user input with the appropriate recursive setting for the
> display you want to generate.
>
> Remember to try not to pull way more data than you will use or display,
> and don't define associations just for the heck of it if you're not
> going to use them. Also remember two-way associations can be weird with
> higher recursion settings, causing a lot of extra queries to the database.
>
> If you would like to describe your application and the target interface
> a little, maybe we could help you narrow down your implementation options.
>
>
>
> Joey wrote:
> > Ok here is the scenario.
>
> > There will be "Items" that are of a "Type" and each "Type" has it own
> > "Questions" and the "Questions" have their own "Answers".  So how do I
> > store the "Answers" chosen for each "Question" for each "Item".
>
> > The table structure so far is below.  Let me know if this doesn't make
> > sense, or if I am going about this wrong.
>
> > Thanks,
> > Joey
>
> > CREATE TABLE `items` (
> >   `id` int(11) NOT NULL auto_increment,
> >   `type_id` int(11) NOT NULL,
> >   `title` varchar(255) default NULL,
> >   `description` mediumtext,
> >   `date` datetime NOT NULL,
> >   PRIMARY KEY  (`id`),
> >   KEY `type_id` (`type_id`)
> > )
>
> > CREATE TABLE `types` (
> >   `id` int(11) NOT NULL auto_increment,
> >   `name` varchar(100) NOT NULL,
> >   PRIMARY KEY  (`id`)
> > )
>
> > CREATE TABLE `questions` (
> >   `id` int(11) NOT NULL auto_increment,
> >   `question` mediumtext NOT NULL,
> >   PRIMARY KEY  (`id`)
> > )
>
> > CREATE TABLE `answers` (
> >   `id` int(11) NOT NULL auto_increment,
> >   `answer` mediumtext NOT NULL,
> >   PRIMARY KEY  (`id`)
> > )
>
> > CREATE TABLE `answers_questions` (
> >   `answer_id` int(11) NOT NULL,
> >   `question_id` int(11) NOT NULL,
> >   `order` int(11) default NULL,
> >   PRIMARY KEY  (`answer_id`,`question_id`)
> > )
>
> > CREATE TABLE `questions_types` (
> >   `question_id` int(11) NOT NULL,
> >   `type_id` int(11) NOT NULL,
> >   `order` int(11) default NULL,
> >   PRIMARY KEY  (`question_id`,`type_id`)
> > )
>
> --
> Joshua Bennerhttp://bennerweb.com


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



need suggestion on changing url

2007-06-11 Thread bingo

hi,

I have website that currently uses article id in the url. So my url
looks something like
http://findnwrite.com/memento/articles/details/2303 . Here 2303 is
article id.

Instead of article id, I would like to use article title in the url so
it is optimized for search engine. But I also don't want to increase
the number of queries in my controller (to determine article id from
title).  Can I use clean url for this purpose. If so, can anyone point
me how to do that. Or if clean url is not a solution, what other way I
can achieve this transformation of url.

looking forward any suggestions.

Regards,
bingo
http://findnwrite.com


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How can I fetch selected associations?

2007-06-11 Thread Geoff Ford

If you are using 1.2 there is an excellent behaviour from Felix
http://www.thinkingphp.org/2007/05/13/bringing-the-cold-war-to-cakephp-12-the-containable-behavior/

It allows you to specify which models and fields that the find*
functions use.  Very handy.

On Jun 12, 12:08 pm, Jorge Vargas <[EMAIL PROTECTED]> wrote:
> Hi
>
> I'm new to cake but not to app development. I'm confused with the
> following: I got a table structure and assoc. Everything loaded fine
> with the scaffold so relationships are ok. PS: sorry if I break naming
> conventions here they are not in the code.
>
> I got a TakeExamController which has a method call take($id) which
> will display the exam and then another call grade that will store the
> results.
>
> my model has the following Exam hasMany Sections hasMany Questions
> *other stuff
>
> so I want take() to fetch my Exam.name all it's section.name and
> everything under Question. In order to this play it all in the view as
> a normal exam.
>
> now I have accomplish this with the very ugly $this->set('exam',$this-
>
> >Exam->find(null,null,null,3));#$recursive=3
>
> and then I could juggle with that huge set of data in the view but
> that's way way too inefficient.
>
> I have manage to clear all the non-desired fields from all Models with
> the following.
> $fields=array('name')
> $exam=$this->Exam->read($fields);
> or the equivalent find()
> etc.
>
> but what got me lost is how I can fetch one and only one of the assoc
> for example Exam has a relationship with ExamResults but I don't want
> that right now. I just wants all Sections that belong to the current
> exam. how hard can that be? isn't there a way to get just one assoc
> without fetching everything that related to that object from the db?
>
> PS: someone on IRC told me about bind/unbind but that just seems like
> going way to far to get a simple query going


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



How can I fetch selected associations?

2007-06-11 Thread Jorge Vargas

Hi

I'm new to cake but not to app development. I'm confused with the
following: I got a table structure and assoc. Everything loaded fine
with the scaffold so relationships are ok. PS: sorry if I break naming
conventions here they are not in the code.

I got a TakeExamController which has a method call take($id) which
will display the exam and then another call grade that will store the
results.

my model has the following Exam hasMany Sections hasMany Questions
*other stuff

so I want take() to fetch my Exam.name all it's section.name and
everything under Question. In order to this play it all in the view as
a normal exam.

now I have accomplish this with the very ugly $this->set('exam',$this-
>Exam->find(null,null,null,3));#$recursive=3

and then I could juggle with that huge set of data in the view but
that's way way too inefficient.

I have manage to clear all the non-desired fields from all Models with
the following.
$fields=array('name')
$exam=$this->Exam->read($fields);
or the equivalent find()
etc.

but what got me lost is how I can fetch one and only one of the assoc
for example Exam has a relationship with ExamResults but I don't want
that right now. I just wants all Sections that belong to the current
exam. how hard can that be? isn't there a way to get just one assoc
without fetching everything that related to that object from the db?

PS: someone on IRC told me about bind/unbind but that just seems like
going way to far to get a simple query going


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: cakephp request lifecycle

2007-06-11 Thread John David Anderson (_psychic_)


On Jun 11, 2007, at 7:24 PM, cakePHP wrote:

>
> Hi,
>
> Is there a good article that discusses the lifecycle of a request to
> response in cakephp?

Here's an excerpt from the (draft) CakePHP 1.2 Manual:

http://cakeforge.org/docman/view.php/53/462/1point2.pdf

-- 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?hl=en
-~--~~~~--~~--~--~---



cakephp request lifecycle

2007-06-11 Thread cakePHP

Hi,

Is there a good article that discusses the lifecycle of a request to
response in cakephp?
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?hl=en
-~--~~~~--~~--~--~---



Re: Validation of Array

2007-06-11 Thread Ketan Patel

I can also write a function to validate the array if it belongs to
certain type. But then to populate the message correctly in the view,
it needs stuff to be written and its not elegant solution. So I am
looking for a better solution.

On Jun 11, 8:33 pm, Ketan Patel <[EMAIL PROTECTED]> wrote:
> In CakePHP 1.2, is it possible to validate an array of elements to be
> of certain type. for eg.: I want the user to enter name in several
> input textboxes. I have named them as name_1, name_2 and so on.
>
> For ease of use, I save all name_{n} in an array name. I want to
> validate this array name to of type 'alphaNumeric' .  {n} is a varying
> number.
>
> var $validate = array('name' => array('rule'=>'alphaNumeric',
> 'message'=>'Not Valid name'));
>
> I believe its not then what would be best scenario to handle the form
> with similar elements and validate them?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Validation of Array

2007-06-11 Thread Ketan Patel

In CakePHP 1.2, is it possible to validate an array of elements to be
of certain type. for eg.: I want the user to enter name in several
input textboxes. I have named them as name_1, name_2 and so on.

For ease of use, I save all name_{n} in an array name. I want to
validate this array name to of type 'alphaNumeric' .  {n} is a varying
number.

var $validate = array('name' => array('rule'=>'alphaNumeric',
'message'=>'Not Valid name'));

I believe its not then what would be best scenario to handle the form
with similar elements and validate them?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



routing and pagination

2007-06-11 Thread gerbenzomp

I use AD7six's pagination helper/component, and it works great! But
right now I'm changing the default routes, so the user's sitename
comes before every controller->action.

Like this:
 $Route->connect("/:sitename/posts/edit/*", array("controller" =>
"posts", "action" => "edit"));

This works fine for most controllers/actions, but I can't seem to
"resurrect" the pagination part in this new setup.

Right now I have the routing for the pagination like this:
$Route->connect("/:sitename/Posts/index/page/*", array("controller" =>
"posts", "action" => "index"));

But this way, I get the first "posts" page on every pagination link I
click. How can I make sure the pagination works again?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Problem with database connections

2007-06-11 Thread Roger Blum

Grant Cox wrote:
> Search this group and you'll see it's come up a few times.  Apparently
> it's a bug in the php mysql connector, where having two different
> database connections with the same authentication doesn't work (it
> confuses which connection to use).  If you use a different username/
> password for each database you'll have no problems.
> 
> 
> > 
> 
Thanks, Grant.

I have been searching but didn't find a matching post.
I will let the database guys know I need a separate user :-)

Roger


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Default Pagination options

2007-06-11 Thread rtconner

For future people with this problem...
Well I found something that finally worked the way I want it. I'm not
sure if this is the proper way to order pagination, but its the only
one which works properly.

var $paginate => array('order'=>array('account_number' => 'desc'));

gwoo said on IRC that array('order' => 'account_number ASC') should
work, but paginator does not properly recognize it. I'll file a bug on
that.


On Jun 6, 12:15 pm, rtconner <[EMAIL PROTECTED]> wrote:
> Ok, right now I'm leaning towards "I've found a bug". But we'll see
> how this pans out.  Lets start here.. a simple quesiton... If this
> gets anwered, maybe there are no problems.
>
> What is the correct way to set the default pagination direction and
> column using the pagination in Cake 1.2?
>
> (FYI, a direction or sort column in the $paginatevariable in the
> controller seems to not let that value ever change using the data from
> the url)


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Drake, Cake, and Templating

2007-06-11 Thread Jonathan Langevin
My thoughts behind the templating issue is that I personally prefer to use
PHP-style templates (I like Cake's implementation), but I also would like to
provide support for other template styles, as many people often have a
Smarty-style theme created (so it would be simpler for the user's theme to
migrate from smarty on some other application to smarty using my app)

I think smarty is good when there is a need to reduce the amount of
sometimes lengthy php variable references, because changing in/out of HTML
to PHP can be quite confusing if it's heavily intermixed (often a situation
that comes out of not keeping MVC-strict, but it happens)

I'd definitely like to see what you've done with Drake & a sample
application, if you don't mind :-)

One thing that seems nice about the bridges to CMSes, is that you could
develop a must-have application that can easily run across multiple CMSes,
something that is usually a feat to accomplish...

That'd be nice

On 6/11/07, Joshua Benner <[EMAIL PROTECTED]> wrote:
>
>
> In response to
> http://groups.google.com/group/cake-php/msg/838c013d48104b7e
>
> I kinda felt like we were hijacking the thread, so here's my response to
> your message.
>
> So far we've only developed small applications for internal use. I have
> no problem sharing them, but I don't know if they'll hold much meaning
> for you since they will be outside of our context. If you want me to
> send a sample, just let me know. I'm also willing to share the changes I
> made to Drake -- just ask.
>
> You mentioned that you were considering integrating Smarty with Cake.
> I've seen some minor flames shoot up over using Smarty or just PHP, and
> I feel like I can talk as someone who's walked both sides of that fence.
> I've used Smarty for a long time in many projects, and finally abandoned
> it when I started using Cake. While I liked that way Smarty did a great
> job separating display logic from business logic (which was the biggest
> argument for using it), Cake does a great job at that by itself without
> a templating system. Additionally, I was always extending Smarty and I
> found myself spending an unacceptable amount of time forcing my template
> system to do the advanced things I wanted it to.
>
> In all honesty, PHP _is_ a templating system by itself... probably one
> of the best there is. Granted, the advanced programming features
> available in display logic tempts a programmer to put business logic
> there, but that's nothing a little discipline and adherence to Cake
> standards doesn't cure.
>
> I would never fault somebody for using something like Smarty -- it
> really is great (and nice if you're going to expose it to end users --
> carefully), but I'd encourage people to use pure PHP, as its more
> powerful, faster, and in the end, seems to save (me) time vs Smarty when
> working on a project.
>
>
> --
> Joshua Benner
> http://bennerweb.com
>
>
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Drake, Cake, and Templating

2007-06-11 Thread Joshua Benner

In response to http://groups.google.com/group/cake-php/msg/838c013d48104b7e

I kinda felt like we were hijacking the thread, so here's my response to 
your message.

So far we've only developed small applications for internal use. I have 
no problem sharing them, but I don't know if they'll hold much meaning 
for you since they will be outside of our context. If you want me to 
send a sample, just let me know. I'm also willing to share the changes I 
made to Drake -- just ask.

You mentioned that you were considering integrating Smarty with Cake. 
I've seen some minor flames shoot up over using Smarty or just PHP, and 
I feel like I can talk as someone who's walked both sides of that fence. 
I've used Smarty for a long time in many projects, and finally abandoned 
it when I started using Cake. While I liked that way Smarty did a great 
job separating display logic from business logic (which was the biggest 
argument for using it), Cake does a great job at that by itself without 
a templating system. Additionally, I was always extending Smarty and I 
found myself spending an unacceptable amount of time forcing my template 
system to do the advanced things I wanted it to.

In all honesty, PHP _is_ a templating system by itself... probably one 
of the best there is. Granted, the advanced programming features 
available in display logic tempts a programmer to put business logic 
there, but that's nothing a little discipline and adherence to Cake 
standards doesn't cure.

I would never fault somebody for using something like Smarty -- it 
really is great (and nice if you're going to expose it to end users -- 
carefully), but I'd encourage people to use pure PHP, as its more 
powerful, faster, and in the end, seems to save (me) time vs Smarty when 
working on a project.

 
-- 
Joshua Benner
http://bennerweb.com


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How to make call to helpers classes and others

2007-06-11 Thread Jonathan Langevin
This has me intrigued now, thinking about the possibilities :-)

On 6/11/07, Joshua Benner <[EMAIL PROTECTED]> wrote:
>
>
> We make use of Drake fairly extensively on our organization's intranet,
> and I use the Drupal API all the time, since technically Cake is
> executing as a module with full access to the rest of Drupal. This is
> nice because Drupal handles LDAP authentication, which our Cake apps
> then have access to, etc.
>
> Jonathan Langevin wrote:
> > My understanding is the same as Joshua. It's a bridge that allows
> > Joomla access to the Cake applications/api, and Cake access to the
> > Joomla applications/api.
> > To completely replace the Joomla api, that would seem to be pretty
> > complex, as you would have to update existing Joomla
> > components/modules to work with Cake.
> >
> > Maybe look at Jake's source code, to see how they are implementing
> > Cake into Joomla, that might help you figure out what you would need
> > to change for your own undertaking
> >
> > On 6/11/07, *Joshua Benner* <[EMAIL PROTECTED]
> > > wrote:
> >
> >
> > Yes, they are bridges, but they still have full access to the
> > Joomla and
> > Drake APIs (AFAIK).
> >
> > chanh.ong wrote:
> > > Thanks for the tips but I am not sure that is how I want.  I
> > just want
> > > to use cake as a framework not a bridge to run cake app in
> > Mambo.  I
> > > think that is how Jake and Drake is doing.  A bridge to run cake
> app
> > > in Joomla and Drupal.
> > >
> > > I just want to be able to use cake api and classes at this point.
> > >
> > > On Jun 11, 8:17 am, "Jonathan Langevin" < [EMAIL PROTECTED]
> > > wrote:
> > >
> > >>
> >
> http://cakebaker.42dh.com/2007/01/29/joomla-and-cakephp/http://dev.sypad.com/projects/jake/
> > <
> http://cakebaker.42dh.com/2007/01/29/joomla-and-cakephp/http://dev.sypad.com/projects/jake/
> >
> > << official home of Jake?
> > >>
> > >> On 6/11/07, Joshua Benner <[EMAIL PROTECTED]
> > > wrote:
> > >>
> > >>
> > >>
> > >>
> > >>> I know there is a Joomla extensions that integrates Cake
> > (called Jake I
> > >>> believe) -- it may work for mambo, or there may be a similar
> > extension
> > >>> for Mambo -- or perhaps you could port it.
> > >>>
> > >>> chanh.ong wrote:
> > >>>
> >  I was able to bootstrap cake into Mambo and able to call global
> >  functions and cake constant but not able to figure out how to
> > call
> >  helpers, etc, any suggestion?
> > 
> >  I am not using the normal cake controller, etc.  I create an
> > include
> >  file that bootstrap cake into Mambo as a library and hoping
> > to use
> >  cake framework inside Mambo.
> > 
> >  Any bootstrap advise is appreciated.
> > 
> >  Thanks
> > 
> > >>> --
> > >>> Joshua Benner
> > >>> http://bennerweb.com
> > >>>
> > >
> > >
> > > >
> > >
> >
> >
> > --
> > Joshua Benner
> > http://bennerweb.com
> >
> >
> >
> >
> > >
>
>
> --
> Joshua Benner
> http://bennerweb.com
>
>
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How to make call to helpers classes and others

2007-06-11 Thread Jonathan Langevin
Do you have any examples of projects you have completed using Drake? (if you
can share them)

Heck, if I could utilize Drupal/Joomla for it's template support alone, that
would be awesome, as it seems too much of a bother to shoehorn something
like Smarty into Cake

On 6/11/07, Joshua Benner <[EMAIL PROTECTED]> wrote:
>
>
> In my opinion, it really is an incredible match made in heaven. The CSS
> styles are even almost compatible. We've only made minor changes to the
> default Cake CSS, and it looks like it's just another part of Drupal.
>
> I also made some small modifications to Drake to introduce
> per-application Drupal permissions. So for a user to use a certain
> application, they have to have a certain Drupal permission that's found
> under the Drake section.
>
> I talk about our search for a framework and platform here:
> http://bennerweb.com/node/11
>
>
> Jonathan Langevin wrote:
> > This has me intrigued now, thinking about the possibilities :-)
> >
> > On 6/11/07, *Joshua Benner* <[EMAIL PROTECTED]
> > > wrote:
> >
> >
> > We make use of Drake fairly extensively on our organization's
> > intranet,
> > and I use the Drupal API all the time, since technically Cake is
> > executing as a module with full access to the rest of Drupal. This
> is
> > nice because Drupal handles LDAP authentication, which our Cake apps
> > then have access to, etc.
> >
> > Jonathan Langevin wrote:
> > > My understanding is the same as Joshua. It's a bridge that allows
> > > Joomla access to the Cake applications/api, and Cake access to the
> > > Joomla applications/api.
> > > To completely replace the Joomla api, that would seem to be pretty
> > > complex, as you would have to update existing Joomla
> > > components/modules to work with Cake.
> > >
> > > Maybe look at Jake's source code, to see how they are implementing
> > > Cake into Joomla, that might help you figure out what you would
> need
> > > to change for your own undertaking
> > >
> > > On 6/11/07, *Joshua Benner* <[EMAIL PROTECTED]
> > 
> > > >>
> wrote:
> > >
> > >
> > > Yes, they are bridges, but they still have full access to the
> > > Joomla and
> > > Drake APIs (AFAIK).
> > >
> > > chanh.ong wrote:
> > > > Thanks for the tips but I am not sure that is how I want.  I
> > > just want
> > > > to use cake as a framework not a bridge to run cake app in
> > > Mambo.  I
> > > > think that is how Jake and Drake is doing.  A bridge to
> > run cake app
> > > > in Joomla and Drupal.
> > > >
> > > > I just want to be able to use cake api and classes at this
> > point.
> > > >
> > > > On Jun 11, 8:17 am, "Jonathan Langevin" <
> > [EMAIL PROTECTED] 
> > > >>
> wrote:
> > > >
> > > >>
> > >
> >
> http://cakebaker.42dh.com/2007/01/29/joomla-and-cakephp/http://dev.sypad.com/projects/jake/
> > <
> http://cakebaker.42dh.com/2007/01/29/joomla-and-cakephp/http://dev.sypad.com/projects/jake/
> >
> > >
> > <
> http://cakebaker.42dh.com/2007/01/29/joomla-and-cakephp/http://dev.sypad.com/projects/jake/
> >
> >
> > > << official home of Jake?
> > > >>
> > > >> On 6/11/07, Joshua Benner <[EMAIL PROTECTED]
> > 
> > >  > >> wrote:
> > > >>
> > > >>
> > > >>
> > > >>
> > > >>> I know there is a Joomla extensions that integrates Cake
> > > (called Jake I
> > > >>> believe) -- it may work for mambo, or there may be a
> similar
> > > extension
> > > >>> for Mambo -- or perhaps you could port it.
> > > >>>
> > > >>> chanh.ong wrote:
> > > >>>
> > >  I was able to bootstrap cake into Mambo and able to
> > call global
> > >  functions and cake constant but not able to figure out
> > how to
> > > call
> > >  helpers, etc, any suggestion?
> > > 
> > >  I am not using the normal cake controller, etc.  I
> > create an
> > > include
> > >  file that bootstrap cake into Mambo as a library and
> > hoping
> > > to use
> > >  cake framework inside Mambo.
> > > 
> > >  Any bootstrap advise is appreciated.
> > > 
> > >  Thanks
> > > 
> > > >>> --
> > > >>> Joshua Benner
> > > >>> http://bennerweb.com
> > > >>>
> > > >
> > > >
> > > > >
> > > >
> > >
> > >
> > > --
> > > Joshua Benner
> > > http://bennerweb.

Re: How to make call to helpers classes and others

2007-06-11 Thread Joshua Benner

In my opinion, it really is an incredible match made in heaven. The CSS 
styles are even almost compatible. We've only made minor changes to the 
default Cake CSS, and it looks like it's just another part of Drupal.

I also made some small modifications to Drake to introduce 
per-application Drupal permissions. So for a user to use a certain 
application, they have to have a certain Drupal permission that's found 
under the Drake section.

I talk about our search for a framework and platform here:
http://bennerweb.com/node/11


Jonathan Langevin wrote:
> This has me intrigued now, thinking about the possibilities :-)
>
> On 6/11/07, *Joshua Benner* <[EMAIL PROTECTED] 
> > wrote:
>
>
> We make use of Drake fairly extensively on our organization's
> intranet,
> and I use the Drupal API all the time, since technically Cake is
> executing as a module with full access to the rest of Drupal. This is
> nice because Drupal handles LDAP authentication, which our Cake apps
> then have access to, etc.
>
> Jonathan Langevin wrote:
> > My understanding is the same as Joshua. It's a bridge that allows
> > Joomla access to the Cake applications/api, and Cake access to the
> > Joomla applications/api.
> > To completely replace the Joomla api, that would seem to be pretty
> > complex, as you would have to update existing Joomla
> > components/modules to work with Cake.
> >
> > Maybe look at Jake's source code, to see how they are implementing
> > Cake into Joomla, that might help you figure out what you would need
> > to change for your own undertaking
> >
> > On 6/11/07, *Joshua Benner* <[EMAIL PROTECTED]
> 
> > >> wrote:
> >
> >
> > Yes, they are bridges, but they still have full access to the
> > Joomla and
> > Drake APIs (AFAIK).
> >
> > chanh.ong wrote:
> > > Thanks for the tips but I am not sure that is how I want.  I
> > just want
> > > to use cake as a framework not a bridge to run cake app in
> > Mambo.  I
> > > think that is how Jake and Drake is doing.  A bridge to
> run cake app
> > > in Joomla and Drupal.
> > >
> > > I just want to be able to use cake api and classes at this
> point.
> > >
> > > On Jun 11, 8:17 am, "Jonathan Langevin" <
> [EMAIL PROTECTED] 
> > >> wrote:
> > >
> > >>
> >
> 
> http://cakebaker.42dh.com/2007/01/29/joomla-and-cakephp/http://dev.sypad.com/projects/jake/
> 
> 
> >
> 
> 
>
> > << official home of Jake?
> > >>
> > >> On 6/11/07, Joshua Benner <[EMAIL PROTECTED]
> 
> >  >> wrote:
> > >>
> > >>
> > >>
> > >>
> > >>> I know there is a Joomla extensions that integrates Cake
> > (called Jake I
> > >>> believe) -- it may work for mambo, or there may be a similar
> > extension
> > >>> for Mambo -- or perhaps you could port it.
> > >>>
> > >>> chanh.ong wrote:
> > >>>
> >  I was able to bootstrap cake into Mambo and able to
> call global
> >  functions and cake constant but not able to figure out
> how to
> > call
> >  helpers, etc, any suggestion?
> > 
> >  I am not using the normal cake controller, etc.  I
> create an
> > include
> >  file that bootstrap cake into Mambo as a library and
> hoping
> > to use
> >  cake framework inside Mambo.
> > 
> >  Any bootstrap advise is appreciated.
> > 
> >  Thanks
> > 
> > >>> --
> > >>> Joshua Benner
> > >>> http://bennerweb.com
> > >>>
> > >
> > >
> > > >
> > >
> >
> >
> > --
> > Joshua Benner
> > http://bennerweb.com
> >
> >
> >
> >
> > >
>
>
> --
> Joshua Benner
> http://bennerweb.com
>
>
>
>
> >

 
-- 
Joshua Benner
http://bennerweb.com


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~--

Re: SWFupload for cake1.2

2007-06-11 Thread Jonathan Langevin
2mb limitation is usually due to php.ini settings, you'll have to edit your
php.ini file and restart the httpd daemon

On 6/11/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
>
> On May 30, 4:29 pm, msajpm <[EMAIL PROTECTED]> wrote:
> > > Hopefully someone finds it useful.
> > > --
> > > Siegfried
> >
> > Thanks Siegfried.
> > Just begining to use cakePHP and I was having a long time trying to
> > modify it by myself to use with 1.2.
> >
> > I have two a questions.
> >
> > I`m able touploadfiles using normal file tags but notswfway. Could
> > you use theswfway?
>
> I can't get the swf way to work either. I also can't upload larger
> than 2MB.
>
>
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: SWFupload for cake1.2

2007-06-11 Thread [EMAIL PROTECTED]



On May 30, 4:29 pm, msajpm <[EMAIL PROTECTED]> wrote:
> > Hopefully someone finds it useful.
> > --
> > Siegfried
>
> Thanks Siegfried.
> Just begining to use cakePHP and I was having a long time trying to
> modify it by myself to use with 1.2.
>
> I have two a questions.
>
> I`m able touploadfiles using normal file tags but notswfway. Could
> you use theswfway?

I can't get the swf way to work either. I also can't upload larger
than 2MB.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How to make call to helpers classes and others

2007-06-11 Thread Joshua Benner

We make use of Drake fairly extensively on our organization's intranet, 
and I use the Drupal API all the time, since technically Cake is 
executing as a module with full access to the rest of Drupal. This is 
nice because Drupal handles LDAP authentication, which our Cake apps 
then have access to, etc.

Jonathan Langevin wrote:
> My understanding is the same as Joshua. It's a bridge that allows 
> Joomla access to the Cake applications/api, and Cake access to the 
> Joomla applications/api.
> To completely replace the Joomla api, that would seem to be pretty 
> complex, as you would have to update existing Joomla 
> components/modules to work with Cake.
>
> Maybe look at Jake's source code, to see how they are implementing 
> Cake into Joomla, that might help you figure out what you would need 
> to change for your own undertaking
>
> On 6/11/07, *Joshua Benner* <[EMAIL PROTECTED] 
> > wrote:
>
>
> Yes, they are bridges, but they still have full access to the
> Joomla and
> Drake APIs (AFAIK).
>
> chanh.ong wrote:
> > Thanks for the tips but I am not sure that is how I want.  I
> just want
> > to use cake as a framework not a bridge to run cake app in
> Mambo.  I
> > think that is how Jake and Drake is doing.  A bridge to run cake app
> > in Joomla and Drupal.
> >
> > I just want to be able to use cake api and classes at this point.
> >
> > On Jun 11, 8:17 am, "Jonathan Langevin" < [EMAIL PROTECTED]
> > wrote:
> >
> >>
> 
> http://cakebaker.42dh.com/2007/01/29/joomla-and-cakephp/http://dev.sypad.com/projects/jake/
> 
> 
> << official home of Jake?
> >>
> >> On 6/11/07, Joshua Benner <[EMAIL PROTECTED]
> > wrote:
> >>
> >>
> >>
> >>
> >>> I know there is a Joomla extensions that integrates Cake
> (called Jake I
> >>> believe) -- it may work for mambo, or there may be a similar
> extension
> >>> for Mambo -- or perhaps you could port it.
> >>>
> >>> chanh.ong wrote:
> >>>
>  I was able to bootstrap cake into Mambo and able to call global
>  functions and cake constant but not able to figure out how to
> call
>  helpers, etc, any suggestion?
> 
>  I am not using the normal cake controller, etc.  I create an
> include
>  file that bootstrap cake into Mambo as a library and hoping
> to use
>  cake framework inside Mambo.
> 
>  Any bootstrap advise is appreciated.
> 
>  Thanks
> 
> >>> --
> >>> Joshua Benner
> >>> http://bennerweb.com
> >>>
> >
> >
> > >
> >
>
>
> --
> Joshua Benner
> http://bennerweb.com
>
>
>
>
> >

 
-- 
Joshua Benner
http://bennerweb.com


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Behavior afterFind on associated Model

2007-06-11 Thread Joshua Benner

ModelA hasMany ModelB
ModelB actsAs SomeBehavior

SomeBehavior defines afterFind()

ModelAController::someAction() has:
$this->ModelA->recursive = 1;
$this->ModelA->findAll();

Will SomeBehavior::afterFind() be triggered for ModelB, since ModelB 
will be retrieved via association to ModelA?

So far in my testing, the afterFind on the behavior does not seem to be 
called. Is this normal? Is this on purpose?

The $primary argument in behavior functions would seem to suggest that 
the behavior functions should still be called even if the model acting 
as the behavior is being queried as a result of an association.

I may be confused on this, though. Any help?

 
-- 
Joshua Benner
http://bennerweb.com


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How to make call to helpers classes and others

2007-06-11 Thread chanh.ong

You might be right!
I was able to create a little bootstrap in Mambo to Cake where I can
call all Cake global functions and constant so I thought I should be
able to access to some of other classes.

This is just a proof of concept and an brain twister on my part to see
if it is possible.

Thanks

On Jun 11, 11:49 am, "Jonathan Langevin" <[EMAIL PROTECTED]> wrote:
> My understanding is the same as Joshua. It's a bridge that allows Joomla
> access to the Cake applications/api, and Cake access to the Joomla
> applications/api.
> To completely replace the Joomla api, that would seem to be pretty complex,
> as you would have to update existing Joomla components/modules to work with
> Cake.
>
> Maybe look at Jake's source code, to see how they are implementing Cake into
> Joomla, that might help you figure out what you would need to change for
> your own undertaking
>
> On 6/11/07, Joshua Benner <[EMAIL PROTECTED]> wrote:
>
>
>
> > Yes, they are bridges, but they still have full access to the Joomla and
> > Drake APIs (AFAIK).
>
> > chanh.ong wrote:
> > > Thanks for the tips but I am not sure that is how I want.  I just want
> > > to use cake as a framework not a bridge to run cake app in Mambo.  I
> > > think that is how Jake and Drake is doing.  A bridge to run cake app
> > > in Joomla and Drupal.
>
> > > I just want to be able to use cake api and classes at this point.
>
> > > On Jun 11, 8:17 am, "Jonathan Langevin" <[EMAIL PROTECTED]> wrote:
>
> >http://cakebaker.42dh.com/2007/01/29/joomla-and-cakephp/http://dev.sy...<< 
> >official home of Jake?
>
> > >> On 6/11/07, Joshua Benner <[EMAIL PROTECTED]> wrote:
>
> > >>> I know there is a Joomla extensions that integrates Cake (called Jake
> > I
> > >>> believe) -- it may work for mambo, or there may be a similar extension
> > >>> for Mambo -- or perhaps you could port it.
>
> > >>> chanh.ong wrote:
>
> >  I was able to bootstrap cake into Mambo and able to call global
> >  functions and cake constant but not able to figure out how to call
> >  helpers, etc, any suggestion?
>
> >  I am not using the normal cake controller, etc.  I create an include
> >  file that bootstrap cake into Mambo as a library and hoping to use
> >  cake framework inside Mambo.
>
> >  Any bootstrap advise is appreciated.
>
> >  Thanks
>
> > >>> --
> > >>> Joshua Benner
> > >>>http://bennerweb.com
>
> > --
> > Joshua Benner
> >http://bennerweb.com


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How to make call to helpers classes and others

2007-06-11 Thread Jonathan Langevin
My understanding is the same as Joshua. It's a bridge that allows Joomla
access to the Cake applications/api, and Cake access to the Joomla
applications/api.
To completely replace the Joomla api, that would seem to be pretty complex,
as you would have to update existing Joomla components/modules to work with
Cake.

Maybe look at Jake's source code, to see how they are implementing Cake into
Joomla, that might help you figure out what you would need to change for
your own undertaking

On 6/11/07, Joshua Benner <[EMAIL PROTECTED]> wrote:
>
>
> Yes, they are bridges, but they still have full access to the Joomla and
> Drake APIs (AFAIK).
>
> chanh.ong wrote:
> > Thanks for the tips but I am not sure that is how I want.  I just want
> > to use cake as a framework not a bridge to run cake app in Mambo.  I
> > think that is how Jake and Drake is doing.  A bridge to run cake app
> > in Joomla and Drupal.
> >
> > I just want to be able to use cake api and classes at this point.
> >
> > On Jun 11, 8:17 am, "Jonathan Langevin" <[EMAIL PROTECTED]> wrote:
> >
> >>
> http://cakebaker.42dh.com/2007/01/29/joomla-and-cakephp/http://dev.sypad.com/projects/jake/<<
>  official home of Jake?
> >>
> >> On 6/11/07, Joshua Benner <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >>
> >>
> >>> I know there is a Joomla extensions that integrates Cake (called Jake
> I
> >>> believe) -- it may work for mambo, or there may be a similar extension
> >>> for Mambo -- or perhaps you could port it.
> >>>
> >>> chanh.ong wrote:
> >>>
>  I was able to bootstrap cake into Mambo and able to call global
>  functions and cake constant but not able to figure out how to call
>  helpers, etc, any suggestion?
> 
>  I am not using the normal cake controller, etc.  I create an include
>  file that bootstrap cake into Mambo as a library and hoping to use
>  cake framework inside Mambo.
> 
>  Any bootstrap advise is appreciated.
> 
>  Thanks
> 
> >>> --
> >>> Joshua Benner
> >>> http://bennerweb.com
> >>>
> >
> >
> > >
> >
>
>
> --
> Joshua Benner
> http://bennerweb.com
>
>
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How to make call to helpers classes and others

2007-06-11 Thread Joshua Benner

Yes, they are bridges, but they still have full access to the Joomla and 
Drake APIs (AFAIK).

chanh.ong wrote:
> Thanks for the tips but I am not sure that is how I want.  I just want
> to use cake as a framework not a bridge to run cake app in Mambo.  I
> think that is how Jake and Drake is doing.  A bridge to run cake app
> in Joomla and Drupal.
>
> I just want to be able to use cake api and classes at this point.
>
> On Jun 11, 8:17 am, "Jonathan Langevin" <[EMAIL PROTECTED]> wrote:
>   
>> http://cakebaker.42dh.com/2007/01/29/joomla-and-cakephp/http://dev.sypad.com/projects/jake/
>>  << official home of Jake?
>>
>> On 6/11/07, Joshua Benner <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> 
>>> I know there is a Joomla extensions that integrates Cake (called Jake I
>>> believe) -- it may work for mambo, or there may be a similar extension
>>> for Mambo -- or perhaps you could port it.
>>>   
>>> chanh.ong wrote:
>>>   
 I was able to bootstrap cake into Mambo and able to call global
 functions and cake constant but not able to figure out how to call
 helpers, etc, any suggestion?
 
 I am not using the normal cake controller, etc.  I create an include
 file that bootstrap cake into Mambo as a library and hoping to use
 cake framework inside Mambo.
 
 Any bootstrap advise is appreciated.
 
 Thanks
 
>>> --
>>> Joshua Benner
>>> http://bennerweb.com
>>>   
>
>
> >
>   

 
-- 
Joshua Benner
http://bennerweb.com


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: i18n and sprintf

2007-06-11 Thread djiize

the 1st method is the correct one, because you .po file needn't need
to know all $name possibilities
then you can translate "Edit %s" to "Whatever %s" you want, and %s can
be tomatoes or potatoes or carrots or ...

On 11 juin, 18:20, Gilles Dubois <[EMAIL PROTECTED]> wrote:
> In CakePHP, in particular in the scaffolding, there are many lines of
> code with, for example, sprintf(__("Edit %s", true), $name)) who, in
> my opinion, do not function, while __(sprintf ("Edit %s", $name),
> true) gives the awaited result. What do you think about it?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Pass an ID to View

2007-06-11 Thread francky06l

You can the value in your controller before rendering the view  :
$this->data['Category']['parent_id'], using the input('Category/
parent_id) ..will then get the value you have set into the controller

On Jun 11, 6:50 pm, r557 <[EMAIL PROTECTED]> wrote:
> Really basic here solution here i'm having an issue with.
>
> CONTROLLER FUNCTION
>
> function admin_add() {
> if(empty($this->data)) {
> $this->render();
> } else {
> $this->cleanUpFields();
> if($this->Category->save($this->data)) {
> $this->Session->setFlash('The Category has 
> been saved');
> $this->redirect('/admin/categories/index');
> } else {
> $this->Session->setFlash('Please correct 
> errors below.');
> }
> }
> }
>
> VIEW
>
> New Category
>  method="post">
> hidden('Category/id')?>
> 
> labelTag('Category/active', 'Active');?>
> input('Category/active', array('size' => '60'));?>
> tagErrorMsg('Category/active', 'Please enter the
> Active.');?>
> 
> 
> labelTag('Category/name', 'Name');?>
> input('Category/name', array('size' => '60'));?>
> tagErrorMsg('Category/name', 'Please enter the
> Name.');?>
> 
> 
> labelTag( 'Category/description', 'Description' );?
>
> textarea('Category/description', array('cols' =>
> '60', 'rows' => '10'));?>
> tagErrorMsg('Category/description', 'Please enter
> the Description.');?>
> 
> 
> labelTag('Category/img', 'Img');?>
> input('Category/img', array('size' => '60'));?>
> tagErrorMsg('Category/img', 'Please enter the
> Img.');?>
> 
> 
> labelTag('Category/parentid', 'Parentid');?>
> input('Category/parentid', array('size' => '60'));?
>
> tagErrorMsg('Category/parentid', 'Please enter the
> Parentid.');?>
> 
> 
> labelTag('Category/sort_order', 'Sort Order');?>
> input('Category/sort_order', array('size' =>
> '60'));?>
> tagErrorMsg('Category/sort_order', 'Please enter
> the Sort Order.');?>
> 
> 
> submit('Add');?>
> 
> 
> 
> link('List Categories', '/admin/categories/
> index')?>
> 
>
> I have my model set up in a way that allows parentid's (nested
> categories).  I have the link set up when i click to add a
> subcategory, the id is being passed, but i'm not sure how to populate
> properly in the value area of Category/parentid.  I tried using a
> 'value' => '. $data['category']['id']' but that did not work.
>
> how do i get that add function to pass that id to the view?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Pass an ID to View

2007-06-11 Thread r557

Really basic here solution here i'm having an issue with.

CONTROLLER FUNCTION

function admin_add() {
if(empty($this->data)) {
$this->render();
} else {
$this->cleanUpFields();
if($this->Category->save($this->data)) {
$this->Session->setFlash('The Category has been 
saved');
$this->redirect('/admin/categories/index');
} else {
$this->Session->setFlash('Please correct errors 
below.');
}
}
}

VIEW

New Category

hidden('Category/id')?>

labelTag('Category/active', 'Active');?>
input('Category/active', array('size' => '60'));?>
tagErrorMsg('Category/active', 'Please enter the
Active.');?>


labelTag('Category/name', 'Name');?>
input('Category/name', array('size' => '60'));?>
tagErrorMsg('Category/name', 'Please enter the
Name.');?>


labelTag( 'Category/description', 'Description' );?
>
textarea('Category/description', array('cols' =>
'60', 'rows' => '10'));?>
tagErrorMsg('Category/description', 'Please enter
the Description.');?>


labelTag('Category/img', 'Img');?>
input('Category/img', array('size' => '60'));?>
tagErrorMsg('Category/img', 'Please enter the
Img.');?>


labelTag('Category/parentid', 'Parentid');?>
input('Category/parentid', array('size' => '60'));?
>
tagErrorMsg('Category/parentid', 'Please enter the
Parentid.');?>


labelTag('Category/sort_order', 'Sort Order');?>
input('Category/sort_order', array('size' =>
'60'));?>
tagErrorMsg('Category/sort_order', 'Please enter
the Sort Order.');?>


submit('Add');?>



link('List Categories', '/admin/categories/
index')?>


I have my model set up in a way that allows parentid's (nested
categories).  I have the link set up when i click to add a
subcategory, the id is being passed, but i'm not sure how to populate
properly in the value area of Category/parentid.  I tried using a
'value' => '. $data['category']['id']' but that did not work.

how do i get that add function to pass that id to the view?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



i18n and sprintf

2007-06-11 Thread Gilles Dubois

In CakePHP, in particular in the scaffolding, there are many lines of
code with, for example, sprintf(__("Edit %s", true), $name)) who, in
my opinion, do not function, while __(sprintf ("Edit %s", $name),
true) gives the awaited result. What do you think about it?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Which Cake function should I use to query my data

2007-06-11 Thread Chris Hartjes

On 6/11/07, bbuchs <[EMAIL PROTECTED]> wrote:
> Thanks for being constructive, Chris.

What, you don't see my point?  He has the results set in an array, all
he has to do is iterate through it.  Yes, Felix's Set article is a
good one too, but my point still stands:  this is not a CakePHP issue,
this is an "understand how to iterate through an array" issue.

Is the section in the manual on models not covering how to do this?
It looks like it does to me.  Alexandre, have you read this section of
the manual:

http://manual.cakephp.org/chapter/models

Specifically the section on associations, which shows some pretty
clear examples of what an associated result set looks like.  Armed
with that, you should be able to figure it out on your own.

-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Which Cake function should I use to query my data

2007-06-11 Thread bbuchs

Try using the Set:Extract method. Felix did a good short tutorial on
it:

http://www.thinkingphp.org/2007/02/24/cake-12s-set-class-eats-arrays-for-breakfast/

Thanks for being constructive, Chris.




On Jun 11, 10:22 am, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 6/11/07, Alexandre Gonçalves Jacarandá <[EMAIL PROTECTED]> wrote:
>
> > But I don't know how to get all fspaths arrays.
> > If you can't help me, please point me to some docs.
>
> > Thank you, Alexandre.
>
> Lord thundering jesus, don't you know how to iterate through an
> array?!?  This is basic PHP stuff I would think.
>
> --
> Chris Hartjes
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How to make call to helpers classes and others

2007-06-11 Thread chanh.ong

Thanks for the tips but I am not sure that is how I want.  I just want
to use cake as a framework not a bridge to run cake app in Mambo.  I
think that is how Jake and Drake is doing.  A bridge to run cake app
in Joomla and Drupal.

I just want to be able to use cake api and classes at this point.

On Jun 11, 8:17 am, "Jonathan Langevin" <[EMAIL PROTECTED]> wrote:
> http://cakebaker.42dh.com/2007/01/29/joomla-and-cakephp/http://dev.sypad.com/projects/jake/
>  << official home of Jake?
>
> On 6/11/07, Joshua Benner <[EMAIL PROTECTED]> wrote:
>
>
>
> > I know there is a Joomla extensions that integrates Cake (called Jake I
> > believe) -- it may work for mambo, or there may be a similar extension
> > for Mambo -- or perhaps you could port it.
>
> > chanh.ong wrote:
> > > I was able to bootstrap cake into Mambo and able to call global
> > > functions and cake constant but not able to figure out how to call
> > > helpers, etc, any suggestion?
>
> > > I am not using the normal cake controller, etc.  I create an include
> > > file that bootstrap cake into Mambo as a library and hoping to use
> > > cake framework inside Mambo.
>
> > > Any bootstrap advise is appreciated.
>
> > > Thanks
>
> > --
> > Joshua Benner
> >http://bennerweb.com


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Re autocomplete using ajax

2007-06-11 Thread Joshua McFarren

Get Started With AJAX in CakePHP:
http://ahsanity.wordpress.com/2007/02/23/get-started-with-ajax-in-cakephp/


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Enabling Javascript helper in 1.1.x

2007-06-11 Thread greys

Hi everyone!

I'm struggling to get a Javascript helper working in my very first
cakePHP app, and since I've tried all the ideas I had myself, I turn
to you all for help.

What I want: to include a number of custom JavaScript files from every
view of one of my classes.

What I've done so far:
1) Added this line to my controller:
var $helpers = array('Html', 'Form', 'Javascript', 'Ajax');
2) Put the scripts into app/webroot/js directory
3) Created views/layouts/default.html from the default cake template,
and changed it to include this right after the CSS:
link('tiny_mce/tiny_mce.js'); ?>

What I get: my view page doesn't open, and instead I can see this
error in my JS console (I'll call it ERROR1):
Notice: Undefined variable: javascript in /var/www/
ebooks.greyspk.com/app/views/layouts/default.thtml on line 34

If I then go and create from template the app/app_controller.php file
to also include the helpers line:
var $helpers = array('Html', 'Form', 'Javascript', 'Ajax');
then the above ERROR1 disappears, but I get the following:

Missing controller
You are seeing this error because controller
JsController could not be found.
Notice: If you want to
customize this error message, create app/views/errors/
missing_controller.thtml.
Fatal: Create the class below
in file : app/controllers/js_controller.php

In fact, when I try opening the http://MYWEBSITE/js/tiny_mce/tiny_mce.js,
it shows me the same error instead of loading the tiny_mce.js
JavaScript.


Can someone please tell me how to fix this? What have I done wrong?

Thanks a lot in advance,
Gleb


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Which Cake function should I use to query my data

2007-06-11 Thread Chris Hartjes

On 6/11/07, Alexandre Gonçalves Jacarandá <[EMAIL PROTECTED]> wrote:
> But I don't know how to get all fspaths arrays.
> If you can't help me, please point me to some docs.
>
> Thank you, Alexandre.

Lord thundering jesus, don't you know how to iterate through an
array?!?  This is basic PHP stuff I would think.

-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How to make call to helpers classes and others

2007-06-11 Thread Jonathan Langevin
http://cakebaker.42dh.com/2007/01/29/joomla-and-cakephp/
http://dev.sypad.com/projects/jake/  << official home of Jake?

On 6/11/07, Joshua Benner <[EMAIL PROTECTED]> wrote:
>
>
> I know there is a Joomla extensions that integrates Cake (called Jake I
> believe) -- it may work for mambo, or there may be a similar extension
> for Mambo -- or perhaps you could port it.
>
> chanh.ong wrote:
> > I was able to bootstrap cake into Mambo and able to call global
> > functions and cake constant but not able to figure out how to call
> > helpers, etc, any suggestion?
> >
> > I am not using the normal cake controller, etc.  I create an include
> > file that bootstrap cake into Mambo as a library and hoping to use
> > cake framework inside Mambo.
> >
> > Any bootstrap advise is appreciated.
> >
> > Thanks
> >
> >
> > >
> >
>
>
> --
> Joshua Benner
> http://bennerweb.com
>
>
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Which Cake function should I use to query my data

2007-06-11 Thread Alexandre Gonçalves Jacarandá
But I don't know how to get all fspaths arrays.
If you can't help me, please point me to some docs.

Thank you, Alexandre.

2007/6/10, Pablo Viojo <[EMAIL PROTECTED]>:
>
> And that's what you're getting, no more data than you need.
>
>
> --
> Pablo Viojo
> [EMAIL PROTECTED]
> http://pviojo.net
>
> On 6/10/07, Alexandre Gonçalves Jacaranda <[EMAIL PROTECTED]> wrote:
> >
> > Thanks for your reply, but my problem is more complex:
> >  $this->set('signs' , $this->Sign->findAll( "Sign.movie_presentation_id= 
> > '$id
> > '", 'File.fspath'," Sign.time ASC",null ,null,1));
> >
> > my return is:
> >
> > Array ( [0] => Array ( [File] => Array ( [fspath] => img/jogo_43.jpeg )
> > ) [1] => Array ( [File] => Array ( [fspath] => img/jogo_49(1).jpeg ) ) [2]
> > => Array ( [File] => Array ( [fspath] => img/Slide22.GIF ) ) )
> >
> > I need to get only my fspath value.
> >
> > How can I do this ?
> >
> >
> > Em 10/06/2007, às 12:06, alan escreveu:
> >
> >
> >  > /**
> > * how to find your stuff...
> > */
> > $stuff = $this->Model->findAll($conditions,$fields,' Model.field DESC',
> > $limit,$page,$recursive);
> >
> > echo '';
> > print_r($stuff);
> > echo '';
> > exit;
> >
> > ?>
> >
> > if you don't see all you want to see... get friendly with the cake
> > associations and update your models.
> >
> > thanks,
> > -alan-
> >
> > On Jun 9, 11:02 am, Alexandre Gonçalves Jacaranda < [EMAIL PROTECTED]>
> > wrote:
> >
> > Sorry, I forgot to tell my associate model:
> >
> > User: hasmany Presentation;
> > Presentation: belongsto User, belongsto Type, hasone Movie;
> > File : hasmany Movie , hasmany Sign;
> > Type: hasmany Presentation;
> > Movie: belongsto File, belongsto Presentation, hasmany Sign, hasmany
> > Text;
> > Sign: belongsto File, belongsto Movie;
> > Text: belongsto Movie
> >
> > My associations is like
> >
> > File
> > / \
> > / \
> > User -> Presentation -> Movie -> Sign
> > / \
> > Type <-- --> Text
> >
> > Thanks for answer. I'm asking because I only can get what I need
> > doing an direct select on my database. I want to display a mini-
> > slideshow when user load an movie, changing
> > sign( gif or jpeg file) while seeing the movie.
> >
> > Em 09/06/2007, às 05:33, Dr. Tarique Sani escreveu:
> >
> >
> >
> >  On 6/9/07, Alexandre Gonçalves Jacaranda <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hello, everybody!!
> >
> >
> > I've a database model like this :
> >
> >
> >  files ( id, path, name);
> > signs ( id, file_id, time)
> >
> >
> >  Read uphttp://manual.cakephp.org/chapter/models- pay attention to
> > the associations section
> >
> >
> > Tarique
> >
> >
> > --
> > =
> > Cheesecake-Photoblog:http://cheesecake-photoblog.org
> > PHP for E-Biz:http://sanisoft.com
> > =
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: When to upgrade to 1.2 from 1.1?

2007-06-11 Thread Jonathan Langevin
thx for the feedback every1, i'll upgrade to 1.2 :-)
luckily i've been using SVN for my own code, so i can rollback if it's too
drastic :-D

On 6/11/07, Dr. Tarique Sani <[EMAIL PROTECTED]> wrote:
>
>
> On 6/11/07, intel352 <[EMAIL PROTECTED]> wrote:
> >
> > When would you recommend upgrading to 1.2? I've always been about
> > "bleeding edge" software, but since 1.2 is still in alpha status, it
> > wouldn't suggest it's very stable quite yet, especially with the
> > possibility of major code changes before it hits final.
> >
> > Any thoughts?
> >
>
> 1.2 already has a lot of awesome features and most it is working just
> fine right now. Give in to the temptation.
>
> So I would say if it works for you right now you need not upgrade to a
> newer 1.2 in the eventuality that devs go totally bonkers and make it
> too difficult to upgrade...
>
> Oh wait a min! some of the devs are already bonkers to spend so much
> time writing all that code
>
> 
>
> Tarique
>
> --
> =
> Cheesecake-Photoblog: http://cheesecake-photoblog.org
> PHP for E-Biz: http://sanisoft.com
> =
>
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How to make call to helpers classes and others

2007-06-11 Thread Joshua Benner

I know there is a Joomla extensions that integrates Cake (called Jake I 
believe) -- it may work for mambo, or there may be a similar extension 
for Mambo -- or perhaps you could port it.

chanh.ong wrote:
> I was able to bootstrap cake into Mambo and able to call global
> functions and cake constant but not able to figure out how to call
> helpers, etc, any suggestion?
>
> I am not using the normal cake controller, etc.  I create an include
> file that bootstrap cake into Mambo as a library and hoping to use
> cake framework inside Mambo.
>
> Any bootstrap advise is appreciated.
>
> Thanks
>
>
> >
>   

 
-- 
Joshua Benner
http://bennerweb.com


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



How to make call to helpers classes and others

2007-06-11 Thread chanh.ong

I was able to bootstrap cake into Mambo and able to call global
functions and cake constant but not able to figure out how to call
helpers, etc, any suggestion?

I am not using the normal cake controller, etc.  I create an include
file that bootstrap cake into Mambo as a library and hoping to use
cake framework inside Mambo.

Any bootstrap advise is appreciated.

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?hl=en
-~--~~~~--~~--~--~---



Re: When to upgrade to 1.2 from 1.1?

2007-06-11 Thread Dr. Tarique Sani

On 6/11/07, intel352 <[EMAIL PROTECTED]> wrote:
>
> When would you recommend upgrading to 1.2? I've always been about
> "bleeding edge" software, but since 1.2 is still in alpha status, it
> wouldn't suggest it's very stable quite yet, especially with the
> possibility of major code changes before it hits final.
>
> Any thoughts?
>

1.2 already has a lot of awesome features and most it is working just
fine right now. Give in to the temptation.

So I would say if it works for you right now you need not upgrade to a
newer 1.2 in the eventuality that devs go totally bonkers and make it
too difficult to upgrade...

Oh wait a min! some of the devs are already bonkers to spend so much
time writing all that code



Tarique

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: When to upgrade to 1.2 from 1.1?

2007-06-11 Thread Joshua Benner

If you're porting applications from 1.1 to 1.2, be prepared to rewrite a 
little code, especially in views. It's not too bad, but it's worth 
mentioning that a lot of HtmlHelper stuff has moved to FormHelper (where 
appropriate).

intel352 wrote:
> When would you recommend upgrading to 1.2? I've always been about
> "bleeding edge" software, but since 1.2 is still in alpha status, it
> wouldn't suggest it's very stable quite yet, especially with the
> possibility of major code changes before it hits final.
>
> Any thoughts?
>
>
> >
>   

 
-- 
Joshua Benner
http://bennerweb.com


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: When to upgrade to 1.2 from 1.1?

2007-06-11 Thread Chris Hartjes

On 6/11/07, intel352 <[EMAIL PROTECTED]> wrote:
>
> When would you recommend upgrading to 1.2? I've always been about
> "bleeding edge" software, but since 1.2 is still in alpha status, it
> wouldn't suggest it's very stable quite yet, especially with the
> possibility of major code changes before it hits final.
>
> Any thoughts?
>

No time like now to upgrade.  Don't be fooled by the alpha status:
it's very solid.  The only reason it's labeled as Alpha as there are
some API's that might change between now and when 1.2 goes final.
Show some courage and use it!

-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



When to upgrade to 1.2 from 1.1?

2007-06-11 Thread intel352

When would you recommend upgrading to 1.2? I've always been about
"bleeding edge" software, but since 1.2 is still in alpha status, it
wouldn't suggest it's very stable quite yet, especially with the
possibility of major code changes before it hits final.

Any thoughts?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: model validation and error messages in Cake 1.2

2007-06-11 Thread Jonathan Langevin
Link to that article:
http://bakery.cakephp.org/articles/view/multiple-rules-of-validation-per-field-in-cakephp-1-2

On 6/11/07, Dr. Tarique Sani <[EMAIL PROTECTED]> wrote:
>
>
> On 6/11/07, Ketan Patel <[EMAIL PROTECTED]> wrote:
> >
> > Check out simple example at
> > http://bin.cakephp.org/view/610862726
> >
> > You are mixing and matching two different things. Use this simple
> > example as starting point .
> >
>
> Perhaps the technically correct way is *not to have the error messages
> in model* - there is an article in Bakery by Mariano on how to do it
> with 1.2
>
> Tarique
>
> --
> =
> Cheesecake-Photoblog: http://cheesecake-photoblog.org
> PHP for E-Biz: http://sanisoft.com
> =
>
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: model validation and error messages in Cake 1.2

2007-06-11 Thread Dr. Tarique Sani

On 6/11/07, Ketan Patel <[EMAIL PROTECTED]> wrote:
>
> Check out simple example at
> http://bin.cakephp.org/view/610862726
>
> You are mixing and matching two different things. Use this simple
> example as starting point .
>

Perhaps the technically correct way is *not to have the error messages
in model* - there is an article in Bakery by Mariano on how to do it
with 1.2

Tarique

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Re autocomplete using ajax

2007-06-11 Thread Chris Hartjes

On 6/11/07, jenson <[EMAIL PROTECTED]> wrote:
>
> Hi friends,
>I need autocomplete using ajax ,when i type a the user belongs to the
> particular alphabets need to display below .so i need full coding sample how
> to use with explanation,pl my friends.
> thanks,
> jenson

I hear that google has some nice tutorials available via it's "search"
interface.

-- 
Chris Hartjes

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re autocomplete using ajax

2007-06-11 Thread jenson

Hi friends,
   I need autocomplete using ajax ,when i type a the user belongs to the
particular alphabets need to display below .so i need full coding sample how
to use with explanation,pl my friends.
thanks,
jenson


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Cake stripping HTML when pulling from database

2007-06-11 Thread Jonathan Langevin
It's pretty simple right now. Upon save, the html will be HTMLTidy'd, and a
stripped copy will be saved to the database alongside html copy.
There's not much else there. In the view, I have TinyMCE enabled currently,
but I've tested with TinyMCE removed, still no HTML showing in the returned
content (both preview and body should have complete html returned)


Controller:

function edit($id = null)
{
if (empty($this->data))
{
$this->Content->id = $id;
$this->data = $this->Content->read();
}else{
if ($this->Content->validates($this->data))
{
$tidy_installed = phpversion('tidy');
if($tidy_installed &&
version_compare($tidy_installed,'2.0','>=')
&& TIDY_OUTPUT) {
$tidy = new tidy();
$tidy_config = array('indent' => true,
'indent-spaces' => 2,
'output-xhtml' => true,
'show-body-only' => true,
'clean' => true,
'wrap' => 200,
'drop-proprietary-attributes' => true,
'logical-emphasis' => true
);
$this->data['Content']['body'] =
$tidy->repairString($this->data['Content']['body'], $tidy_config, 'utf8');
}
$this->data['Content']['text_body'] =
strip_tags($this->data['Content']['body']);
$this->Content->save($this->data);
$this->redirect('/content/contentList');
} else {
$this->validateErrors($this->Content);
}
}
}


View:

renderElement('tinymce',array('preset' => 'basic')); ?>
formTag('/content/create' . $html->tagValue('Content/id'))
?>
Please fill out the form below to create an article.


Article Title:
inputTag('Content/title', array('size' => '60',
'maxlength' => '255')) ?>
forField('Content/title') ?>



Article Preview:
textarea('Content/preview', array('cols'=>'30',
'rows'=>'10')); ?>
forField('Content/preview') ?>



Article Body:
textarea('Content/body', array('cols'=>'60',
'rows'=>'20')); ?>
forField('Content/body') ?>


hidden('Create/id')?>
hidden('create/submitter_id',
$this->controller->Session->read('User.id')) */ ?>
submitTag('create') ?>


On 6/11/07, Ketan Patel <[EMAIL PROTECTED]> wrote:
>
>
> if you could post some code then perhaps could help better.
>
>
> intel352 wrote:
> > I'm building my first Cake application. I've started a controller that
> > is used for creating/editing Content articles, and it saves to the
> > database with a full-html 'teaser', full-html article and a stripped-
> > html article (for cleaner searching), which works perfect.
> >
> > When I am attempting to edit, though, the copy is returned from the
> > database with all html already stripped, which is *not* what I
> > need :-)
> >
> > Any ideas on what's going wrong?
>
>
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Cake stripping HTML when pulling from database

2007-06-11 Thread Ketan Patel

if you could post some code then perhaps could help better.


intel352 wrote:
> I'm building my first Cake application. I've started a controller that
> is used for creating/editing Content articles, and it saves to the
> database with a full-html 'teaser', full-html article and a stripped-
> html article (for cleaner searching), which works perfect.
>
> When I am attempting to edit, though, the copy is returned from the
> database with all html already stripped, which is *not* what I
> need :-)
>
> Any ideas on what's going wrong?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: model validation and error messages in Cake 1.2

2007-06-11 Thread Ketan Patel

Check out simple example at
http://bin.cakephp.org/view/610862726

You are mixing and matching two different things. Use this simple
example as starting point .

Ketan :-)

ne0d1n wrote:
> In new $validate array there is 'message' key obviously for error
> messages.
> (see example in http://bin.cakephp.org/view/152660210)
>
> Should I use tagErrorMsg to display it?
> Could you give any working example to display error validation message
> specified in $validate?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Cake stripping HTML when pulling from database

2007-06-11 Thread intel352

I'm building my first Cake application. I've started a controller that
is used for creating/editing Content articles, and it saves to the
database with a full-html 'teaser', full-html article and a stripped-
html article (for cleaner searching), which works perfect.

When I am attempting to edit, though, the copy is returned from the
database with all html already stripped, which is *not* what I
need :-)

Any ideas on what's going wrong?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Things to update in blog_tutorial (using 1.2 )

2007-06-11 Thread Joshua Benner

For submit:

Include the FormHelper in your controller, then use:

$form->submit()  (see 1.2 api at http://api.cakephp.org/1.2 )

personally, I use (from the controller): $this->flash('message', $url)

Again, refer to api for more details.

Martin wrote:
> Hello bakers,
> I 've successfully created my first blog with cake using the example
> at:
> http://manual.cakephp.org/appendix/blog_tutorial
>
> Two things I wanted to comment for this example:
>
> 1- /app/views/posts/add.thtml
>
> submit('Save') ?>
> IS DEPRECATED.
>
> What is the other method we need to use to get the SUBMIT buttons
> working in 1.2 ?
>
>
> 2- /app/views/posts/add.thtml
>
> tagErrorMsg('Post/body', 'Body is required.') ?>
>
> Error messages are not getting printed. I suppose that this is because
> this $html methods are deprecated (Same as point 1)
>
> But is working so far. Love it.
>
> If there are more Cake examples around there, and I would love to see
> AJAX thingies / REST apps / APIs and such, please post a reply or
> point me to some URL's.
>
> MARTIN
>
>
> >
>   

 
-- 
Joshua Benner
http://bennerweb.com


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Autocomplete using ajax.

2007-06-11 Thread Nishu

Hi,

I'll help you out regarding this issue.

Please let me know ,how can i help you.

Thank you.

On Jun 11, 4:27 pm, "jenson" <[EMAIL PROTECTED]> wrote:
> Hi friends,
>  In my project i nedd to include autocomplete using ajax kindly help
> me to go througth.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Things to update in blog_tutorial (using 1.2 )

2007-06-11 Thread Martin

Hello bakers,
I 've successfully created my first blog with cake using the example
at:
http://manual.cakephp.org/appendix/blog_tutorial

Two things I wanted to comment for this example:

1- /app/views/posts/add.thtml

submit('Save') ?>
IS DEPRECATED.

What is the other method we need to use to get the SUBMIT buttons
working in 1.2 ?


2- /app/views/posts/add.thtml

tagErrorMsg('Post/body', 'Body is required.') ?>

Error messages are not getting printed. I suppose that this is because
this $html methods are deprecated (Same as point 1)

But is working so far. Love it.

If there are more Cake examples around there, and I would love to see
AJAX thingies / REST apps / APIs and such, please post a reply or
point me to some URL's.

MARTIN


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Autocomplete using ajax.

2007-06-11 Thread jenson


Hi friends,
 In my project i nedd to include autocomplete using ajax kindly help
me to go througth.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: i18n translation in db tables - how to do this like Symfony?

2007-06-11 Thread IoZ

On Jun 2, 5:41 am, jitka <[EMAIL PROTECTED]> wrote:
> Well, it seems like deadline of your project doesn't allow wait for
> cake's solution for reading records with fallback to default locale ;)

Hi jitka,
Is there an easy way to add/update elements on multiple languages at
the same time through a form?

Thank you


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: hi, is there any way to post data from 1 form to multiple tables?

2007-06-11 Thread Dr. Tarique Sani

On 6/11/07, AD7six <[EMAIL PROTECTED]> wrote:
>
> Your (required) length of answer/ length of question score is dropping
> chaps :D
>

In which case your score is the lowest till now - but I will lower mine ;)

@ Abhinav, just do $this->model->save($this->data) and
$this->othermodel->save($this->data) and while you are at it read the
manual

T

=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: hi, is there any way to post data from 1 form to multiple tables?

2007-06-11 Thread AD7six



On Jun 11, 12:57 pm, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> On 6/11/07, Mariano Iglesias <[EMAIL PROTECTED]> wrote:
>
>
>
> > Or no... depends... :)
>
> Well I can argue about the depends part ;)

Your (required) length of answer/ length of question score is dropping
chaps :D

AD


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: hi, is there any way to post data from 1 form to multiple tables?

2007-06-11 Thread Dr. Tarique Sani

On 6/11/07, Mariano Iglesias <[EMAIL PROTECTED]> wrote:
>
> Or no... depends... :)
>

Well I can argue about the depends part ;)

T

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



RE: hi, is there any way to post data from 1 form to multiple tables?

2007-06-11 Thread Mariano Iglesias

Or no... depends... :)

-MI

---

Remember, smart coders answer ten questions for every question they ask. 
So be smart, be cool, and share your knowledge. 

BAKE ON!

blog: http://www.MarianoIglesias.com.ar

-Mensaje original-
De: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre
de Dr. Tarique Sani
Enviado el: Lunes, 11 de Junio de 2007 07:37 a.m.
Para: cake-php@googlegroups.com
Asunto: Re: hi, is there any way to post data from 1 form to multiple
tables?

On 6/11/07, AbhinavZone <[EMAIL PROTECTED]> wrote:
>
> hi, is there any way to post data from 1 form to multiple tables?
>
yes


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: hi, is there any way to post data from 1 form to multiple tables?

2007-06-11 Thread Dr. Tarique Sani

On 6/11/07, AbhinavZone <[EMAIL PROTECTED]> wrote:
>
> hi, is there any way to post data from 1 form to multiple tables?
>
yes

T

-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Best practice - multipage Form

2007-06-11 Thread jitka (poLK)

It is matter of personal taste, off course. With FormWizardComponent
all multi-page-form-requests are calling only one public method of
controller.

Also 'ways' in FormWizard are quite usable - for example:
// ways used in InstallerController
array(
'install' => array('
_installStart',
'_checkFSPermissions',
'_checkOrSetDbConfig',
'_checkOrMakeDbStructure',
'_installApp',
'_recap'
),
'upgrade' => array(
'_upgradeStart'
'_fetchUpgradePackage',
'_upgradeApp',
'_recap'
)
)

All of above functionality is handled by _only_ public method:
InstallerController::admin_index().
-- if app is not installed yet, controller switches way to 'install'
-- if app is installed and not current, controller uses way 'upgrade'
-- if app is installed and current, method admin_index() just renders
informational view

Sure, with FormWizard every 'step' requires implement one view and 2
methods, but you don't have to care about session at all, you can use
different models in different steps of your wizard (and obtain
collected data any time you need them), you can easily switch 'ways',
clear steps (reset wizard)... ;)


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



hi, is there any way to post data from 1 form to multiple tables?

2007-06-11 Thread AbhinavZone

hi, is there any way to post data from 1 form to multiple tables?


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Trouble in mutil-apps in cake

2007-06-11 Thread grayblur

 thx very much for your kindly response.! :)...

to be honest..., I did copy the app and translate them to english...
:( I know is a bad practice to Repeat myself,  perhaps it's much slow
to do in this way..

but, considering the time limitation , the simply requirement and the
scale of my project ...I broke the rule..

In my next project I will keep it in mind that ,everything sould be
DRY:)
thx again!

yours, grayblur

On 6月11日, 下午3时39分, AD7six <[EMAIL PROTECTED]> wrote:
> On Jun 10, 11:01 am, grayblur <[EMAIL PROTECTED]> wrote:

> 1) DON'T create 2 identical app folders create ONE with 2 languages
> 2) DO create 2 app folders, but do so with a standard install and
> without trying to fight how cake works (the url [/ or /app/] and /
> appe/ will give you what you are expecting out of the box)
>
> For 2 app folders to make sense to you, you either don't have any
> controller/model code (?) your business logic is vastly different
> depending on the language of the user (?) or you want to repeat
> yourself (?). Which is it?
>
>
> hth,
>
> AD


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Panels (ie like in ASP.net)?

2007-06-11 Thread AD7six



On Jun 10, 4:42 am, gary <[EMAIL PROTECTED]> wrote:
> Hi,
> I was wondering if there is a way to make use of a panel type of idea
> using cake php? is there anything predefined that accomodates for such
> a technique? otherwise is there something else that could assist me in
> this?
>
> btw my main use for such a concept would be to span forms over a few
> steps'
>
> thanks

http://groups.google.com/group/cake-php/search?group=cake-php&q=multi+page+form
http://groups.google.com/group/cake-php/search?group=cake-php&q=form+wizard

hth,

AD
PS a simple example for anyone wondering what an ASP panel is:
http://www.learnasp.com/freebook/learn/panels.aspx


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Router::parseExtensions();

2007-06-11 Thread jitka (poLK)

I just found out that doc comments on mentioned method are on 15 lines
(and implementation of this method is on 7 lines) of source code.

Many thanks to cake developers for writing _important_ things to doc
comments, even for 7-line methods.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Router::parseExtensions();

2007-06-11 Thread jitka (poLK)

Calling Router::parseExtensions() without arguments allows
_all_extensions.

Try something like Router::parseExtensions('html', 'rss', 'xml');


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Best practice - multipage Form

2007-06-11 Thread Marcus T. Jaschen

wewo wrote:
> Dear all,
> 
> What would be your implementation recommendation (controller side) for
> setting up a tabbed multipage form (step1, step2, step {n}), where in
> every step different models and controllers are influenced and the
> different steps maybe influce other steps (available or not, a.s.o)?

My way (I'm using it in a subscription form which spreads across 4 pages):

SubscriptionController with four actions: step1(), step2(), step3(),
step4() (name them as you want).

Data is shared across the four steps within the Session data. Think
about the first step for a subscription, selecting the subscription
model (1 month, 12 months and so on). In the step1() method I save the
data to the session together with the information that step 1 was
completed (step 2 will redirect to step 1 if step 1 wasn't completed).

public function step1()
{
  (...)

  if ($this->data['Subscription']['subscription_type'] == 'yearly')
  {
$this->Session->write('Subscription.step1_done', true);
$this->Session->write('Subscription.subscription_type', '12months');
  }

  $this->redirect(array('controller' => 'subscription', 'action' =>
'step2'));
}

Same logic applies to step2(), step3() and step4(). Saving data to
database is done in step4 when all required steps are done.

Marcus


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: recursive INSERT

2007-06-11 Thread Grant Cox

Well, I'm not sure what you mean by "recursive"...  But yes, you can
have one form that saves to two models.  On the form side just add all
the fields that you would normally have on two separate forms.  The
one controller action that receives the form just needs to have two
save calls, one for each model type.  The only tricky thing is that
your ModelX needs to be saved first so your ModelY can have the
correct model_x_id set.  And then if the ModelY save fails due to
invalid parameters - should the ModelX save be rolled back?  In which
case it might be worth looking at database transactions (there was an
article on the Bakery).


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: dynamic validation - best practice

2007-06-11 Thread Grant Cox

Well, the short answer is just to use your beforeValidate callback,
and check whatever fields are appropriate.

The long answer...  the different validation is based upon the logged
in user, which is authentication and not really related to the model
itself.  So you don't want to be reading session values or anything
else in the beforeValidate - it's just a bit messy.  The only way I've
done this is to have various flag variables on your model, and set
these in the appropriate controller actions to determine what happens
in the callback.  ie:

class YourModel extends AppModel{
  var $full_validate=true;

  function beforeValidate(){
if ( $this->full_validate ){
  // validate the extra fields
}
  }
}

and in your controller just set the full_validate variable before your
attempted save.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Problem with database connections

2007-06-11 Thread Grant Cox

Search this group and you'll see it's come up a few times.  Apparently
it's a bug in the php mysql connector, where having two different
database connections with the same authentication doesn't work (it
confuses which connection to use).  If you use a different username/
password for each database you'll have no problems.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



dynamic validation - best practice

2007-06-11 Thread jyrgen

hi again,

how can i set up different validation rules (for a model) for
different user types ?

for example the regular web user *must* enter his phone number when
registering,
while the backend admin may create records that just contain the last
name.

thanks a lot.

jyrgen


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Select option from lookup table

2007-06-11 Thread Grant Cox

The scaffolding should automatically create this for you if you have
the associations set up correctly. What form element is it currently
showing for the "province_id" field in your /users/edit action?
Otherwise you can do it manually by having
$province_options = $this->User->Province->generateList();
in your users controller action, and use this $province_options as the
options for your select list.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



onError - the query which produced the error ?

2007-06-11 Thread Stefan

Hi,


Can I get the query in production mode without using logs when a SQL
error occurs ?

I made an onError() in AppModel which is sending an email with the
last SQL error, but without the query some errors are difficult to
trace. It seems that there is a way by using the query log but I don't
want to log all the queries just because of some errors.


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Trouble in mutil-apps in cake

2007-06-11 Thread AD7six



On Jun 10, 11:01 am, grayblur <[EMAIL PROTECTED]> wrote:

> It makes me really upset...
>
> I prefer Symfony..:(`

Where did the idea to create an "english.php" and 2 applications just
to have 2 languages come from? Is that how things would work in
symfony? If that's considered optimal then go use symfony.

Alternatively try either of the following

1) DON'T create 2 identical app folders create ONE with 2 languages
2) DO create 2 app folders, but do so with a standard install and
without trying to fight how cake works (the url [/ or /app/] and /
appe/ will give you what you are expecting out of the box)

For 2 app folders to make sense to you, you either don't have any
controller/model code (?) your business logic is vastly different
depending on the language of the user (?) or you want to repeat
yourself (?). Which is it?

See http://groups.google.com/group/cake-php/web/frequent-discussions
or search around regarding multiple language sites with cake for more
info.

hth,

AD


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Pagination PRG Problem

2007-06-11 Thread AD7six



On Jun 10, 6:12 pm, Joel <[EMAIL PROTECTED]> wrote:
> Hi all!
>
> I try to do a search over a pagination component I found here
> athttp://www.noswad.me.uk/Pagination/PRG(Andy Dawson's site).
>
> Source:http://cakeforge.org/frs/?group_id=152
>
> I try to use '1 step' search, a very simple form which will submit to
> itself, and if form data is present redirects to the appropriate url.
>
> This PRG(Post Redirect Get) search function works all fine but
> it doesn't search and fetch data from database
> when you input multibyte characters (such as Japanese and Chinese).

Multibyte characters are probably filtered out by the
Sanitize::paranoid method - comment it to test if that's the case, and
if so replace it with something else useful (the goal is to prevent
scripts, html, styles etc from appearing that you don't want).

hth,

AD


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Generating PDFs - piece of useful information for the group

2007-06-11 Thread ianh

Hi,

I would but the Bakery is not letting me login - I think this has
already been flagged elsewhere in the group. Ianh

On Jun 8, 8:34 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> Can you add that as a comment on the article and when I have a few minutes
> and make some more updates to the article I'll add it.
>
> Thanks
>Sam D


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---