Play around with the Set::combine() or Set::extract() methods to get
the array into the right shape.
http://api.cakephp.org/class_set.html#80506e373d04c93eb4dc1582d8e5c09c
On 22 Sep 2008, at 06:26, ORCC wrote:
Usually I create lists for using with $form-select(), vía
find('list') method.
I am facing same kind of issue here.
I was working with counterCache - Cache your count().
In principle it work like a cake :)
But I have the following situation ...
Taking the same example given in the manual , what happens when I am
not deleting the image but only changing the Album.
Let's say
I m not usind json_encode() - After all, I m able to get JSON data
from the controller to my view just fine. The problem is when I make a
JSON request from my view to the controller and pass some parameters.
It's those params that I cannot access..
On Sep 22, 3:14 am, Donkeybob [EMAIL PROTECTED]
Hi,
Personally I prefer setFlash to flash. (But feel free to try to win me
over)
$this-Session-setFlash( 'Oups, that did not work!', 'default',
array(), 'error');
$this-redirect('somewhere');
This redirects you to an actual page and shows the flash as a
message on that page.
(I show the Flash
I'm using cakephp 1.2 and naming any of my controller actions 'new' or
'list'
throws this error
Parse error: parse error, expecting `T_STRING' in {file_path} on line
{line_number}
I'm just curious why that is?
--~--~-~--~~~---~--~~
You received this message
Hi Martin,
Great approach! Simple and elegant!
Thank you very much indeed.
On Sep 22, 3:56 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Hi,
Personally I prefer setFlash to flash. (But feel free to try to win me
over)
$this-Session-setFlash( 'Oups, that did not work!', 'default',
Hi,
I think doing it Cake-friendly and starting from the sql query do not
go together too well. :)
Lets see if I got this right: What you want to count is the number of
groups that user 1 belongs to where the group gives him the
permissions users or users/login. Did I read the sql correctly?
It
You're probably having problems because the jQuery jQuery.getJSON()
method uses a GET request (the clue's in the method name) to return
JSON data to your javascript, not to POST JSON data to your back-end.
For that, you'd want to use the more generic jQuery.ajax() method,
kinda like this:
var
It's not a Cake issue, it's a PHP thing. new is a reserved word for
PHP and list() happens to be a language construct that looks like a
function, hence it's out too.
http://jp.php.net/manual/en/reserved.php
http://jp.php.net/list
On 22 Sep 2008, at 16:59, trustfundbaby wrote:
I'm using
Ahh what a brain fart! ... thanks so much for pointing that out.
On Sep 22, 3:46 am, David C. Zentgraf [EMAIL PROTECTED] wrote:
It's not a Cake issue, it's a PHP thing. new is a reserved word for
PHP and list() happens to be a language construct that looks like a
function, hence it's
Hey base64,
This message 220-We do not authorize .. is being produced by one of
the mail servers charged with delivering your mail message.
Try using a mail server you have authority to use.
Cheers,
Predom.
On Sep 22, 3:32 am, base64 [EMAIL PROTECTED] wrote:
Dear all,
I'm using CakePHP
When you use the form-input, you automatically get a label tag
generated etc
However this does not contain a class.
So usually, the best thing to get several form fields and labels
aligned is:
div class=labelSomething/div
div class=inputfieldinput type=text //div
div
Hi, I have created an authentication according to the cookbook. I
login and check the sessions, I can get the user_id like
$_SESSION['Auth']['User']['id'], is there any better way of getting
the session value ?
--~--~-~--~~~---~--~~
You received this message
Hi toby,
I want to avoid having a css entry for every single input field and
would like to use a class.
How can this be done in cakePHP, so that all labels use the same css
class ?
Cake wraps the label and input in a div, by default it applies a class
of 'input' to that div. So you
Correct way how to obtain id of logged-in user (in controller) is
$this-Auth-user('id').
Btw, correct way how to access session variables is through
SessionComponent or SessionHelper.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
2008/9/22 toby78 [EMAIL PROTECTED]
When you use the form-input, you automatically get a label tag
generated etc
However this does not contain a class.
So usually, the best thing to get several form fields and labels
aligned is:
div class=labelSomething/div
div class=inputfieldinput
You can use an array to specify label's tag attributes:
$form-input('Schedule.expected_check_in', array('label' =
array('class' = 'input-label', 'text' = 'Expected Arrival', 'title'
= 'When are you expecting to arrive at the place?')));
The 'text' key is the one to be used as the text, so the
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, I have a reasonable simple question for an experienced person..
I did authentication according to the cookbook, I want to access the
user id via session.
I do this in the user controller...
function login() {
$userid = $this-Auth-user('id');
$this-Session-write('id', $userid );
}
Hey, I'm trying to migrate a site's database from MySQL to PostgreSQL
and I created a schema from the already existing MySQL database and
the models I created for it. I put in the PostgreSQL connection
parameters into the configuration file and tried to do a 'php cake.php
schema run create' to
I have come across an issue in my cakePHP application I have come to
know that when the referer contains the link of an external site my
controller actions are not executed at all.
Up on some research I found out that the referer() function in the
cake/libs/controller/controller.php checks the
Hi,
I am working on a dynamic content website. I want to implement home
page. This home page
of my site needs to have a lot of dynamic content generated on it.
Dynamic contents are coming from different module.
I have implemented it like this.
1 Make HomesController
2 Use of $uses =
Hello,
I've seen that for security reasons the word LIKE in sql queries for
the method find has been moved from the right site (value) to the
left side (variable) on latest cake.
The strange fact is that I'm using SVN to update my dev-environment
and the production-environment but on the
That is fine that i need to let Paginator know which one you want. But
i made grid layout with help of two model and when user click any
field title it should be in sorted in ASC or DESC and also that those
field is coming from different model.
On Sep 16, 2:31 pm, [EMAIL PROTECTED]
[EMAIL
Out of personal experience I can say, cakephp CAN handle sites that
get allot of visitors.
I use APC for cashing, that helps allot.
Ofcourse you'll always have some overhead of the framework compaired
to if you only write what you need when you need it.
But that'll take you a long time to write.
Sounds like a horrible ideaand bad DB design.
If you have your DB in Boyce-Codd normal form, you will never have the
need for such a DB layout...
But let me know about your experience :)
On Sep 21, 7:23 pm, Yodi Aditya [EMAIL PROTECTED] wrote:
I have reading about vertical database
I'm trying to create a bookmarkable search results page. I have the
following form so I am using 'get' search form:
?php echo $form-create(Event, array(action=search,
type=get)) ?
?php echo $form-input(Event.start_date) ?
?php echo $form-end(search) ?
When the form is posted, the URL looks like
Note: this groups post:
http://groups.google.com/group/cake-php/browse_thread/thread/c05c03e397549dde/57f2e4d6b3f7fb0e?lnk=gstq=form+get+date#57f2e4d6b3f7fb0e
Sounds like the same problem, but has no replies...
On Sep 22, 2:41 pm, RichardAtHome [EMAIL PROTECTED] wrote:
I'm trying to create a
i might be really wrong but if you can see it in the view function
then it must be in session. To me, the login function is just for
logging in and then it redirects to where the userid can be
retrieved. . . .somebody else could explain this a little better then
me.
On Sep 22, 8:32 am, gabriel
Thanks, this works.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For
Those .po files used for l8n look weird
is there a way to use something like Java property files instead? This
would be better for re-using existing files and a more standard way
of doing things.
Is there maybe already some plugin for cakephp to use such property
files?
Thanks!
I believe that CakePHP can handle big/huge websites, but using the
Mozilla Add-ons as an example is not a trully example. Why? Mozilla
add-ons uses a very modified version of Cake 1.1, if you dont believe
me, check app_model of it. Also, I think it uses Zend too. So, there
HAS to be a better
Note:
div class=labelSomething/div
div class=inputfieldinput type=text //div
div class=labelSomething2/div
div class=inputfieldinput type=text //div
..will create an invalid form: You MUST have a label linked to every
input element.
Here's a snippet from my own cake.generic.css:
/*
*
Hi Richard,
I'm trying to create a bookmarkable search results page. I have the
following form so I am using 'get' search form:
?php echo $form-create(Event, array(action=search,
type=get)) ?
?php echo $form-input(Event.start_date) ?
?php echo $form-end(search) ?
When the form is
I suspect you are trying to SMTP to gmail or something similar.
CakePHP doesn't support the encyption required to connect to these
types of SMTP server.
The Bakery has some useful articles for using 3rd party mail
components that support encrypted SMTP
On Sep 22, 10:35 am, Predominant [EMAIL
Aye, I thought of that but it feels a bit 'messy' :-(
On Sep 22, 3:23 pm, Daniel Hofstetter [EMAIL PROTECTED] wrote:
Hi Richard,
I'm trying to create a bookmarkable search results page. I have the
following form so I am using 'get' search form:
?php echo $form-create(Event,
I am facing same problem
On Sep 21, 5:56 pm, Rick [EMAIL PROTECTED] wrote:
I tried that technique but it did not work. It appears that you can't
havemultipleuseDBConfigs in a single query. This seems reasonable
since you also can't do a raw select usingmultipleconnections which
is what the
What version of PHP are you using.
I'm having the same problem but only with PHP4.
As soon as I switch to PHP5, the problem goes away.
On Aug 19, 6:07 pm, designvoid [EMAIL PROTECTED] wrote:
Is anyone able to shed any light on this??
I've put it aside for a while, but I need to figure this
Just wanted to follow up on this thread http://is.gd/2XoO, because I'm
having the same exact problem
I've been trying to figure this one out for the last 5 hours (so no
sleep yet :] ... )
cakephp version: 1.2RC2
Mysql version: 4.1
PHP version: various (see post)
I have a 'Question' model that
hİ Martin,
First so many thanks for your reply, But I can not fix my problem.
You are right I am trying to checking if the user has any of the
required permissions for a given request.
I write GroupPermission model to apply my query as cake-friendly
because I can not create Left Join operation
Have you checked out Easysoft's SQLEngine? It allows heterogeneous
joins across databases and even across different RDBMs?
As an alternative, you could always use $this-model-query(); and
enter the SQL by hand. You'll loose a lot of cakey goodness though :-(
On Sep 22, 3:19 pm, Bookrock [EMAIL
Hi,
I've installed Cake PHP last week and I'm trying to use it with SQL
Server 2005. I have a new database called test with the user sa as
the only authorised user. This database has one table called items.
I configure the database.php file with the right parameters and I can
see the right
i copied a new app folder over the existing one and not i can't even
see the cakePHP default screen
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send email to
More standard?
The file format is THE standard.
Do a little research on gettext.
http://www.google.com/search?q=gettext
--
/**
* @author Larry E. Masters
* @var string $userName
* @param string $realName
* @returns string aka PhpNut
* @access public
*/
On Mon, Sep 22, 2008 at 9:00 AM, toby78
Another database really isn't an option as I said this is an existing
MySql instance.
Yeah, I could do raw queries but I wanted to taste the cakey goodness.
Rick
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
thanks. looks like what i need.
do you happen to know where i put these files? the uploadgd and upload
file... which dir do they belong in?
On Sep 20, 11:19 am, teknoid [EMAIL PROTECTED] wrote:
hi, take a look at these
I'm having a serious problem installing phpGACL on cakephp 1.2: I
can't see the Proceed with installation button that I have been told
to click. Is there a way to manually submit the form or to proceed or
to make the button visible?
Thanks,
Josh
Hi at all,
I'm having some problems with i18n translations.
I have two related tables with their models: Category has many
Subcategory. One Subcategory belongs to a Category. The translations
are stored in i18n table.
I get the Category data:
$cats = $this-Category-find('all');
And I obtain
behaviours go in
{app}/models/behaviours/
there is also this - with a ready to download example of an avatar image
column in a profile table
http://bakery.cakephp.org/articles/view/actas-image-column-behavior
- S
2008/9/22 rocket [EMAIL PROTECTED]
thanks. looks like what i need.
do you
hello everyone-
I have a model: Day - hasMany - Time - hasMany - Prices
Day has a category_id (as well as a primary key day_id).
i want to duplicate a number of day records and all of the associative
data, based on the category_id.
so i would do: $this-Day-find('all', array('conditions' =
Hi All,
I've been reading other posts on this but I still can seem to make it
work. This post seems to be what I want to do but I'm still having
trouble.
Hello
I have recently came around cakephp and swfupload component.
I'm experiencing some difficulties understanding the tutorial on the
following link:
http://bakery.cakephp.org/articles/view/swfupload-and-multipurpose-uploader
I'm unsure how I should name those view template files (there are
Hi,
I thought I seek feedback from this group on what would be the best
direction creating reporting in CakePHP.
My project that I am working on, is to take resource scheduling excel
spreadsheet and move it over to a database, the reason to this is that
the spreadsheet has grown to big, and
I'm using the latest cakephp.
There are two different view templates presented on the swfupload/
cakephp tutorial page, so I dont know how should I call each of them.
No information about that is given. Do you have any idea? I guess I
should call 'upload.thml' the longest one but I'm unsure
Hi,
This is a HABTM relationship.
Take all that off and use only this.
var $hasAndBelongsToMany = array(
'Supervisor' = array('className' = 'Employee',
'joinTable' =
'employees_supervisors',
Oh, i didn't read that condition:
array('Employee.is_supervisor'=true)
You might want to add another model for the supervisors too, and
change that relationship to call it.
Then put another HABTM in the supervisors model pointing to the employees.
Werner Petry Moraes
http://werner.inf.br/
Hi,
Thanks for the response. I want to avoid adding a Supervisor model as
a supervisor is just another employee. The
EmployeesSupervisor.supervisor_id is a foreign key to Employees.id.
I did initial try to set this up as HABTM but after reading other post
that suggested otherwise I switched
Here's the scenario:
I've got a list of Photographers; each Photographer has a list of
Emphases that they specialize in; each Emphasis has additional info
(like 'experience').
In the Edit view, I'm looping through the Emphases and creating the
form. However, I also have an Add new ajax
Have you seen this article
http://blogs.bigfish.tv/adam/2008/04/01/cakephp-12-sessions-and-swfupload/
there is also some information about setting up swfupload in cakephp in the
swfupload forum too.
- S
2008/9/22 introvert [EMAIL PROTECTED]
I'm using the latest cakephp.
There are two
Nice. :)
I also commented those pages in the docs...
On Sep 21, 6:45 pm, villas [EMAIL PROTECTED] wrote:
Yes, you are right about that introduction; that section seems to be
out of date when compared to the API:
http://api.cakephp.org/cookie_8php-source.html
I have now submitted an update
Good, i hope this will be help many people :D
On 9/23/08, Kenchu [EMAIL PROTECTED] wrote:
Nice. :)
I also commented those pages in the docs...
On Sep 21, 6:45 pm, villas [EMAIL PROTECTED] wrote:
Yes, you are right about that introduction; that section seems to be
out of date when
Gabriel this is the third thread you have started on the same topic!
There are answer on the other threads it poor editicate to start yet
another thread on the same topic.
https://mail.google.com/mail/?zx=15ic3dxc3p7ftshva=1#trash/11c7b06bf600e1d7
Hey,
Thanks for the response. I want to avoid adding a Supervisor model as
a supervisor is just another employee. The
EmployeesSupervisor.supervisor_id is a foreign key to Employees.id.
Well, the supervisor has different behavior (Employee.is_supervisor =
true), so, I'd see it as another
Well, the supervisor has different behavior (Employee.is_supervisor =
true), so, I'd see it as another entity and model.
But, you can put this condition in the relationship declaration and
use the same model.
True but if I have employee Bob who is a supervisor. Bob supervises
Tina, and
Well, the supervisor has different behavior (Employee.is_supervisor =
true), so, I'd see it as another entity and model.
But, you can put this condition in the relationship declaration and
use the same model.
True but if I have employee Bob who is a supervisor. Bob supervises
Tina, and
I believe what you are referring to is the entity-attribute-value data
model (sometimes referred to as the object-attribute-value model):
http://en.wikipedia.org/wiki/Entity-Attribute-Value_model
This database model is actually used in Magento, an open-source
eCommerce PHP framework.
This is a
Well, the supervisor has different behavior (Employee.is_supervisor =
true), so, I'd see it as another entity and model.
But, you can put this condition in the relationship declaration and
use the same model.
True but if I have employee Bob who is a supervisor. Bob supervises
Tina, and
Hi Bruce,
I want to do exactly the same than you.
I have 4 db, 1 how contain the other DB name and the 3 other db have
the same shema.
I check with a prefix in the url if it corespond to a existing client
name in the first DB and then I want to change the default database.
I tried to do that :
I usually put these Controller-specific elements inside the same
folder as the controller they are associated to.
Example: create an 'emphasis.ctp' file, and place it in your views/
photographers/ folder. You can then render this element inside a
photographer view template by calling ?php echo
I think you're going to get a much better response with a 5-10 line
pseudo code example than the nearly 200 line VB code you've included
below. Personally, I wouldn't even consider looking at something like
that unless someone is paying me cold hard cash.
As for the calculate the week issue, did
Yeah, I've prefixed the element with an underscore.
Hmmm ... excellent (and obvious) idea with just using the relative
path from `elements` ...
Makes me think it'd be nice to write a `partial ()` function which
would take in the name and prepend the path + current controller; but
I can't seem to
No problem. The more Rails converts, the better :-P
The equivalent of App_controller.php and app_model.php in terms of
views is slightly different than what you'd expect; in actuality, the
implementation of view sub-classing allows you to define multiple
custom View classes and attach different
Cheers, that helps a lot!!
On Sep 22, 5:01 pm, Joel Perras [EMAIL PROTECTED] wrote:
No problem. The more Rails converts, the better :-P
The equivalent of App_controller.php and app_model.php in terms of
views is slightly different than what you'd expect; in actuality, the
implementation of
It is not fault of TranslateBehavior - usage of behaviors on
associated models is tricky a little bit. Let me show you one of
solutions (requires CakePHP 1.2 revision 7644) which as an addition
implements golden rule of good cakes: fat model.
I will follow your solution with 2 tables, although
Still trying to wrap my head around Cake's intricacies ... and get RoR
conventions out of my head ...
So I've got a User
I've also got WebpageType (ex: Main, Bio, Blog, etc.)
I then have these 2 tables linked, which has an extra field for the
URL.
I've set this all up using HABTM and `with`.
I'm guessing this might be what's needed:
http://bakery.cakephp.org/articles/view/bindable-behavior-control-your-model-bindings
Will check it out ...
On Sep 22, 6:58 pm, Brenton B [EMAIL PROTECTED] wrote:
Still trying to wrap my head around Cake's intricacies ... and get RoR
conventions out
Naturally not too long after I post I come across the Core
Behavior Containable (http://book.cakephp.org/view/474/Containable).
Same thing ... different name hopefully.
On Sep 22, 7:15 pm, Brenton B [EMAIL PROTECTED] wrote:
I'm guessing this might be what's
I'm using the Containable behavior ...
I want to get a couple extra specific things off one of the
associations, but still want to get all the others.
Instead of having to relist everything, is there anyway I can use '*'
like the Bindable behavior had?? (since it's not deprecated)
bump?
On Sep 22, 10:17 am, trustfundbaby [EMAIL PROTECTED] wrote:
Just wanted to follow up on this threadhttp://is.gd/2XoO, because I'm
having the same exact problem
I've been trying to figure this one out for the last 5 hours (so no
sleep yet :] ... )
cakephp version: 1.2RC2
Mysql
In the blog tutorial, they use the save method both to save or update
an existing record. I tried to take that idea for my application and
had some trouble:
My model is the following, with all default table names (i.e id is the
primary key)
class Manufacturer extends AppModel {
var
$this-Manufacturer-id = $id;
you can also save() the data without doing a set() first, i.e. $this-
Manufacturer-save($this-data);
the update would also get triggered if 'id' is part of the $this-data
array
On Sep 22, 11:25 pm, ORCC [EMAIL PROTECTED] wrote:
In the blog tutorial, they use the
I am using 1.2 RC2 and creating the first section of the site.
I have 1 model, controller, and view. I am using
Admin Routing, and I changed the routes.php file default to the
following:
Router::connect('/', array('controller' = 'home_pages', 'action' =
'index'));
My question is when I go to
You might want to create a bug report for this.
Be sure to include a test case illustrating your problem, and specify
the exact PHP version you are having trouble with.
Take a look at the existing test cases to see how to write one, if you
haven't done it before.
On Sep 22, 11:21 pm,
there are other, more robust ways to accomplish this, for example by
using cached data.
but really, make it work, then make it work better. keep in mind that
this might be something you'll revisit later, i wouldn't get too hung
up on the performance, because it sounds like you are pretty early
Thank you for answer.
On 23 sep, 00:42, teknoid [EMAIL PROTECTED] wrote:
$this-Manufacturer-id = $id;
you can also save() the data without doing a set() first, i.e. $this-
Manufacturer-save($this-data);
This doesn't work either in my model-controller given in the previous
posts. I can't
Okay ... I'll do that.
On Sep 22, 11:46 pm, teknoid [EMAIL PROTECTED] wrote:
You might want to create a bug report for this.
Be sure to include a test case illustrating your problem, and specify
the exact PHP version you are having trouble with.
Take a look at the existing test cases to see
86 matches
Mail list logo