On Dec 12, 7:31 am, abba bryant <[EMAIL PROTECTED]> wrote:
> The right way to do this would be to have 3 models each of which uses the
> same table ( letter_contents )
> with the correct conditions defined ( see finderQuery ) or place the
> conditions within the Letter model's
OR consider scaff
On Dec 12, 7:23 am, Mr-Yellow <[EMAIL PROTECTED]> wrote:
> Lets say I want.
>
> Foo = 1
> AND
> Bar = '2'
> AND
> (Cat LIKE 'a%' OR Cat LIKE 'b%' OR Cat LIKE 'c%')
>
> Tried just about everything.
I am pretty sure you didn't try:
$constraint['FooModel.FooField'] = 1;
$constraint['BarMo
Or even better.. copy the page_controller from the cake core to your
controllers folder and *gasp* give a $uses array..
Then you dont have those pesky dispatcher calls. If your application doesn't
have a great need for requestAction then you should avoid it. I even write
my elements / requestAct
The right way to do this would be to have 3 models each of which uses the
same table ( letter_contents )
with the correct conditions defined ( see finderQuery ) or place the
conditions within the Letter model's relationships.
[EMAIL PROTECTED] wrote:
>
>
> I considered option 2 as I believe
try findByUgroupId
On Dec 11, 10:08 pm, Sanfly <[EMAIL PROTECTED]> wrote:
> Hi
>
> Ive only just started mucking around with CakePHP, and am having a
> little trouble getting my head around the controllers and models
> thingees. YES - I have tried looking in the manual!!
>
> Im trying to make a
Lets say I want.
Foo = 1
AND
Bar = '2'
AND
(Cat LIKE 'a%' OR Cat LIKE 'b%' OR Cat LIKE 'c%')
Tried just about everything. How can it be this hard??? Why are
there so many users not able to get queries to work in so many
situations? Does it mean the overall design of the query construtor
Hi
Ive only just started mucking around with CakePHP, and am having a
little trouble getting my head around the controllers and models
thingees. YES - I have tried looking in the manual!!
Im trying to make a cake website that will more or less mirror some
normal-non-framework php sites I have d
Just want to say that I adore this framework. When I launch a
successful site with Cake, I will donate $100 of my first $500 made,
and that's my word.
On Dec 11, 10:15 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Dec 11, 2007 10:11 PM, 703designs <[EMAIL PROTECTED]> wrote:
>
>
>
> > Oh wow
http://tempdocs.cakephp.org/#TOC70554
This says " The $conditions should be formed just as they would in an
SQL statement"
Is the new way of doing it just pure SQL without all this array
garbage that doesn't really work?
-Ben
On Dec 12, 4:02 pm, Mr-Yellow <[EMAIL PROTECTED]> wrote:
> https://
https://trac.cakephp.org/ticket/1674
This is a great idea, much better then the current confusing, limited,
exploitable implementation.
Saying "Coders should always add =" "worksforme" doesn't make it any
more secure or usable.
Coders don't know to do so, no amount of education will fix it.
Wai
Needed to use 'DISTINCT Pack.PackID' hack too.
What does the unique attribute do in models,? Can't find it documented
anywhere.
-Ben
On Dec 12, 12:44 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On Dec 11, 2007 7:46 PM, jon <[EMAIL PROTECTED]> wrote:
>
>
>
> > I know what you mean. I've sp
I have a problem with my session whenever I do an ajax call.
When I do single ajax calls, I do not have a problem at all. It works
perfectly fine.
Session will expire after 20mins. As per normal.
But when I do 2 simultanous ajax calls, my first ajax call will
succeed but my second reply is a "se
On Dec 11, 2007 10:25 PM, Mr-Yellow <[EMAIL PROTECTED]> wrote:
>
> As for writting CakePHP I think that would be better left to those
> with an eye on the direction and conventions of the project, those who
> should realise this is a feature at the basis of being able to use
> CakePHP for DB a
The new "with" attribute seems to go some way to fixing it, however
the functionality has changed since first included and the tutorials
out there are dated.
If you include a model for your HABTM "with", then query that model.
Sorry for the non-naming convention tables, from older legacy system.
On Dec 11, 2007 10:11 PM, 703designs <[EMAIL PROTECTED]> wrote:
>
> Oh wow, I'm dumb. I wrote index.thml! Anyway, the blog tutorial should
> tell users to do a chmod -R 777 to the app/tmp directory, since
> there's a permissions issue otherwise.
That info (the permissions stuff) is in the manual'
Oh wow, I'm dumb. I wrote index.thml! Anyway, the blog tutorial should
tell users to do a chmod -R 777 to the app/tmp directory, since
there's a permissions issue otherwise.
On Dec 11, 10:00 pm, "Louie Miranda" <[EMAIL PROTECTED]> wrote:
> Oh, sorry. Didn't read up to the end. It might be mod_rew
I do:
AllowOverride All
And I know this is the correct httpd.conf on my Mac, since the change
I made to DocumentRoot worked:
DocumentRoot "/Library/WebServer/Documents/cake/app/webroot"
and my CakeBlog folder which was symlinked to cake in the path above
now is properly mapped to http://l
Oh, sorry. Didn't read up to the end. It might be mod_rewrite is not
working. Although, you where able to access localhost/posts and gives you
that error.
Check again
On Dec 12, 2007 10:58 AM, Louie Miranda <[EMAIL PROTECTED]> wrote:
> Please review the error.
>
> *It says..*
>
> > returns "Miss
Please review the error.
*It says..*
> returns "Missing View: Fatal: Confirm you have
> created the file : /Users/myusername/Sites
> >
> > /CakeBlog/app/views/posts/
> > index.thtml"
>
>
Create a index.thtml on /app/views/posts/index.thtml
HTH
Louie
On Dec 12, 2007 10:45 AM, 703designs <[EMAIL
sounds like you do not have allow override set to true in your apache
config file
Sam D
On Dec 11, 2007 7:45 PM, 703designs <[EMAIL PROTECTED]> wrote:
>
> I've been plugging along with the little 15 minute blog tutorial, and
> I can't even view my Posts view. Here's what happens:
>
> http://loca
I've been plugging along with the little 15 minute blog tutorial, and
I can't even view my Posts view. Here's what happens:
http://localhost/ works fine
http://localhost/posts returns "Missing View: Fatal: Confirm you have
created the file : /Users/myusername/Sites/CakeBlog/app/views/posts/
index
I searched through the list and could not find anyone having this
specific issue.
I am using 1.2 (not exactly sure what version, but not pre-beta). I
have a table of content pages, which includes a parent_id field. I am
trying to pull a threaded array like this:
$test = $this->findAllThreaded(ar
I totally agree with that sentiment. But remember, this was meant to
be as quick and dirty as possible, with the caveat that it's NOT the
place to do anything super sensitive. As I was building this to fill
my own need, I knew I didn't want to go through the hassle of logins
and passwords. Auto-ge
But I forgot to mention I use PHPUnit and HTTPUnit (Java)
On 12 dez, 00:29, "Dérico Filho" <[EMAIL PROTECTED]> wrote:
> When you bake using bake.php it offers you to bake also the test
> scripts.
>
> It's just a matter of using them, I guess.
>
> On 11 dez, 19:47, Andrew Assarattanakul <[EMAI
When you bake using bake.php it offers you to bake also the test
scripts.
It's just a matter of using them, I guess.
On 11 dez, 19:47, Andrew Assarattanakul <[EMAIL PROTECTED]> wrote:
> Curious to what you guys think about this different way of developing?
>
> I bring up this question because I'
On Dec 11, 2007 7:46 PM, jon <[EMAIL PROTECTED]> wrote:
>
> I know what you mean. I've spent three days to solve a problem that's
> three lines of regular PHP code and still no solution. Apparently
> CakePHP 'just works!' so doesn't need documentation. Yeah, well if it
> works, it's on minimum wag
I know what you mean. I've spent three days to solve a problem that's
three lines of regular PHP code and still no solution. Apparently
CakePHP 'just works!' so doesn't need documentation. Yeah, well if it
works, it's on minimum wage and giving surly customer service! And
except for those days whe
Hi.
Thanks for your help before, everyone... This one's just a quick
question. I'm pretty sure the answer's "just make the new model and
stop being lazy", but I'd like to make sure just in case.
I've got a project with a has-and-belongs-to-many relationship,
linking a products table to a feature
Hacking the core really wouldn't do it for me, I guess the only proper
way to use Cake is with hardcoded queries.
As without this simple ability I'd rate the database abstraction as
"broken".
Has it really be a year since the bug was posted???
Nothing?
Am I choosing the wrong framework?
-Ben
If I call Model->create and then Model->getLastInsertID
Will I get the last inserted Id or I must actually create a db record
before calling getLastInsertID?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP"
should I just create my own table and not try for the HABTM
association?
--~--~-~--~~~---~--~~
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 unsubscrib
Curious to what you guys think about this different way of developing?
I bring up this question because I've been given the task to start
using BDD for an existing project that is using CakePHP v1.1 and
cannot move forward to v1.2 until it is officially released and
stable.
All that I could find
I tried something just like that yesterday:
$user = $this->requestAction('mshows/edit/5');
It did not work for me, it does not process the id = 5 and send back
the data
even though that works if you type mshows/edit/5 in the address bar.
You have to fetch the data in your controller and send it
OK guys here's one to stump you:
My form is on a page where the bulk of the page is for tv listings, so
the URL for the page is like this: www.mydomain.com/listings/view/
At the top of the page is the main view of the listings, the main
feature of the page, but one we're not interested in for th
Hi guys
I'm a new baker, I guess I'm better at cooking.
I tried to use the upload behavior 1.3 ( http://bin.cakephp.org/saved/21813#
) but it didn't upload anything. There are no debugging messages or
errors either, so I dont know what else to do. I tried using other
versions of this behaviour a
Hi All,
I assumed that you could use variables set in an action in a
beforeRender function because it is called after the controller action
but I guess I am wrong. is there a way to pass a variable to
beforeRender? Here is my code:
function beforeRender()
{
if($id){
$cu
It says it was replaced by: Model::deconstruct()
But the functionality is different. Doing a direct call didn't work for me.
Even if it did, there's another issue with the latest version not saving
dates and times to the database. I think I'll just hold up on the SVN for
now. At least until they
Hi all,
I have an HABTM relationship between tables named Users and Notes. I
only want to populate the join table when a note is sent to a user.
The join table will be used to determine which users have permission
to view which notes. Because both the note record and the user record
are already
I have two list box (A and B), and I have two buttons to move list
items (options)
from this box to the other.I have a submit button to submit the form.
I know how to move items from A to B by using Javascript, and I know
how to use to select an item.
However, how can I select an item after the
Also, form->input gives you a label also.
On Dec 11, 2007 9:36 AM, grigri <[EMAIL PROTECTED]> wrote:
>
> FormHelper::text() just generates the markup for a single input field.
>
> FormHelper::input() can generate any type of input field (text,
> password, textarea, select, radio, ...) which can b
Yeah, I saw that...
And I also saw something that said this is called through Model::set().
But, I'm still lost as to how to use it.
Also, what I did was I got the latest SVN and I just did a bake on a simple
database with a date field. Long story short, it doesn't work.
I think I'll just stick
Well, it's hard to provide an answer like this..
Can you paste some code and explain to us what are trying to achieve?
If you're inserting text and there is something else that needs to be
unique, you will need a custom validation rule for your Model.
On Dec 11, 12:58 pm, chowdary <[EMAIL PROTEC
Model::deconstruct() I think
http://api.cakephp.org/1.2/class_model.html#0198f3999e2942f8e82db80fc9e19c30
:)
Sam D
On Dec 11, 2007 8:33 AM, Gwoo <[EMAIL PROTECTED]> wrote:
>
> What does it say cleanUpFields() was replaced by? Maybe you could use
> that
>
> >
>
--
(the old fart) the adv
did you try:
layout = 'error'; ?>
in your error404.thtml ?
On 11 déc, 15:37, grigri <[EMAIL PROTECTED]> wrote:
> how about
>
> class AppController extends Controller {
> function beforeRender() {
> if ($this->viewPath == 'errors') {
> $this->layout = 'error';
> }
> }
>
> }
>
> O
On Dec 11, 5:12 pm, Paolo <[EMAIL PROTECTED]> wrote:
> HI!
>
> I'm trying to delete a row from a model, using
> Modelname->del($id)
>
> But I receive the error
>
> SQL Error: 1052: Column 'id' in where clause is ambiguous
>
> Why is this happening? How can i solve itP?
>
> Thanks
How about show
HI!
I'm trying to delete a row from a model, using
Modelname->del($id)
But I receive the error
SQL Error: 1052: Column 'id' in where clause is ambiguous
Why is this happening? How can i solve itP?
Thanks
--~--~-~--~~~---~--~~
You received this message because y
Yes, as long as your helper is in the app/views/helpers directory, and
not inside the cake core libs.
As to actually loading the helper (if it's not already loaded)... If
you're on 1.2 pre-alpha you would use:
loadHelper('Form');
or if you're on bleeding edge 1.2 branch:
App::import('Helper',
I guess it depends on how you choose to develop. Personally I keep a
separate copy of cake for every single site that I create. This means
I don't have to worry about backwards compatibility for each site
every time I want to use a new version of cake. Some people who are
using *nix might use a te
http://cakephp.org/screencasts
Setting up the console should help.
--~--~-~--~~~---~--~~
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
FormHelper::text() just generates the markup for a single input field.
FormHelper::input() can generate any type of input field (text,
password, textarea, select, radio, ...) which can be auto-detected
from the model's schema, or user-defined. It also adds a wrapper div
and error message, if want
What does it say cleanUpFields() was replaced by? Maybe you could use
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 unsubs
Hi Everyone,
Question about $form helper. What's the difference between input and
text?
I have validation for fullname field in user model:
'fullname' => array(required' => VALID_NOT_EMPTY)
Input in view:
input('User.fullname', array('value'
Slightly.
Sorry, I'm new to all of this. I just realized that I need some software to
download from the branches.
I do have a question though. What do you do when you update and stuff
doesn't work, just roll back?
For eg. Saving datetime fields to the database no longer works.
On Dec 11, 2007 4
Thanks for your reply.
--~--~-~--~~~---~--~~
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]
Hi I have done the same changes
but now I am facing new error.
please help me the error is as below
Undefined variable: form [CORE\app\views\notes\add.thtml, line 5]
Regards
Sushant Danekar
On Nov 19, 3:04 pm, smilin <[EMAIL PROTECTED]> wrote:
> Thanks francky,
>
> I had come out from this issue
Hi, I have some code looking like http://bin.cakephp.org/view/11696180
Basically, my Configuration model aliases an associated Mtie model to
ExceptionMask.
In implementing Mtie::afterFind($results) I discovered that $results
uses the alias ExceptionMask instead of the model name Mtie, as would
be
Copy and paste the error layout (error404.ctp/thtml) from the cake
core library directory into your app/views/errors/
and then customize it as you like.
hth
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP"
how about
class AppController extends Controller {
function beforeRender() {
if ($this->viewPath == 'errors') {
$this->layout = 'error';
}
}
}
On Dec 11, 2:25 pm, BoSc <[EMAIL PROTECTED]> wrote:
> I found that changing the layout in error.php (errorHandler class)
> does seem to
I found that changing the layout in error.php (errorHandler class)
does seem to work. This doens't seem like good-practice though...
Any simpler solutions?
On 11 dec, 11:40, BoSc <[EMAIL PROTECTED]> wrote:
> When calling a 404 error with:
>
> $this->cakeError('error404',array(array('url'=>'/')))
I recently had this idea which might be the BETTER way to send out
Emails using CakePHP.
http://www.gigapromoters.com/blog/2007/12/11/a-better-way-to-send-emails-than-cakephps-default-email-component/
Looking for your feedbacks..
--~--~-~--~~~---~--~~
You received
In one of the latest SVN versions of CakePHP this seems to have been redone.
It now returns:
['to']['year']
['to']['month']
['to']['day']
cleanUpFields is gone. It should be done automatically through the model,
BUT I can't get it to save to the database. Out well.
On Dec 5, 2007 9:51 PM, Baz <[E
I just copied a model across from another project and added the
dbconfig to the config file under a different key.
Code + SQL here : http://openpaste.org/en/4255/
(I always have a 'playground' cake app setup on my local machine for
various testing and experimentation)
On Dec 11, 1:38 pm, Zwift
Can you paste here your SQL Dumb, and models code
I just don't understand whats going on here?
Or did you used my above example??
Hell...
Darkness...
On 11 Gru, 14:11, grigri <[EMAIL PROTECTED]> wrote:
> I just ran a quick test (I've never actually needed to have more than
> one db config for
I just ran a quick test (I've never actually needed to have more than
one db config for the same app so far) and it works fine, even without
the external bit.
It seems completely transparent, and it's only seeing the sql logs
that you realise it does a separate query, not a join, for the
external
But how do I define the layout that CakePHP should use for the
template error404.thtml
On 11 dec, 12:37, powtac <[EMAIL PROTECTED]> wrote:
> If You create a custom 404 layout, take care that an 404 code by HTTP
> is provided.
> This can be done by "header("http/1.0 404 not found");"
>
> To preve
You should use the redirect after post pattern, using a HTTP 302 or
303 status code after saving your fields.
if($this->Model->save())
$this->redirect($url, $code, $exit);
On Dec 11, 12:58 pm, chowdary <[EMAIL PROTECTED]> wrote:
> i am validating the data b4 inserting. but the data type is
After some researching I just need to know - is it even possible???
Many people (on IRC) says: yes, sure
But hell I cannot make it work even with simples User <-> Profile
associacion (from tempdocs)
On 11 Gru, 11:56, Zwift <[EMAIL PROTECTED]> wrote:
> I think nothttp://api.cakephp.org/1.2/libs_2m
I would like to know how get my own data set. For example in my
database relationships model Item hasMany Comment, Comment has set
relation belongsTo User. When I try:
$comments = $this->paginate('Item.Comment');
I do not get data what I need. My problem is like in ticket:
https://trac.cakephp.org
Create a session variable and set it to false. Have your page check
the session variable every time it loads. If the session variable is
false, save the data and set the variable to true. If it is true,
don't save the data.
I could be more specific, but I don't know exactly what you are
doing.
i am validating the data b4 inserting. but the data type is text..
the text will not be unique...
explain me clearly...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this g
You should set some validation rules for your Model, and setup a
custom rule to check whether the submitted data is already in the
database, OR implement Model::beforeSave()
Hope that helps,
dr. H.
--~--~-~--~~~---~--~~
You received this message because you are sub
If You create a custom 404 layout, take care that an 404 code by HTTP
is provided.
This can be done by "header("http/1.0 404 not found");"
To prevent errors you can use something like this:
if(!headers_sent) {
header("http/1.0 404 not found");
}
--~--~-~--~~~---~-
I am developing a PHP-mysql database. It is noted that when the
browser window is refreshed the data is inserted again in the
database. unfortunately there is no unique keys that I can use to
verify the existance of the data, so as to prevent the multiple
insertion.
--~--~-~--~~---
hi
I had a similar problem. But I took another approach. I added
afterFind function in my model. AfterFind gets called after every
query and there I have the rule to calculate full name..below is a
sample code
function afterFind($results)
{
foreach ($results as $key => $val)
I think not
http://api.cakephp.org/1.2/libs_2model_2model_8php-source.html (from
line 260)
On 11 Gru, 11:44, grigri <[EMAIL PROTECTED]> wrote:
> If your models are using different datasources you have to set the
> 'external' attribute in the association (I think).
>
> On Dec 11, 9:28 am, Zwift <[
I've simplified it
/*
MODELS
*/
class LocalNumber extends AppModel {
var $useDbConfig = 'prepaid';
var $name = 'LocalNumber';
var $hasOne = 'LocalAccount';
}
class LocalAccount extends AppModel {
var $name = 'LocalAccount';
var $belongsTo = array(
If your models are using different datasources you have to set the
'external' attribute in the association (I think).
On Dec 11, 9:28 am, Zwift <[EMAIL PROTECTED]> wrote:
> 2 Models
> FIRST:
>
> class LocalNumber extends AppModel {
> var $useDbConfig = 'prepaid';
> var $useTable =
When calling a 404 error with:
$this->cakeError('error404',array(array('url'=>'/')));
How do I set the layout for the error404.thtml. It tends to use the
default.thtml layout, but I would like to change this!
--~--~-~--~~~---~--~~
You received this message because
Thanks snowdog... which class offers cakeError as a method? I couldn't
find this in the API.
Another question... is it possible to set a custom layout for the
error404.thtml file?
On 11 dec, 10:58, snowdog <[EMAIL PROTECTED]> wrote:
> I use something like this (cake 1.2 prebeta):
>
> $this->cake
Baz...
I update to the 1.2.x.x trunk every so often and use for production
sites. It's generally considered stable enough to use.
https://svn.cakephp.org/repo/trunk/cake/1.2.x.x
I also have the 1.2.x.x branch repository checked out from:
https://svn.cakephp.org/repo/branches/1.2.x.x
I generally
I use something like this (cake 1.2 prebeta):
$this->cakeError('error404',array(array('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@goo
2 Models
FIRST:
class LocalNumber extends AppModel {
var $useDbConfig = 'prepaid';
var $useTable = 'cards';
var $primaryKey = 'number';
var $displayField = 'number';
var $name = 'LocalNumber';
var $recursive = 2;
var $hasOne = array(
Hi,
I was wondering, what is the correct way to call a 404 Error from
wihtin a controller?
The situation is this: I use pretty urls (for SEO) to let the user
navigate through my site. When the controller is called to show an
appartment, 4 parameters are passed. The first thing I do is check
that
Yeah this is one that has plagued me too. I found some code for a workaround
by defining a simple extra association in your model, and requiring some
small changes to the model::find method that can be implemented in your
app_model. I found this code in the bakery I think, modded it a bit though
t
try this:
$this->Author->generateList(null, null, null, null,
"{n}.Author.last_name {n}.Author.first_name");
On Dec 11, 2007 9:46 AM, aniston <[EMAIL PROTECTED]> wrote:
>
> Just an indicator that might help you, its an example on db column
> merging with concat
>
> http://groups.google.com/gro
85 matches
Mail list logo