On Wed, Dec 31, 2008 at 5:03 PM, Steven Wright wrote:
>
> Ok fair enough. So how does one use the $javascript->object() ?
>
> I want to pass an array to a javasrcipt variable.
>
For ajax actions, just echo a JSON object. There's no point in using
set() as that's only going to create a PHP variab
For simplicity's sake I would keep them in the one table, and
dynamically change the $validate array in my beforeValidate method of
the model to suit.
I've never used this but it may help you:
http://bakery.cakephp.org/articles/view/conditinalvalidation-behavior
Cheers,
Adam
On Dec 26 2008, 11:
If I use three tables(one for common fields, one for uncommon fields
of type A, another for uncommon fields of type B), I have no prob but
how to make model or controller or view? Problem is that from a single
interface, I have to insert or edit data two different tables? Do you
can give some idea
Hi all,
Apologies if this has been addressed before, but I've searched and
can't find a thing.
I have a register page, with a login element in the sidebar. The login
element is on every page in the sidebar. When I try register with
invalid data, the correct validation errors show for the register
Ok, I think I'm getting closer but its still not working. here is
what I have. In the view, what should go where 'Ethnicity' currently
is? and is the saveAll() supposed to work in this case?
tables:
CREATE TABLE users
(
id int NOT NULL AUTO_INCREMENT,
about_me varchar(255),
PRIMARY KEY (id)
)
I could of sworn I tried that and it didn't work, I must have changed
the foreign_key. Anyways that worked.
Yeah I was also thinking in my system... is that a user is top level
and he has many different parts. A user is not necessarily part of a
country, but I guess ill have to do it that way.
--
Ok fair enough. So how does one use the $javascript->object() ?
I want to pass an array to a javasrcipt variable.
Thanks.
-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of Bernardo Vieira
Sent: Wednesday, December 31, 2008 3:58 PM
To:
It's not matter of inheritance, the problem is that helpers aren't meant
to be used in controllers. The $helpers array only tells the dispatcher
which helpers to load when rendering the view. Try this:
controllers/ajaxtests_controller
function test() {
$this->set('myvar',$arr);
}
views/aja
Confused about inheritance here.
Here is the helpers var from Cake's controller file.
var $helpers = array('Html', 'Form', 'Javascript', 'Ajax');
AppController extends this so I think that the helpers should be
available there.
My controller AjaxtestsController extends Appcontroller and so they
On Wed, Dec 31, 2008 at 1:54 PM, mike wrote:
>
> thanks for the response. thats not quite what I want. Each user can
> have multiple ethnicities, so its a many to many relationship. In my
> models, I have User hadMany UsersEthnicities, Ethnicity hasMany
> UsersEthnicity and UsersEthnicity belo
thanks for the response. thats not quite what I want. Each user can
have multiple ethnicities, so its a many to many relationship. In my
models, I have User hadMany UsersEthnicities, Ethnicity hasMany
UsersEthnicity and UsersEthnicity belongsTo User and Ethnicity. Is
this correct?
I agree wit
On Wed, Dec 31, 2008 at 2:49 AM, Adam Royle wrote:
>
> I don't usually care about routes for my admin controllers since no
> one except administrators see them, so if it was me I wouldn't worry
> about it.
It's not just the admin routes I'm having problems with. Perhaps that
wasn't the best exam
> I guess you mean your main table:
>
> Inefficient method:
>
> In your controller:
>
> $total_num_rows = count($this->Model->find('all'));
>
> More efficient method, also works if you would like to do it on several
> tables.
>
> $num = $this->query("SELECT COUNT(*) FROM table_a, table_b");
On Wed, Dec 31, 2008 at 11:15 AM, cguyer wrote:
>
> I need to concatenate a datetime field from a view in a controller
> before save (.i.e $this->data['Model']['datetime'][year],$this->data
> ['Model']['datetime'][month], etc.). I believe I need to use $date=
> $this->Model->set(??) which calls d
I've just tried to implement the Captcha Component that I found at
http://bakery.cakephp.org/articles/view/captcha-component-with-phpcaptcha
and I noticed that when I did this, it caused my auth component to go
crazy.
When I log in, Auth will show that I am logged in but only when I am
on the use
I need to concatenate a datetime field from a view in a controller
before save (.i.e $this->data['Model']['datetime'][year],$this->data
['Model']['datetime'][month], etc.). I believe I need to use $date=
$this->Model->set(??) which calls deconstruct but from the api im not
able to figure out the s
I hope someone can help me with this I have been banging my head on it
for a week now.
In my view I have a form. Part of that form is a list of inputs that
are in a table. These inputs are all related to an ingredient and its
attributes. The inputs and rows are created from an element one row at
I guess you mean your main table:
Inefficient method:
In your controller:
$total_num_rows = count($this->Model->find('all'));
More efficient method, also works if you would like to do it on several tables.
$num = $this->query("SELECT COUNT(*) FROM table_a, table_b");
/mathias
2008/12/31 mon
Try this in your template:
Add this to your controller: $this->pageTitle = 'My search engine optimized
title';
-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of mona
Sent: Wednesday, December 31, 2008 11:34 AM
To: CakePHP
Subject: How to
I wan't to display total no of records in database on my welcome page
how to do this
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To u
I username in session and read this on my welcome page
but after some time name stored in session disappears can anybody tell
me why this happen and what is the solution for that
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Googl
I tried alot using
I used this in my login function
$this->pageTitle = 'My search engine optimized title';
but when i wan't to display in my layout it can't display
but when i display this
in body section it is displaying a title
--~--~-~--~~~---~--~~
You received t
Thanks Eddie I'll take it up with my host. I use Media Temple. They're great.
Smelly_Eddie wrote:
>
>
> smtp should be the default. It is the de facto standard for internet
> transfer of email (simple mail transfer protocol)
>
> mail is a 'nix based system of mails that are usually handled
Ugh..
That's normal debug data. Set debug to 0 in config/core.php to turn
this off.
On Dec 31, 4:29 am, garza2002 wrote:
> I have CakePHP v 1.0.0.2363. It is working fine in my actually server.
> But i want to transfer to another server. In this new server with the
> same configuration i obtain
$form->create('User', array
('controller'=>'users','action'=>'login'));
On Dec 30, 1:23 pm, jejk wrote:
> I guess it s a trouble with $base in dispatcher.php but I don't see
> how to tune that.
--~--~-~--~~~---~--~~
You received this message because you are subsc
smtp should be the default. It is the de facto standard for internet
transfer of email (simple mail transfer protocol)
mail is a 'nix based system of mails that are usually handled
internally or within a lan. I don't think that switching to mail
would help as the email would never reach your ma
Controllers are plural so therefore needs to be named as follows
var $name = 'Schools';
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegrou
Your missing the purpose of helpers.
They are meant to manipulate data as it is presented to users within a
view. (show nice dates, currency, trees, etc.)
Within a model you should just handle the data in its current form and
validate against that.
What would you use the number helper for in va
> User belongsTo Country?
Yip .. the rule of thumb is that the table containing the foreign key
belongsTo the other table.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send
User belongsTo Country?
gearvOsh wrote:
> I know how to do relations for foreign keys, but I cannot figure out
> how to do this.
>
> In my users table, I have a column called state_id and country_id. I
> tried a hasOne country but that does not work. It looks for a user_id
> on the Country table
Hi,
I have an ACO object with alias "users/apanel_list" and a "admin" ARO
object in the DB.
When I issue $this->Acl->allow("admin", "users/apanel_list") I get the
following error -
DbAcl::allow() - Invalid node [CORE\cake\libs\controller\components
\acl.php, line 325]
The issue seem to be coming
Hello everyone,
we have a problem with HABTM when we mix the "with" property with the
"joinTable" property.
We need to define the "joinTable" property, because our naming
convention is a little tricky and we want to simplify the relational
model name by defining the "with" property.
The problem is
Hi,
when I call a method of a model out of a controller, I get the
following sql-exception:
EXCEPTION ->
Warning (512): SQL Error: 1064: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version for the
right syntax
I have CakePHP v 1.0.0.2363. It is working fine in my actually server.
But i want to transfer to another server. In this new server with the
same configuration i obtain this error when i make a consult to the
database through a controller.
2 queries took 1 ms Nr Query Error Affected Num. rows Too
Hello,
I have a problem with with cakephp under linux (centos 5.2) with the
naming conventions (plural). The name of my table is "schools".
So I thouhgt the name of my controller is: "schools_controller" and
the content of this file sould be something like :
But this doesn't work under my cent
Well, you can change your logic and view. Change the view to NOT put
in the password value. During submission, if both the fields are
empty, ignore changing password else if both the fields are same, then
hash THAT string and use it as password. Simple.
On Dec 31, 3:45 pm, vikas wrote:
> hi..
>
hi..
I used password field to store a password. I used the Auth component
as it will automatically hash the password field.
Now problem is when user edit his information, in password field the
it shown as hash string(for example like "*").
so this means the original password is h
Bump ... really need some help with this!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
if I understood the thread opener he wants to have an automagical
redirect to the login page after x min of inactivity by the user where
x is the SessionTimeout.
If you want that, I do not think CakePHP does it. Typo3 for instance
does that (and it is very annoying being a developer to have that
f
I know how to do relations for foreign keys, but I cannot figure out
how to do this.
In my users table, I have a column called state_id and country_id. I
tried a hasOne country but that does not work. It looks for a user_id
on the Country table that matches the user id, I need it the other way
ar
http://book.cakephp.org/view/490/counterCache-Cache-your-count
On Dec 30, 5:57 pm, mona wrote:
> I wan't to display total enteries from database and i have one link on
> database when user enter new entry it will update the count how to do
> this
--~--~-~--~~~---~--~-
41 matches
Mail list logo