I would guess that you may have created a Database table named Post
wherease cake is expecting a table called Posts which doesn't exist
(as the message says).
If this isn't the problem, I would check your plurals (and I'll eat my
hat)
Cheers,
AD7six
Can't seem to find anything on setting default values for form
elements.
Outside of selectTag, that is.
But if I wanted to have a default value for a text input, textarea or
checkbox, is that possible? And would this be the kind of thing that
gets managed in the model, sort of like validation,
Hi there,
ok maybe i'll be hung for this but (and remember I love cake ;)
I'm not new to cake so everything u do in the screencast I understand
but
it goes awfully fast :)
I know how much time it takes to do these things believe me ;) but I
just wanted to point out that it's a real good thing
Could be a problem with case? Try $helpers = array('html', browser');
--~--~-~--~~~---~--~~
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
This rocks. I was just exploring this problem on Wednesday and lo and
behold - there is now an answer. Thank you John, and thank you Cake for
making the complex achievable.
John Anderson wrote:
*throws confetti*
http://manual.cakephp.org/chapter/19
;o)
I was gonna wait till someone
[EMAIL PROTECTED] 05/12/06 5:46 AM
if you set in $this-data['Model']['field']
then the html helper will add the value to the field
you can use $html-tagValue('Model/field'); if you need the default
data for something else.
so in your add form for example
function add()
{
The name of the table in my database is posts that is the case and
the plurality. The columns are exactly as follows:
id, title, body, created, modified
My model code is this:
from /models/post.php:
?php
class Post extends AppModel
{
var $name = 'Post';
}
?
My controller code is this:
I followed the tutorial found here on handling file uploads, but I'm
stuck on one thing.
http://groups.google.com/group/cake-php/browse_frm/thread/fe4c9d7739f8be2a/4bede155456ff93f?q=file+uploadrnum=4#4bede155456ff93f
Normally when PHP fails a file-upload it gives me a bunch of warnings,
but it
On 5/11/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Anytime I have this problem I either have tables missing in the
database or the database file is misconfigured (typo). You can do an
if(isset($browser)) before calling the helper. If you do that then you
should see the error that
Oh... apparently they go in /app/webroot/img... what a surprise.
Nothing to see here :-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send email to
I have downloaded last nightly build cake_nightly_20.03.2006.
My app has the model (this is different files)
class Group extends AppModel {
var $hasMany = product;
}
...
class Product extends AppModel {
var $hasMany = result;
var $belongsTo = group;
}
...
class Result
On May 12, 2006, at 7:44 AM, modmans2ndcoming wrote:
Is there anything else you might need?
The SQL for the posts table, I suppose, and the contents of your /app/
config/database.php file.
-- John
--~--~-~--~~~---~--~~
You received this message because you
The SQL was copied from the tutorial:
CREATE TABLE posts (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(50),
body TEXT,
created DATETIME DEFAULT NULL,
modified DATETIME DEFAULT NULL
);
INSERT INTO posts (title,body,created)
VALUES ('The title', 'This is the
You can also try this :
http://othy.wordpress.com/2006/05/12/othauth-02-released/
tom wrote:
Hi,
I'm very experienced with PHP and somewhat experienced with CakePHP.
I'm interested in building a simple app, but one of the things that I'm
not sure how to do is user authentication. Is there
What needs to be changed?
(btw: I think we need to check out the manual to see why some of the
view code is missing carriage returns. Some views are still getting
rendered as a single line on the manual site.)
-- J
On May 12, 2006, at 3:50 AM, gwoo wrote:
Check out
On May 11, 2006, at 6:21 PM, tom wrote:
I'm trying it out right now, and so far...
in the last code sample, $this-checkAccess(); should probably be
$this-checkSession();
Good eye... good eye.
Thanks!
-- John
--~--~-~--~~~---~--~~
You received this message
I need to write a csv data export function for use in my admin pages,
and was wondering if anyone had tackled this already? I have a simple
version working for a single table, the problem come when I try to
export a table with belongsTo relationships, some of those which have
belongsTo, etc.
This is sort of off topic, other than the fact I am developing in the cake framework.I need to import data files exported by Loan Origination software. There are several different formats, one is space delimited and another is XML based.
I have two questions.1) Does anyone have experience
I don't expect cake to know about the formats. I am writing that code.I was wondering if someone has some tips about writing it within the cake framework so I had a headsup if there are some tricks that make it easier or pitfalls that I should steer clear of.
I have imported some basic files into
make a component
--~--~-~--~~~---~--~~
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
I also faced this issue and the only solution I found was to use a
custom query. That is I created a funcion in the model that queries the
database for the enum values and creates an array based on it:
function generateDifficultyList() {
$ret = $this-query(SHOW COLUMNS
Say that I've got a requests table, a staff table and a join table named
assignments. In addition to request_id and staff_id, assignments contains a
role field. Once I set up the hasAndBelongsToMany associations between
requests and staff, how would I pull up the role field? Is this
If you figure this out, please post the solution, I have a very
similar situation, Counselors, Rooms, and Room Assignments that have
start time and end time, I haven't found a great way yet, except just
using the query() command and writing the sql myself.
I tried this and it did not work in Version 1 of Cake, don't know why,
but it just did a basic hABTM select and didn't use my SQL statement to
get the extra data in my join table.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
No replies? I guess I'm imagining things then and this isn't
supported by cake?
To help make this topic a better reference source should future people
have a question on this, use the following code in your model:
function getMyEnum()
{
I'd run a normal Cake HABTM query, with DEBUG turned to 3.
Take the query Cake is using for its vanilla HABTM fetch, and tweak
it to your liking before specifying it as the finderSQL for your
association.
-- John
On May 12, 2006, at 1:16 PM, [EMAIL PROTECTED] wrote:
If you figure this
Wow, we cross-posted.
Looks like your approach is basically the same as mine.
:)
--~--~-~--~~~---~--~~
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
In Cake v1
I have Model 1
I have one single method, index(), that uses simple findAll() to return
data for Model 1.
If I set $uses = array('Model 2') in my Model1Controller class, I get:
Call to a member function on a non-object in the line that runs
$this-findAll();
there are no
Perfection. I'd been wondering how to recover the default SQL statement for
tweakage. By the way, where does one set DEBUG?
David
[EMAIL PROTECTED] 05/12/06 3:20 PM
I'd run a normal Cake HABTM query, with DEBUG turned to 3.
Take the query Cake is using for its vanilla HABTM fetch, and
:o)
/app/config/core.php
This is a pretty basic question - make sure you guys are at least
trying to find this out for yourselves before asking. If you already
did, kudos to you.
-- J
On May 12, 2006, at 1:24 PM, David Spitzley wrote:
Perfection. I'd been wondering how to recover the
sorry, I found it right after I posted in haste.
What i discovered is that Cake is running a bunch of queries, it gets
the data from the first table, then loops through and queries the
second and third table joined together, using the id from the first to
filter the data.
Even when I pass in my
I found a problem in the documentation, it says you pass in your own
SQL as the 'finderSql' parameter in the hasAndBelongsToMany array, but
it really needs the 'finderQuery' parameter, that is why I could not
get it to work.
--~--~-~--~~~---~--~~
You received
I two models, properties and regions. Each property belongsTo a
region, and each region hasMany properties. When I'm creating a new
property, I need to have a selectTag that allows the user to select
which region their property belongs to, but I can't figure out how to
get all of the regions
OK, I figured this out, though I'm not too thrilled with the solution.
It turns out the recursive functionality is very particular as to what
you name your hasMany relationship.
My Workflow hasMany relationship for Step was named Step. When I
renamed it to step, suddenly all my steps where
I was following the blog tutorial and even went so far as to start over
and copy/paste the code to try to get it to work right. To no avail. I
keep getting an error:
No Database table for model Post (expected posts), create it first.
or if I play with the singular/plurals in the model I get:
rdBloggery does this.
http://cakeforge.org/projects/rdos
--~--~-~--~~~---~--~~
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,
What blog tutorial?
http://manual.cakephp.org/chapter/18
This one?
And the error you've linked to has to do with view code that is
rendering, not a missing model error message...
*confused*
-- John
On May 12, 2006, at 2:08 PM, modmans2ndcoming wrote:
I was following the blog tutorial
yep they areOn 5/12/06, David Spitzley [EMAIL PROTECTED] wrote:
Am I correct that Associations need to be symmetric between Model files?In other words, if I define A hasMany B or A hasOne B, then I must also define B belongsTo A?And if A hasAndBelongsTo B then I must also state B hasAndBelongsTo
Is there any documentation on how to use the library? I read through it, but I can't really figure it out heh -- php newbOn 5/12/06, gwoo
[EMAIL PROTECTED] wrote:rdBloggery does this.
http://cakeforge.org/projects/rdos
--~--~-~--~~~---~--~~
You received this
Well, What else could it be? I copy and pasted everything from the
blog, the index page that comes with cakephp says I am connecting to
the database, I really do not know what else could be wrong except for
something in the code in the tutorial.
the table should be named posts
the controller should use the plural, posts_controller.php and then
PostsController extends AppController
the first line inside your controller should be var $name = 'Posts'
the model should be Post
the first line inside your model should be var $name = 'Post'
I don't get it, I have tried everything to get both $html-selectTag
and $model-generateList to work correctly, I can't get either to work.
I tried this:
echo $html-selectTag('test',array('1' = 'value1','2'='value2');
No matter what data I send to $html-selectTag, I get:
Notice: undefined
Hi, I'm working on making a nice input field for a certain Model, and
it has a hasOne association to another type of data (and vice versa,
that data has a belongsTo relationship). Is there a quick way to make
that nice dropdown menu that the scaffolding provides? Like, where the
values of the
Wait, so do you call generateList() on the model that you're using, or
the model which it is associated with?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send email to
I've run into the same problem. The closest thing I've found is the
requestAction() function of the Controller object (I'm using 1.0).
Trouble is, requestAction() doesn't seem to load the JavaScript which
is problematic if you're doing AJAX.
Ideally, the Controller::redirect() method would
OK, I fixed the problem. I think the issue was the name of my model
file. It was post.php, and I renamed it as Post.php I now get the table
of the entries.
new problem though. I get warnings at the top of the page and I do not
understand what they mean:
Warning:
chmod the app/tmp/* directories to world writable.And the fix you found for you other problem was not the answer. We do not use capitals in file names.-- /*** @author Larry E. Masters
* @var string $userName* @param string $realName* @returns string aka PhpNut* @accesspublic*/On 5/12/06,
The one it is associated with.
--~--~-~--~~~---~--~~
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
that did it thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For
49 matches
Mail list logo