to:
- have two or more timestamp fields
- name your timestamp field whatever you want
On 13 jul, 04:11, Grzegorz Pawlik grzegorzpaw...@gmail.com wrote:
That's not what I'm asking about. Lets say I NEED to use TIMESTAMP and
CURRENT_TIMESTAMP as default value, and in that case cakePHP
documented in every
book. Basically you crater a field called created or updated as a
datetime, default null and cake will populate it automatically.
On Jul 12, 5:02 pm, Grzegorz Pawlik grzegorzpaw...@gmail.com wrote:
just switching from 1.3.0 to 1.3.2 got me into trouble, when I have
field
just switching from 1.3.0 to 1.3.2 got me into trouble, when I have
field specified as:
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
and don't supply any value for that field in array I try to save ,
neither a key in
1.3.0 it's working as desired - I get current timestamp in that
I have an idea I want to to share with You.
I made some fancy element called list (http://bin.cakephp.org/view/
127456247). The implementation is not that important, it's just
foreach You always do when listing stuff from db (putting them into tr/
td, marking odd tr's, adding some links at the
saving to
the db.
My apologies for the wasted post. Thanks your time and help :)
On Feb 25, 4:17 pm, Grzegorz Pawlik grzegorzpaw...@gmail.com wrote:
Do You have fixtures defined? AFAIR I had similar problem, when no
fixtures loaded. Try creating fixtures with
var $import(model
Please post contents of Your app/config/database.php file...
On 24 Lut, 11:39, Nico ngev...@gmail.com wrote:
Greetings
I've run into something strange while testing my models. Here's a
scenaro (names have been changed for simplicity). I have 2 models,
Article and Comment. in the article
',
'prefix' = 'boost_',
);}
?
for what its worth, it works the other way around .. ie if i write to
the db in the test it picks it up in the code... but just not the
other way round (as defined above)
On Feb 25, 3:24 pm, Grzegorz Pawlik grzegorzpaw...@gmail.com wrote
Is it hard to check?
On 12 Sty, 20:06, Parris presid...@parrisstudios.com wrote:
Would that not cause namespace issues if there were more than one
controller with the same name in the entire app? Doesn't the model
need to be named PollPoll not just Poll?
On Jan 12, 12:32 am, Grzegorz Pawlik
In 1.2 I would name model Poll, and Tag, and in PollAppModel set
$tablePrefix = poll_
So You would have poll_polls, poll_tags and poll_posts_tags. As fas as
I remember - that worked :)
Btw, when You define relations It would be for Poll model
var $habtm = array(Poll.Tag);
Good luck
I'm not
You should put the code in Your model. And in afterFind callback
iterate through stuff You got, call can_close() and if true - add some
virtual field to retrieved data (virtual = not in DB, but appears in
results array after find()).
It's similar to advice above, but keeps Fat Model, Skinny
It has little to do with MVC, because You are referring to ORM. And
it's working different in cake.
You can call
$this-SomeModel-read(null, 1); // 1 is an id
Then You can read/write particular field this way:
$this-SomeModel-data[SomeModel][name] = new_name;
$this-SomeModel-save();
I don't this
are implemented by CakePHP. This
is mostly a side effect of PHP4 support and will be removed once
autoloading of models can be achieved.
-Mark
On Dec 1, 9:00 am, Grzegorz Pawlik grzegorzpaw...@gmail.com wrote:
Those should test single unit. I know, that sometimes it's convenient
to test
Those should test single unit. I know, that sometimes it's convenient
to test model with (some close) associations.
But I find quite odd that situation:
Creating PackageTest, and including app.packages_appendix and
app.appendix fixtures - it's reasonable for now.
But why the heck I need to
Shouldn't be in afterFind? When data grabbed from DB, You iterate
throug them and add do sth like this
$this-data[$n]['User']['whole_name'] = $this-data[$n]['User']
['name'] . . $this-data[$n]['User']['last_name'];
right?
On Nov 6, 7:12 pm, David Roda davidcr...@gmail.com wrote:
Thanks
It may be free, but not open :P
Tried to copy text to google translate, but it seems to be protected ;
(
So it's no use for lots of people right now. You probably should have
post info about it on Malaysian cakePhp forum instead of teasing with
us :P
On Jul 29, 1:27 pm, Azril Nazli
Why using vendor when cake (1.2) have native email component?
On Jul 30, 7:05 am, JamesF usaexportexpe...@gmail.com wrote:
that's a good start, i am still trying to get a picture of how it will
work together. thanks
On Jul 29, 11:46 pm, brian bally.z...@gmail.com wrote:
On Wed, Jul 29,
For the record: I'm gr8tful for every publication about cake
tipstricks. In most cases 90% of it I.m familiar with, but I like to
read it because of this 10% that will be new, suprising, fresh and
useful. So there's lots of stufff in english doesn't convince me - I
just want to read this one too,
*Fatal error*: Class 'LocationController' not found in *
C:\wamp\www\theinconnu\app\controllers\locationmanager_controller.php* on
line *6
It seems You are importing LocationmanagerController (in app::import),
but
extending class by LocationController, or making some similar
mistake.
Plus,
I just came up with something, It's not something I hate - just an
idea to improve Model (?):
If Model could keep track of queries that it calls debugging would be
simple, I think of something like this:
//in controller:
$this-Thing-clearQueryTrace(); //remove unimportant info
//+
$a =
Isn't it easier to make domain .com.pl point at the same location as
domain .pl ?
I don't believe messing with .htaccess is what You need ;)
On Jun 8, 10:58 am, Anna P apad...@o2.pl wrote:
Thank you for suggestion, but that doesn't seem to work either. Still
when I enter .com.pl it doesn't
Ok, I'll suppress my 'general why questions compulsive behaviour' ;)
About not existing callback - just a mistake. I meant beforeFind of
course. But it's not the point.
I Talk about ArticleVersion and ArticlePage, because those two models
I want to have translatable, but that is not the problem
And I'm fairly sure I don't need to do that trick in save method ;)
On 9 Cze, 15:30, Grzegorz Pawlik grzegorzpaw...@gmail.com wrote:
Ok, I'll suppress my 'general why questions compulsive behaviour' ;)
About not existing callback - just a mistake. I meant beforeFind of
course. But it's
before I got certain that is the
best way :D
Thanks for Your time Jitka, a lot of time I suppose. And I hope my
questions didn't make You bang Your head against a desk, or any other
hard surface ;)
Greg
On 9 Cze, 15:33, Grzegorz Pawlik grzegorzpaw...@gmail.com wrote:
And I'm fairly sure I don't need
Once again: language and locale are different things and you should
not mix language and locale codes together like that. Language is 2
characters string from Configure/Session 'Config.language',
initialized by autodetection or forced by application code. Locale
identifier used by
Ok, now I'm even more confused than before ;) So I'll keep nagging
You.
Question: Why App.locales is better place for locales? I get it why
Config.language is a bad place. But is App.locales because there's
some convention I don't know about? Or maybe just Your ideaof place to
store this stuff?
'); //i18n +
TranslateBehavior
from beforeFind to __contruct did the trick.
Does it have something to do with model chain?
On 1 Cze, 12:38, Grzegorz Pawlik grzegorzpaw...@gmail.com wrote:
Ok, now I'm even more confused than before ;) So I'll keep nagging
You.
Question: Why App.locales is better
Hello Jitka :) I remember You from our discussion about my performance
trick in cake.1.1 ;)
On 30 Maj, 03:41, jitka (poLK) slunii...@gmail.com wrote:
There's ArticleVersion model, which have this fields: id, name:
varchar, introduction:text, created:datetime.
I've defined to name and
Hello, I have some issues while working with TranslateBehavior. I'll
try get to the point:
There's ArticleVersion model, which have this fields: id, name:
varchar, introduction:text, created:datetime.
I've defined to name and introduction fields to be translatable:
var $actsAs =
I just want to add one minor thing: I don't like that debug() is
making print_r() instead of var_dump(), so when I want to debug some
variable and see nothing - I know that there's null, false, true or
empty string or string full white chars, so I need to make my own
debugging with pre tags and
Can You use php from command line? If yes, You could probably call
console cake that way:
php cake.php bake
Have You tried that?
On May 7, 7:47 pm, Beedge kbrads...@hbit.ie wrote:
Thanks for that, but its not quite the same. Ive downloaded latest php
and installed, but no joy.
I wonder has
I can't tell why varchar couldn't be a FK? Are You experiencing any
problems with that or just theoretically asking?
On May 8, 4:08 am, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:
I had a thought because of unique slugs but it made no sense...was just
wondering if was
You could probably get list of tables instead listing models, You
could probably use that piece of code:
$db = ConnectionManager::getDataSource('default');
$sources = $db-listSources();
Iterate through $sources and do Your stuff. It makes more sense too,
becouse You need to do stuff
It's an idea that just came up. Probably You could set up some kind of
PluginHandler, which will handle the plugins instalation process
(which i describe below) and plugin interacting.
Each plugin knows where it need to inject himself into (I'll just call
it widgets for now). IE:
- extend Dog
here: (`StockItem`.`size_id`
= `Size`.`id` AND `Size`.`size_type_id` =
'StockItem.Product.size_type_id')
After 'AND' you have something that is not automatically generated by
cake. You must have something extra in StockItem-find() passed, or in
relation definition (ie. in conditions field).
Additionally You rather shouldn't name Your model/controller like
Object/Objects and Page/Pages ;)
On Apr 16, 12:52 pm, Mark (Germany) dereurom...@googlemail.com
wrote:
yeah
i once proposed to change components into
$this-FileComponent-foo()
etc with Component attached to prevent this from
I'm doing some research and trying to find best tool set for projects
I run. Because cake is my favourite application - CakeTeam is my
favourite dev team and I probably could follow the example and find
out if it suits for me.
Anyway I'm wondering (or know but want to list all elements of this
jitka, is there any possibility that You could provide some
information about other php4 workarounds?
I could really use this info. Not sure if I could track them down with
xdebug profiling :)
On 18 Mar, 13:09, Grzegorz Pawlik grzegorzpaw...@gmail.com wrote:
Ok, that's gr8 :D I don't need
Ok, that's gr8 :D I don't need that to be changed globably in cake
repo, but just for this one project, which is and will be only php5.
Thanks for dissolving my doubts :)
On 18 Mar, 13:06, jitka (poLK) slunii...@gmail.com wrote:
You discovered one of many workarounds which are necessary for
Today I was playing with xdebug profiler and found probably not
necessary bit of code which have been taking quite a lot of whole
script execution time.
The thing is in Model::setSource (files /cake/lib/model/model_php5.php:
523 and model_php4.php:529) [cake 1.1.16.5421 - I know that's little
DESCRIBE happens only in debug0, when You switch to production mode,
describe shouldn't happen. Only overhead may be in those models
objects initialization. You may consider lazy initialization of models
in controllers methods.
On Oct 12, 4:42 am, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Hi
Still thinks that executing queries is needed?
Yes. Sometimes You have uncommon database design, and You can't
EFFECTIVELY receive data just by using standard, even magic, model
functions. In that case you should create method in model that
executes your custom query with inner, outer, left
I'll add my two cents ;)
In Chris's advice (very good btw) maybe You'll need to define
statistic model for statistics_controller, and in class Statistic set
var $useTable = false;
(because controller always expects to have a model)
On Jul 9, 4:00 am, Chris Hartjes [EMAIL PROTECTED] wrote:
On
grigri said:
You can also use {1} {2} as the format string instead of the
sprintf() format, if you like. Personally I prefer the sprintf
format...
Yeah, but if You have something like:
Array
(
[0] = Array
(
[Company] = Array
(
[name] =
I think bake.php is amazing, but this is even better (faster and more
comfortable) in use. Great job!
On Aug 30, 7:14 pm, Dérico Filho [EMAIL PROTECTED] wrote:
Hi All,
I released the dbdesigner2cake 1.0.0RC1, it's available for download
at
From what You wrote, I think that you forgot to actually call
exec() function...
On Aug 27, 6:02 pm, carSign [EMAIL PROTECTED] wrote:
I am trying to execute a command from within a view. Something like:
?php
$output = `perl cool_script.pl`;
echo $output;
?
And I get nothing. I get
is there a possibility, when using mysql_connect engine in database
config, to force cake send client_flags param (fifth in
mysql_connect). Especially im interested with sending MYSQL_CLIENT_SSL
MYSQL_CLIENT_COMPRESS.
TIA
GP
--~--~-~--~~~---~--~~
You received
.
The ModuleController can't see AppController and extend that class,
the actual error msg is:
Class 'AppController' not found in module_controller.php on line 3.
On Aug 2, 3:05 pm, Grzegorz Pawlik [EMAIL PROTECTED] wrote:
Sorry if i just write 2nd time something- thread is long and i could
Sorry if i just write 2nd time something- thread is long and i could
miss something.
Have You tried something like:
put in /app/vendors file called module_controller.php with definition
class ModuleController extends AppController.
Then in /config/bootstrap.php call vendor('module_controller');
post it on bakery :)
On Jul 28, 7:14 pm, Mike [EMAIL PROTECTED] wrote:
Hi everyone, I made a helper for random images
It's at http://mikeski.net/new/snippets/view/24
Enjoy!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
You could generate a multiple insert query like that:
INSERT INTO 'some_table'(field1, field2) VALUES
('value1', 'value2'),
('value3', 'value3'), (...)
And execute it by $this-SomeModel-query();
cheers!
On Jul 26, 4:21 pm, Femi Taiwo [EMAIL PROTECTED] wrote:
Hi,
Question Summary: Is there
replace the white spaces,
directly from $html-link() call.
Thank you!
On Jul 22, 10:16 am, Grzegorz Pawlik [EMAIL PROTECTED] wrote:
just call $html-link('/posts/view/'.$data['Post']['id'].'/'.
$data['Post']['title']);
if your view action have only one parameter $id, if it has more. f.e
just call $html-link('/posts/view/'.$data['Post']['id'].'/'.
$data['Post']['title']);
if your view action have only one parameter $id, if it has more. f.e.
function view($id, $some_param=null, $some_param2=null);
then call it that way:
ke? :P
Hi mate, i think the probability of getting answers to your problelm
will grow if you post it in english.
Cheers :)
On Jul 18, 7:30 pm, citBolon [EMAIL PROTECTED] wrote:
Si alguno conoce el componente memcache probablemente me pueda ayudar.
El error que obtengo es el siguiente:
Fatal
for this and then let me know if my prophet
skills are a little rusty or still in good shape ; ).
-- Felix
--
My Blog:http://www.thinkingphp.org
My Business:http://www.fg-webdesign.de
Grzegorz Pawlik wrote:
Hi, i found this strange behaviour. When accesing page via firefox
Hi, i found this strange behaviour. When accesing page via firefox 1.5
it acts like it has been reloaded few times (3 exactly).
Prove:
I've put this code in beforeFilter in /app/app_controller.php :
$count = $this-Session-read('count');
$count[] = time();
$this-Session-write('count', $count);
there's a config component based on database- look up on bakery :)
On May 6, 7:22 am, Mariano Iglesias [EMAIL PROTECTED]
wrote:
Or create a file called app/config/config.php like the following:
?php
$config['app'] = array(
'setting1' = 'value1',
'setting2' = 'value2'
);
?
ofcourse it is. Dot means object member, that's why it is missing
name after . operator
On Mar 12, 11:21 pm, f. [EMAIL PROTECTED] wrote:
Hi,
http://img88.imageshack.us/img88/5099/77614616od5.png
I think string concatenation is done with '+' in Javascript.
Maybe a PHP habit, the dot...;)
where do You call this function? Is it in some of your controllers
method or callback?
On Feb 21, 2:44 am, josesquared [EMAIL PROTECTED] wrote:
I am using the invalidate function in the controller and it is not
triggering the tagErrorMsg. I also tested and it doesn't seem to
block the save
I have problem with your example:
it is working, but right afret changing content of that div page
starts to reload, and stays blank for ages.
How can i forbid this reload?
On Jan 23, 8:20 pm, codecowboy [EMAIL PROTECTED] wrote:
-- controllers --
The following controller contains the action
59 matches
Mail list logo