Hi,
you should add the fifth parameter to switch off escaping.
http://api.cakephp.org/class/html-helper#method-HtmlHelperlink
Something like this:
e($html-link($html-tag('b','Home'),array
('controller'='controlls','action'='index'), null, null, false));
Regards
Guenther
DatacenterHellas
Hi,
in my database there is a field called released type date.
In the view I use this:
$form-input('released', array('empty' = true))
Which gives me three nicely formatted select fields for month, day and year.
But I can only save the field if all three select fields have a value.
If I select
Hi,
I'm a little bit lost about how to shape my query with the containable
behaviour.
There are two models:
A hasMany B
B belongsTo A
B has a date-field
Now I'd like to get one random data set out of A which has either
- no belonging entries in B
or
- only entries in B where date is more
Hi,
in my database I have a field named 'year' which has the type year(4).
In the add form I would like to have a select field for the years. So I
added this:
e($form-year('year'));
If I try to save the form I get an array to string conversion error
and Unknown column 'Array' in 'field list.
Hi,
$last_id = $this-ModelName-getInsertId() should do the trick.
http://api.cakephp.org/class/model#method-ModelgetInsertID
Regards
Guenther
Roman Brunnemann write:
Hi,
quick question from a newbie. After saving data that will result in a
create, I'd like to retrieve the ID from the
Sorry, typo.
It should be getInsertID().
Hi,
$last_id = $this-ModelName-getInsertId() should do the trick.
http://api.cakephp.org/class/model#method-ModelgetInsertID
Regards
Guenther
Roman Brunnemann write:
Hi,
quick question from a newbie. After saving data that will result in a
Hi,
I've got a bit of a problem with the containable behaviour:
There are three models:
A hasMany B
B HABTM C
A actsAs containable
Now in a method of the A model I'd like to do a query which gets me the
rows from A with the according rows from B _and_ the data from C
belonging to each B.
But
Hi,
thanks for the answer but I just found out that I misread the docs.
I tried something like this:
$data = $this-find('all', array(
'contain' = array(
'B' = array(
'contain' = array(
'C'
);
which doesn't work.
It has to be like this:
$data = $this-find('all',
Moin,
ist es möglich find('list') mit COUNT zu kombinieren?
Ich möchte eine Liste erhalten mit dem Wert eines Feldes als key und der
Häufigkeit des Auftretens als value.
Geht das mit cake-Bordmitteln? Oder muss ich das Ergebnis einer
find('list')-Abfrage in php auswerten (zählen)?
Danke und
, for
example:
array('fields'=array('Product.type','MIN(Product.price) as price'), 'group'
= 'Product.type');
http://book.cakephp.org/view/74/Complex-Find-Conditions
All the best,
Richard
2009/4/17 Günther Theilen thei...@eqi.de
Moin,
ist es möglich find('list') mit COUNT zu kombinieren
Hi,
Toby wrote:
I have a problem with the following line in my code...
$this-Session-setFlash(__('Hidden value changed'));
try this:
$this-Session-setFlash(__('Hidden value changed', true));
http://api.cakephp.org/file/basics.php#function-__
Regards
Guenther
by calling saveAll().
Isn't that possible with HABTM?
Regards
Guenther
brian schrieb:
Have a look here
http://teknoid.wordpress.com/?s=validate+habtm
On Fri, Feb 27, 2009 at 9:30 AM, Günther Theilen thei...@eqi.de wrote:
Hi,
maybe I'm a bit dull but I can't figure out what I'm doing wrong
Hi,
maybe I'm a bit dull but I can't figure out what I'm doing wrong here.
Maybe someone can help:
I've got two models: Foo HABTM Bar.
In foo_controller, add method I do this:
$bar = $this-Foo-Bar-find('list');
$this-set(compact('bar));
In the foo/add view I have:
$form-input('Bar',
Hi,
what version do you use?
There was a bug in an older version that is fixed by now:
https://trac.cakephp.org/changeset/8011
Regards
Guenther
RKS schrieb:
Hi friends,
I am a new user of CakePHP, and just finished the tutorials. I created
a small application for testing and found out a
Hi,
I use these two methods:
http://bin.cakephp.org/view/835272537
Regards
Guenther
GetIT wrote:
Hi,
I want to build a navigation out of all available Controllers/Actions.
Is there a way to get a list of all Controllers/Actions with the help
of cakephp or php?
How?
to automatically populate $this-data var
maybe just data[field] suffice, but I don't know as I always use
FormHelper, you can try yourself
On 4 fév, 08:05, Günther Theilen thei...@eqi.de wrote:
Hi,
I'm a little bit lost here, maybe someone can help.
A file upload on one of my sites (Cake
djiize wrote:
- the form and the field have the same name ImportFile = conflict ?
That did it. I renamed the field to import and it worked.
The really strange thing is that it _has_ worked with ImportFile.
Thanks a lot!
Regards
Guenther
--~--~-~--~~~---~--~~
Hi!
Is there as way to define default conditions in the model?
Let's say I have a model with a field active which can be 0 or 1.
In most queries I need the condition active = 1 but sometimes I need
the condition active in (0,1).
Is there a way to define active = 1 as the default condition for
.
'.active'])) {
$conditions[$this-alias . '.active'] = 1;
}
return true;
}
2009/2/5, Günther Theilen thei...@eqi.de:
Hi!
Is there as way to define default conditions in the model?
Let's say I have a model with a field active which can be 0 or 1.
In most queries I
Hi,
I'm a little bit lost here, maybe someone can help.
A file upload on one of my sites (Cake 1.2) suddenly stopped working.
The method isn't used very often so I can't exactly say since when it
doesn't work anymore but I know that my hoster has moved to a new data
center and I suspect that
AS SELECT f.id, COUNT(b.id) FROM foo AS f INNER
JOIN bar AS b ON b.foo_id = f.id GROUP BY f.id';
$this-Foo-query('SELECT * FROM foobar');
Oooh! Wouldn't Cake DBviews be tasty? Cake 2.0, maybe?
On Wed, Jan 28, 2009 at 10:18 AM, Günther Theilen thei...@eqi.de wrote:
Hi,
I've got two models Foo
be used with
conditions when you need to limit the results to rows that have (or
don't have) related items.
On Jan 28, 7:18 am, Günther Theilen thei...@eqi.de wrote:
Hi,
I've got two models Foo hasMany Bar.
What would be the best way to get all entries of Foo and the number of
according
Hi,
I've got two models Foo hasMany Bar.
What would be the best way to get all entries of Foo and the number of
according entries in Bar.
I thought about a find-('all') and a count() in the view but that
doesn't seem to be very elegant.
Any hints?
Regards
Guenther
Hi,
you can add a list of allowed fields as third parameter.
http://api.cakephp.org/1.2/class_model.html#ebe42ae387be89985b5a35dd428f5c81
Regards
Günther
K3 schrieb:
Hi,
if for example end user changed the html form and adds another field,
he can update another field.
What i mean by
Hi,
as far as I can see cake uses ISO 639-2 in i18n/l10n for the
abbreviation of the language names.
http://www.loc.gov/standards/iso639-2/php/code_list.php
For a few languages there are two codes, B (bibliographic) or T
(terminology). (Whatever that may mean...)
For example:
German has
ger
Hi,
I have a problem with truncate() and German umlauts (äöü).
(The DB and the php code is in utf-8)
$test = xäx;
debug ($text-truncate($test, 9));
I would expect it to return
xä...
but it returns
x?...
Bug or feature?
Regards
Guenther
mbstring.func_overload 7
This will overload string functions (strlen, substr, ...) to use the
mb_* versions transparently.
hth
grigri
On Dec 9, 12:06 pm, Günther Theilen [EMAIL PROTECTED] wrote:
Hi,
I have a problem with truncate() and German umlauts (äöü).
(The DB and the php code is in utf
Hi,
thanks for the answers but the don't really cover my problem.
Maybe my explanation was a bit blurry...
Let's say I have a link like this:
$html-link(__('edit data', true), array(...))
This works fine with the translations for 'edit data' in the po-files.
But in my application I have to
Hi,
in an application I use cake's l10n class which works fine.
Now I want to be able to edit some of the translations from within the
application.
I'd like to use the __()-function but it should get the translations
from a database table instead the po-files.
Has someone already done
Hi Sebastian,
I'm not 100% sure but this should work:
'date' = array (
array(
'rule' = array('date', array('dmy'))
etc.
Regards
Guenther
Sebastian Göttschkes schrieb:
Hi Deepesh,
thanks for your reply.
Sure, I could make a custom validation rule, but as it is written in
the
Hi Anja,
sorry, I can't help you with your specific problem.
But maybe you want to take a look at this:
http://www.cakephpforum.net/index.php?showtopic=27st=0
With that, I set up Auth and ACL and it works like a charm.
(You should read the entire thread, though. There are some bugfixes.)
this to the docs with an
example to provide an answer to anyone who is facing the same issue.
Regards,
Sebastian
On 2 Dez., 15:17, Günther Theilen [EMAIL PROTECTED] wrote:
Hi Sebastian,
I'm not 100% sure but this should work:
'date' = array (
array(
'rule' = array('date', array('dmy
Hi,
I've got a little problem regarding Auth-loginAction() on Cake
1.2.0.7692 RC3.
Auth and ACL is set up and working fine.
By default, Auth redirects to /users/login if someone tries to access a
protected page.
I want to change that. I put the login-form in some sort of sidebar menu
(an
. However, you can force people to go to a specific
controller/action pair if needed.
http://book.cakephp.org/view/391/loginAction
You can change the default login from /users/login to be any action of
your choice.
thatsgreat2345 wrote:
loginRedirect not loginAction
On Dec 1, 7:01 am, Günther
Hi Anja,
Liebermann, Anja Carolin schrieb:
I wonder if I can add additional conditions for authentication.
Something like this?
http://book.cakephp.org/view/248/AuthComponent-Variables#userScope-487
Regards
Guenther
--~--~-~--~~~---~--~~
You received this
dr. Hannibal Lecter schrieb:
Günther, you seem to be working on the exactly same thing. Did you
notice any significant slowdowns in your application?
No, I didn't. But that's probably because my application isn't online
yet... ;-)
I'll let you know when I finished the component, ok?
Regards
dr. Hannibal Lecter wrote:
I'm halfway through the ACL implementation (well, almost...), and I
was wondering: is it better to hide the links which are denied by ACL
(we're talking about the already logged-in user), or show them and
give the user the Auth message not enough privileges?
Hi,
let's say there are two models:
BasicEntry hasOne AdvancedEntry
AdvancedEntry belongsTo BasicEntry
In the advanced_entries table in the DB there is a field called
basic_entry_id
In views/basic_entries_edit.ctp there is something like this:
$form-input('BasicEntry.foo');
% in control of what happens and when. I'll probably
get used to saveAll() eventually though...
On Oct 8, 1:40 pm, Günther Theilen [EMAIL PROTECTED] wrote:
Yeah, I thought about that.
But what happens if a user changes the value of the hidden field
AdvancedEntry.id?
So I would have to check
this for the primary model. It
doesn't hurt, though)
(id fields are hidden by default, so you don't need to specify it)
hth
grigri
On Oct 8, 9:45 am, Günther Theilen [EMAIL PROTECTED] wrote:
Hi,
let's say there are two models:
BasicEntry hasOne AdvancedEntry
AdvancedEntry belongsTo BasicEntry
Hi,
what's the name of your session cookie?
I had a similar problem with a session cookie name foo.bar.
When I renamed it to foo_bar everything worked fine.
alex_c schrieb:
Hi all,
I've been pouring over the docs and this group, but I can't really
figure it out.
In my UsersController,
Hi!
I've got a weird problem with the form helper, maybe someone can help...
$form-input(5.name) creates an input field with name=data[5][name],
which is pretty much what I expected.
But $form-input(0.name) creates an input field with
name=data[foo][name], foo is the pluralized modelname.
into the right direction:
http://bakery.cakephp.org/articles/view/multivalidatablebehavior-using-many-validation-rulesets-per-model
Regards,
Markus
On 22 Sep., 14:25, Günther Theilen [EMAIL PROTECTED] wrote:
Hi,
I'm struggling a bit to set up the right validation rules for my
Donkeybob schrieb:
what happens when you do it the other way . . .
That doesn't work at all.
I think I'll just capitulate an do it the old fashioned way:
index.ctp to list the records, edit.ctp to edit _one_ record
Thanks anyway!
Regards
Guenther
(Contact.$i.name);
}
This way the data is like this:
$data = array(
'Contact' = array(
0 = array('id' = ..., 'name' = ...),
1 = array('id' = ..., 'name' = ...),
2 = array('id' = ..., 'name' = ...),
...
)
);
...works fine.
hth
grigri
On Sep 25, 3:53 pm, Günther
am, Günther Theilen [EMAIL PROTECTED] wrote:
Hi!
I've got a weird problem with the form helper, maybe someone can help...
$form-input(5.name) creates an input field with name=data[5][name],
which is pretty much what I expected.
But $form-input(0.name) creates an input field with
name=data
-and-tips/
It looks like it *should* work. So I don't know...
On Sep 25, 4:28 pm, Günther Theilen [EMAIL PROTECTED] wrote:
Could you please post your controller code to populate the form?
grigri schrieb:
I've never seen it done that way before. I always do it like this:
(simplified view
teknoid wrote:
That being said it is always a good idea to name your fields as
ModelName.fieldName and ModelName.{$index}.fieldName
This is especially true when using saveAll(), and I do specify that in
the tutorials.
Yep, you're right. I usually do it that way when handling hasMany
Hi,
I'm struggling a bit to set up the right validation rules for my
application, maybe someone has a hint.
Let's say there are two models: User hasOne Profile
The users belong to different groups and the profiles differ a bit
according to the group.
Users in group 1 have to enter data for
Hi,
kicaj wrote:
...in view:
$form-input('category_id', array('options'=$categoriesList));
try this:
$form-input('category_id', array(
'options' = $categoriesList,
'escape' = false
));
Regards
Guenther
--~--~-~--~~~---~--~~
You received this message
Hi!
I'm working on a new project and right now I'm struggling a bit to put
the requirements together in a proper cake-like way.
I use Auth/ACL which is set up and works fine. The users who can log-in
belong to three different groups. These groups are defined by a field
role_id in the user
contacts and
people and companies
depending on the ContactsController.
On Wed, Sep 17, 2008 at 8:10 AM, Günther Theilen [EMAIL PROTECTED] wrote:
Hi!
I'm working on a new project and right now I'm struggling a bit to put
the requirements together in a proper cake-like way.
I use Auth/ACL
Hi,
forrestgump:
Error: Database table itemss for model Items was not found.
you should check your model.
Is it called items instead of item?
regards
Guenther
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Hi,
I'm using Cake 1.2.0.7296 RC2 on a local LAMP machine and I ran into a
problem:
There a two sites foo.local and bar.local, both have identical
apache configuration files. They use different cake installation but (as
far as I can see) the configuration files are identical (except for the
Hi again,
I think I found the solution:
I named the session cookie foo.bar. If I call it foo_bar it works.
Are dots not allowed in cookie names?
Regards
Guenther
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
55 matches
Mail list logo