Hi,
I'm not able to make containable fully work.
I have a A with many B and I want to find A with their B but only few
fields.
Here is what I did :
$this->set('A',
$this->A->find('all', array(
'conditions' => array ('A.id' => $id),
'fields' => array('id'
i have to do add multiple rules to a from field. the website has i18n
support so that the error message will be displayed in Chinese when
the users view Chinese version of the website. The website is
developed in big5 but not utf-8. I have to set the error message with
"escape=>false" to make disp
I don't know if it realy is a bug, but when I do this sequence of
operations:
$this->MyModel->findById($id);
$this->MyModel->create();
$this->MyModel->save($this->data);
the "created" column is filled with NULL!
Is it wrong to do those operations like that? (I realy dont think so)
If I save it
Ok, finally fixed it.
Like I said before:
"And btw, I did find a way to give the browsers the css-files it
needed
from tinyMCE, but then there were the images that're used in the css-
files which still didn't work."
So I "disabled" that fix to search for another one. This morning I
just "enabled"
Hi there! I having some problems trying to call a java script from the
action's forms.
- What I need is something like this:
what I got is this:
- my php code is:
login.ctp (file):
e($form->create(array('action' => 'javascript:parent.doForm();')));
how can I call the javascript using the "f
I'm completely new to cakePHP and OOPs
I am tryinging to customize the translate() function in cake\libs
\i18n.php
How can I override the method translate() in my own model.
need urgent pointer on this.Please help if you have any ideas
--~--~-~--~~~---~--~~
You
This is how I worked out saving not directly related data using
saveAll in one single Ajax call:
I send the data exactly the same, as in this discussion's first
message, with the non directly related model INSIDE the directly
related model (SectionParts INSIDE data[Section])
data[Denouncement][t
Plassseee
--~--~-~--~~~---~--~~
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
cake-php+unsubscr...@goo
Have a look at this post from Teknoid:
http://teknoid.wordpress.com/2008/10/16/how-to-validate-habtm-data/
On Tue, Apr 28, 2009 at 7:46 PM, Dave Maharaj :: WidePixels.com
wrote:
>
> Trying to validate in controller before saving with this:
>
> $this->User->$model_name->set($this->data);
>
On Tue, Apr 28, 2009 at 7:35 PM, geste wrote:
>
> Brian,
>
> Personally, I'll take your response to mean "I'm not out of my
> mind".
I'm not sure what you mean but I don't think either of us are out of
their mind. :-)
> Yes, time to leave scaffolding behind, but there were some helpful
> (and n
Trying to validate in controller before saving with this:
$this->User->$model_name->set($this->data);
debug($this->data);
if ($this->User->$model_name->validates()) {
debug($model_name);
$test = 'Vali
On Apr 28, 4:00 pm, brian wrote:
> On Tue, Apr 28, 2009 at 6:41 PM, geste wrote:
>
> > I started a project with a bunch of preliminary scaffolded views and
> > those were find for helping us through data structures and
> > relationships. They also all included some nice defaults -- would
> > s
On Tue, Apr 28, 2009 at 6:41 PM, geste wrote:
>
> I started a project with a bunch of preliminary scaffolded views and
> those were find for helping us through data structures and
> relationships. They also all included some nice defaults -- would
> show "name" by default for a foreign key "id"
I started a project with a bunch of preliminary scaffolded views and
those were find for helping us through data structures and
relationships. They also all included some nice defaults -- would
show "name" by default for a foreign key "id" in index and "view"
views. But it was clear I had to mo
On Apr 25, 9:52 am, "rich...@home" wrote:
> I downloaded the 5.1 Beta OSS and installed the plugin.
>
> Created a schema no problems, but only for copying to the clipboard
> (no biggy tbh) :-)
>
Are you using Windows XP? I only get garbage characters on *any*
plugin that uses the copy to clipbo
Solved. I just noticed that ItemFile::beforeDelete() did not return true;
On Tue, Apr 28, 2009 at 5:01 PM, brian wrote:
> I'm using $this->Item->del($id, true) in ItemsController. I expect
> that its ItemFiles would also be deleted but they are not. I've
> compared my models with the examples in
I am doing something and want to know if I am going about it the right way.
I baked an application, and for Users which has a few HABTM tables but did
not bake HABTM model or controllers. (the users_systems controller or model
for example)
Now in the Users edit function i turned all the select op
I'm using $this->Item->del($id, true) in ItemsController. I expect
that its ItemFiles would also be deleted but they are not. I've
compared my models with the examples in the book several times and
plodded through the source and I've no idea what the problem is.
Anyone else think of something?
cl
I'm creating a plugin with a model that doesn't use a table. My model
looks like this:
In spite of having $useTable = false, I get a missing table error for
my model. Does anybody know what I'm doing wrong?
Error: Database table adauthusers for model Adauthuser was not found.
Thanks!
hydr
I have tables: users, sounds, votes.
- users hasmany votes
- sounds hasmany votes
- votes has fields: id, user_id, sound_id
This setup gives me the ability to have users vote for sounds, and to
keep the info about who voted for what (though maybe this is not a
good way to do it, if so, please cor
Hello, thanks Martin.
I reviewed saveAll() docs and it explicitly tells it wont work for not
directly associated models.
(http://book.cakephp.org/view/75/Saving-Your-Data)
It would be nice for a future version of cake to have it though. Where
does one submits this kind of "petitions" to cake dev
Hi Keyur
You need to define define 'big application' - Number of tables, rows,
users, connections (bandwidth) or all of the above?
For large numbers of tables, Containable is your friend. For the
others, Cake is unlikely to be your primary cause of concern. Good
database design and a replicatio
Basically I am trying to do 2 things with it now.
Check for duplicates (would only happen if someone changes the values in the
form with Firebug or something)
And
Check the submitted values against the values in the database.
I added a query to get the values that are possible
$test = $this->Us
Just create a validation rule pointing to a method in the System
model. Fetch the values from the table and compare to whatever was
submitted.
On Tue, Apr 28, 2009 at 2:48 PM, Dave Maharaj :: WidePixels.com
wrote:
>
> Ok I see now array_unique($this->data[$model_name][$model_name] removes
> dupl
I don't know why the save isn't happening but you shouldn't have the
array_unique() in the if test because that just returns the modified
array. If you're more interested in testing whether the array has
dupes, rather than simply removing them, I think you'd have to do
something like:
if (sizeof(
Ok I see now array_unique($this->data[$model_name][$model_name] removes
duplicate values.
My question now expands as I keep testing edited values with FireBug
Example my checkbox values range from 1 - 15. I can edit the value to 999
which there is nothing for and check the table and sure enough
Ok right onseems to get me started.
I have this in my controller but if there is a duplicate its not saving
which is what I want) but skipping past the }else{
Ideas what i am missing?
if (!empty($this->data)) {
$san = new Sanitize();
$this->data['System']['System'] = array_unique($this->data['System']['System']);
On Tue, Apr 28, 2009 at 1:33 PM, Dave Maharaj :: WidePixels.com
wrote:
>
> I have modified my form value using Firebug and I get this array (which
> should never happen unless someone has edited the form and tried s
I have modified my form value using Firebug and I get this array (which
should never happen unless someone has edited the form and tried submitting
the altered values)
How could I create a quick 'check the values' function for duplicates to see
if someone was trying to mess with the site?
Arra
Sorry, make that preg_match_all(). From the manual:
PREG_SET_ORDER
Orders results so that $matches[0] is an array of first set of
matches, $matches[1] is an array of second set of matches, and so on.
http://www.php.net/manual/en/function.preg-match-all.php
On Tue, Apr 28, 2009 at 1:06 PM, Kyle
What does PREG_SET_ORDER do exactly? When I use it I get a " Invalid
flags specified" error. Thank Ideas?
On Apr 28, 12:11 pm, brian wrote:
> This should match the URL followed by anything other than whitespace
> or double quote.
>
> $pattern = '/(http:\/\/twitpic\.com[^\s\"]+)/';
>
> preg_match
I been using debug(); all over my controller action to see where these
queries are coming from.
I have an element that gets loaded into a div on the page (7 queries) ,that
element has "edit" Ajax update link that loads a Ajax form in its place ...
(15 queries) click 'save' and presto 94 queries.
Hey,
your $content_for_layout is filled by your view, which is called via
controller/action.
If you want your domain.tld/ to go to specific controller/action instead of
/pages/display/home you need to create a routing rule (see book for this).
The file is here: APP/core/routes.php
If you want to
This should match the URL followed by anything other than whitespace
or double quote.
$pattern = '/(http:\/\/twitpic\.com[^\s\"]+)/';
preg_match($pattern, $str, $matches, PREG_SET_ORDER);
debug($matches);
On Tue, Apr 28, 2009 at 7:54 AM, Kyle Decot wrote:
>
> I know this isn't specifically a
Hi,
I am new in cakePHP (for about two days now). I think I got a pretty
good understanding about the MVC concept. I saw the blog tutorial and
followed every step and also followed the same recipe expample. Now I
wanted to create my own application and before building all pieces of
it, I wanted t
Hopefully this will be a one time thing :) I was just wondering if my
approach for handling errors could have been improved. I guess it's
simpler to know which model to include/exclude.
Thanks for pointing out the typo.
SpecialModel is a wrapper model (like AppModel) that I have to use
accross s
Add 'allowEmpty' = true for number.
On Tue, Apr 28, 2009 at 9:31 AM, Jonathan wrote:
>
> In a model, I have a validation like the following:
>
> var $validate = array(
> 'name' => array('notempty'),
> 'number' => array(
> 'notempty'=>array('rule'=>'notempty', 'message'=>'Number must be
> sp
Is this just a one-time thing? Wouldn't it be simpler just to list the
models you need to access?
You have a typo, also: "SpecialModal". What's SpecialModel for, anyway?
On Tue, Apr 28, 2009 at 8:23 AM, Pixelastic wrote:
>
> Sorry, hit 'Send' too early...
>
> The code I'm using is :
>
> $appMod
I am trying to replace a read() with my own find statement.
I am running them both to see the results they produce. The $model_name is
dynamicaly added so i can contain the specific model needed for this specic
function depending on the action)
$this->data = $this->User->read(null, $id);
In a model, I have a validation like the following:
var $validate = array(
'name' => array('notempty'),
'number' => array(
'notempty'=>array('rule'=>'notempty', 'message'=>'Number must be
specified'),
'isUnique'=>array('rule'=>'isUnique', 'message'=>'Number is
already used')
));
-
Hello Guys,
I'm new person of group and I started my studies with cakephp now.
Do somebody know if exists some database connection poll at CakePhp? I was
looking for documentation but I didn't find any. :(
Could somebody help me? Please. =)
Thanks,
eltu
--~--~-~--~~~---
Hey,
I'm so happy I've found this group. Maybe someone can help me with my
problems here (I'm a beginner in Cakephp). Sorry for my bad english by
the way.
Ok I've got two Models in HABTM relation: verses and users. in my
controller action i want to get some specific verses (for example: the
first
On 04/28/2009 09:11 AM, gianpaulo wrote:
> Hi,
>
> I tried including $persistentModel = true as suggested here :
> http://www.pseudocoder.com/archives/2009/03/17/8-ways-to-speed-up-cakephp-apps/comment-page-1/
>
> Well it did increase the speed of my app (about 200%) but I'm
> receiving this error
Keyur,
If you are writing a "big application" then I would suggest you invest
the time to read the book @ book.cakephp.org and blogs from lemoncake,
debuggable, etc which are all wonderful resources.
Shawn
On Apr 28, 7:06 am, keyurvaghani wrote:
> Hello folks,
> Can anybody please let me know
Thank you every body,
Yes, I didn't explain very well what I want to do but with $this-
>render('the_view'); solution I've resolved my question.
Bye
On 28 abr, 11:00, John Andersen wrote:
> Don't let the controller know how to present information, let the view
> itselt decide which information
You can use substr and strpos to get it.
$ii = 0;
$jj = 0;
if (FALSE !== ($ii = strpos($url, 'twitpic.com')))
{
$jj = strpos($url, '&', $ii);
$twitpicUrl = substr($url, $ii, ($jj-$ii));
}
Or something like that.
Shawn
On Apr 28, 7:54 am, Kyle Decot wrote:
> I know this isn't specificall
Sorry, hit 'Send' too early...
The code I'm using is :
$appModelList = Configure::listObjects('model');
foreach($appModelList as $modelName) {
// I have to manually exclude those two model or loadModel
will fail
if (in_array($modelName, array('SpecialModal', 'AppModel'))) {
Well, AppModel and SpecialModel are the only two models that do not
use a table .I think I may not have been clear enough and you
misunderstood what I was trying to do.
Here is the context :
I had to apply a regexp to every text field of every item saved in my
database. So I list every model of
I have a simple database set-up and have optimized the query using
cakephp's containable behavior to where I get only the fields I need
(I check this with a debug command to see the array). However when I
set the debug level to 2 in core.php, I notice many repeat SQL calls
on foreign keys.
For ex
$this->Auth->userModel = 'Member';
did the trick
and of course Hats off to Brian
--~--~-~--~~~---~--~~
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
Brian
Good work indeed
We have made good progress
DESCRIBE `members`
INSERT INTO `members` (`username`, `password`, `firstname`,
`lastname`, `emailid`) VALUES ('zfa', 'ssadf', 'd', 'ADa', 'AdsaD')
SELECT LAST_INSERT_ID() AS insertID
Now the first SELECT statement is gone as you have right
I know this isn't specifically a CakePHP question but I thought I
would see any any of you could help me out anyways. I am getting a
feed of Twitter updates and I want to check each one to see if it has
a http://twitpic.com URL in it. How would I go about getting the
TwitPic URL out of it? I know
Hello folks,
Can anybody please let me know what should be taken care for better
perfomance for site becuase it seems for developing large application
there might perfomance issue arise with cake 1.2. As i m going to
develop big application in and i m really wanted to know more
regarding perfoman
Don't let the controller know how to present information, let the view
itselt decide which information to present using elements!
So in the controller, provide the information to the view:
$this->set( "decsion", array("a" => $a, "b" = $b) );
And in the view:
if ( $decision["a"] == 0 ) {
$this
Hi,
MVC complaints aside, if you want to use a "no convention" view,
simply perform a
$this->render('the_view');
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send e
Good morning,,
What do you mean by two different view?
IMHO,One view is for one function in controller..
--
"One of the mankind greatest enemy is man itself"
-Gendo Ikari
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Gro
Good morning,
I don't know if I could use two diferent view for the same controller
function, for example:
class UsersController extends AppController {
function tes()
{
if(a==0) //there I use view a.ctp
if (b==0) //there I use view b.ctp
}
}
Thank you in adavantage
--~--~---
Good morning,
I don't know if I could use two diferent view for the same controller
function, for example:
class UsersController extends AppController {
}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP"
Well if you add that to AppModel, ALL your models will not have a
database table. Only put that in the models that DO NOT have a table.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this
59 matches
Mail list logo