Thank you very much. You are a savior. Thats exactly what I was
looking for.
I think it is a very useful feature and should also be part of the
treeBehavior.
I already created a loop that counts the depth but getting it from the
database sure is faster.
On Jun 17, 8:53 am, AD7six wrote:
> On Ju
On Jun 16, 10:06 pm, Madis wrote:
> Hello!
> I was wondering if there is a possibility to save the level of each
> node into the database? And how would this be done?
> I used Doctrine with symfony and they had this automized. But with
> cake it seems not to be a feature.
>
> I know that it is
On Jun 16, 6:54 pm, Femi Taiwo wrote:
> Hi James,
> Yes, you understand the scenario correctly.
> The problem with using contain in particular situation is that multiple
> queries are being generated in that find, and variables are being passed back
> and forth between php and mysql - this
Model::find() only triggers Behavior callbacks on the main model, not
those associated with it. However, I'm certain that I've seen at least
one Behavior that got around that by running through its Model's
associations and, for those that implemented the same Behavior, did
its thing (whatever it w
Arrghh I'm feeling stupid now. Here's how you use HABTM Containable
and paginate all at once:
$this->paginate['AreaAlbum'] = array(
'conditions'=>$conditions,
'limit' => 4,
'page' => 1,
'order'=>'AreaAlbum.album_id desc',
On Tue, Jun 16, 2009 at 11:33 PM, phpcurious wrote:
>
> why do you have to use slugs, why not try using their usernames the
> users provided or assigned to them by the system?
A slug is merely any string that's been modified to be both useful and
readable in a URL. So, the slug may very well be b
Not documented as far as I know. It's just Containable weirdness,
probably having to do with binding.
Anyone know why Containable doesn't work with HABTM 'with'
relationships? I had it working when it was a 3rd party behavior, but
it's definitely not working now. For me, "deep" SQL queries is the
There's a 'reset' param? Is that documented anywhere?
On Tue, Jun 16, 2009 at 11:23 PM,
eric.winch...@gmail.com wrote:
>
> Can anyone describe why 'reset'=>false must be in $conditions for
> Containable usage of any complexity? I have queries that go from
> taking an unbearable 20 seconds to an a
Something I just discovered and maybe the more important question -
why doesn't Containable work on HABTM 'with' relationships?
On Jun 16, 10:23 pm, "eric.winch...@gmail.com"
wrote:
> Can anyone describe why 'reset'=>false must be in $conditions for
> Containable usage of any complexity? I have
On Tue, Jun 16, 2009 at 9:44 PM, Adam Royle wrote:
>
> $this->set() doesn't return a value. so $transaction_amount_total will be
> null. Try something like this:
>
> $data = $this->Jurisdiction->Transaction->find('all', array(
> 'conditions' => array('Transaction.jurisdiction_id =' => $id),
> 'f
why do you have to use slugs, why not try using their usernames the
users provided or assigned to them by the system?
On Jun 17, 7:24 am, "Dave Maharaj :: WidePixels.com"
wrote:
> I am using custom slugs that the user creates when they sign up.
>
> USER:
> id
> slug
> .
>
> When a User m
Can anyone describe why 'reset'=>false must be in $conditions for
Containable usage of any complexity? I have queries that go from
taking an unbearable 20 seconds to an almost unbearable 3 seconds, but
I don't understand what 'reset' has to do with it. The ones where it
really counts are using up
And both models had the behavior attached to them?
- Original Message -
From: "Brendon Kozlowski (Realm)"
To: "CakePHP"
Sent: Wednesday, June 17, 2009 1:09 PM
Subject: Re: Advanced(?) Behavior question
That's what I was hoping too. Unfortunately that didn't seem to be the
case.
I d
That's what I was hoping too. Unfortunately that didn't seem to be the
case.
I did a users/posts/comments example site to test functionality.
User's email address was encrypted in the DB, and when viewing the
index page, it was decrypted (working for user model). Post's title
was encrypted (just
That's it! Thanks
--~--~-~--~~~---~--~~
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...@go
That's useful. Thanks for sharing.
Kyo
--~--~-~--~~~---~--~~
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
ca
[?][?]
Thank you, I 'll try it
2009/6/16 Stu
>
> ps: I think the code you might be looking for is:
>
> var $paginate = array('page' => 1);
>
> try adding this on top of the app_controller
> >
>
--~--~-~--~~~---~--~~
You received this message because you are sub
Thank for your help.I delete all the tmp file.
but it has no been solved.
when I delete the file of cake\libs\view\helpers\paginator.php.
the question been solved.
It isn't a good way, but it has been solved.
Thank you very much
2009/6/17 brian
>
> Look in app/tmp/cache.
>
> On Tue, Jun
This might work:
function login() {
if (empty($this->data)) {
$this->Session->del('Message.auth');
}
}
hth
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to
If I am doing something like this I generally just create a string and pass
it through. Make sure to encapsulate it in parenthesis () in case you have
other conditions.
$event_conditions = array(
'(Event.start BETWEEN DATE_SUB(CURDATE(), INTERVAL 1 DAY) AND
DATE_ADD(CURDATE(), INTERVAL 7 D
$this->set() doesn't return a value. so $transaction_amount_total will be
null. Try something like this:
$data = $this->Jurisdiction->Transaction->find('all', array(
'conditions' => array('Transaction.jurisdiction_id =' => $id),
'fields' => array('Transaction.id','SUM(Transaction.amount) AS Am
Wow. Sorry, I didn't read your entire email. But a few things..
1) Yes, generally you have just one table per model per controller.
2) A more flexible solution is to have your menu heirarchy to be separate
from your controller/action heriarchy. This will allow you to separate your
visual naviga
Can anyone help? I'd like to suppress the "You are not authorized to
access that location" message when I try to visit a page that I'm not
authorised for.
I'm happy with the redirection to the login page, I'd just like to
hide the error.
I can't hide it with CSS, because the same CSS selector i
I am fairly certain that each related model will take care of it's own
beforeSave and afterFind callbacks, so you should just need to handle
encryption/decryption for the primary model, and each other model that is
saved/found will handle its own as well.
Cheers,
Adam
- Original Message -
Nope
That renders:
I have a custom controller action which uses 1 form and 1 action to allow a
user to update various sections. So rather than build multiple forms/actions
I use 1 which builds the form based on the section they choose to update and
is working fineexcept I need to edit
I am using custom slugs that the user creates when they sign up.
USER:
id
slug
.
When a User makes an entry / post or other actions on the site everything is
tied to the slug in the URL and in the controller get the Auth->ID of the
user for that slug as that's the foreign key ID, t
Hello everybody,
I have a problem with some cakephp (version 1.2.3.8166) code. It
concerns using $this->Session->setFlash in a controller action. Part
of the controller code:
$this->Session->setFlash(__('Everything fine.', true), 'flashinfo');
$this->redirect(array('controller'=>'users','action'
$event_conditions = array(
'Event.start'=>array('< -!DATE_ADD(CURDATE(), INTERVAL 7 DAY)', '>
-!DATE_SUB(CURDATE(), INTERVAL 1 DAY)')
);
Cake is producing an IN() statement.
I'm wondering how to use MySQL functions with more than one condition?
--~--~-~--~~~---~--~
Ya, that's what I'm doing now, but it just seems like a pain to keep
track of it and make sure the menus are consistent based on the group
parameter. The other option was keeping it in a session, but that
creates a problem with not having direct access to a resource through
a url itself.
On Jun 1
Correction, I'm using
read()); ?>
On Jun 16, 4:20 pm, foldiman wrote:
> I just started a new CakePHP project with a new download of Cake. If I
> place the following in my home.ctp in my pages directory, I see my
> session.
>
>
>
> But it doesn't work on any view page that's linked to a contr
My questions aren't exactly about CakePHP, but more so around the MVC
architecture. I couldn't find my particular answer through searching,
but at least I discovered that this seems like an acceptable question
here.
I have a main menu. For each main menu item, there is a sub menu. To
me, it made
I like the idea of prefix routing, although wouldnt it require a lot
of additional functions to work?
ie,
uk_view() {
}
fr_view(){
}
rather than just a single view() function?
I've found this seems to have done the trick, seems fairly simple
Router::connect('/:region/:controller/:action/*')
I've been writing an encryption/decryption behavior that will
automatically encrypt and decrypt model data on-the-fly, according to
settings defined for the behavior (per model) within the model.
I have it working for DEEP finds (set recursive to 5 just to test) on
all fields for the current mode
create($model, array('type' => 'post', 'url' =>
'/update')); ?>
On Jun 16, 12:10 pm, "Dave Maharaj :: WidePixels.com"
wrote:
> I have
> create($model, array('type' => 'post', 'action' =>
> '/update')); ?>
>
> which renders method="post">
>
> Is there a way to get it to look like this?
>
>
>
Hello!
I was wondering if there is a possibility to save the level of each
node into the database? And how would this be done?
I used Doctrine with symfony and they had this automized. But with
cake it seems not to be a feature.
I know that it is also possible to count the levels in a loop but th
I just started a new CakePHP project with a new download of Cake. If I
place the following in my home.ctp in my pages directory, I see my
session.
But it doesn't work on any view page that's linked to a controller.
For example, I have a 'cars_controller' and a 'cars' folder in the
'views' folde
Hi Steve,
why dont you just pass the group_id as a parameter to the index action?
Like:
www.mydomain.com/videos/index/groupname2
greets
Andreas
Steve schrieb:
> I'm trying to determine the best way to have dynamic actions but
> hopefully the community can help.
>
> What I mean by dynamic action
I'm trying to determine the best way to have dynamic actions but
hopefully the community can help.
What I mean by dynamic actions is that many actions like /posts/
index/, /videos/index/, are all dependent on the variable "group_id".
In other words, those actions are only supposed to list all pos
I have
create($model, array('type' => 'post', 'action' =>
'/update')); ?>
which renders
Is there a way to get it to look like this?
Dave
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
Well how long did you set the cache to last for?
--~--~-~--~~~---~--~~
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 ema
Hi Adam:
I tried it but it wouldn't work. Can anybody else help,
please.
the original array is an output from a calculated find('all') as in:
$transaction_amount_total = $this->set('transaction_amount_total',
$this->Jurisdiction->Transaction->find (
'all',array('conditions
Hello,
I am using cacheAction. The same as in the tutorial.
Claudiu
On Jun 15, 4:55 pm, Miles J wrote:
> Well what type of cache are you using exactly? There are many types.
>
> cacheAction, persistModel, cacheQueries, etc.
--~--~-~--~~~---~--~~
You received thi
Use prefixes:
http://book.cakephp.org/view/46/Routes-Configuration#Prefix-Routing-544
--~--~-~--~~~---~--~~
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
On Tue, Jun 16, 2009 at 8:56 AM, lakers fan wrote:
> Hello,
> I want to write a recursive function in my users controller which will
> be called from the url.
>
> http://localhost/cake/users/recfunction/param1/param2
>
> This recfunction will call itself if needed..
>
> function recfunction(p
Hi Adam:
I tried it but it wouldn't work. Can anybody else help,
please.
the original array is an output from a calculated find('all') as in:
$transaction_amount_total = $this->set('transaction_amount_total',
$this->Jurisdiction->Transaction->find('all',array('conditions'=>array
('T
On Tue, Jun 16, 2009 at 2:43 AM, Netram Dhakar wrote:
>
> Hi,
> I am new with CakePHP.How to install and configure.
>
> Please help me.
That's a very common question when you're starting.
According to cookbook...
"Installation preparation consists of the following steps:
* Downloading a copy of
On Mon, Jun 15, 2009 at 6:28 AM, VVilku wrote:
> (..)
>
> But when I try to use it after the import model in to another
> controller, I receives an error.
>
> (..)
> SQL Error: 1054: Unknown column 'User.status' in 'where clause'
>
>
> I understand that the imported model is not somehow related to
On Mon, Jun 15, 2009 at 5:25 AM, Miles J wrote:
> (..)
>
> Also tried using exec php -q and some other commands and nothing.
Have you installed php-cli?
Best regards.
--
MARCELO DE F. ANDRADE
Belem, PA, Amazonia, Brazil
Linux User #221105
http://mfandrade.wordpress.com
--~--~-~--~
Use the model's afterFind() method to add the age to your data. Also,
your calculation is not very robust. Try this:
function afterFind($results)
{
if (isset($results[$this->alias]['birthdate']))
{
$results[$this->alias]['age'] =
$this->getAge($this->alias]['birth
Yep. a custom query is seemingly the way forward on this. I use
containable a lot for other areas. Pagination is not applicable in this
scenario because I'm not displaying the results to anybody :) The
resultant user ids are saved in another table for a cron job to notify
the users.
Giving the
Hi James,
Yes, you understand the scenario correctly.
The problem with using contain in particular situation is that
multiple queries are being generated in that find, and variables are
being passed back and forth between php and mysql - this much I see
from the sql logsso I would be ki
On Tue, Jun 16, 2009 at 8:56 AM, lakers fan wrote:
> Hello,
> I have a form input of type 'file' to choose a file
>
> input('sourcedir', array('div' => false, 'label' =>
> false, 'class' => 'text', 'type' => 'file')); ?>
>
> Is it possible to select a directory instead of file?. If not how
On Tue, Jun 16, 2009 at 8:40 AM, James K wrote:
>
> If I understand correctly, you're running some finds to produce a
> giant array of user ids that match the conditions submitted by the
> user. THEN you're trying to take that list of user ids and pass them
> as a condition to a separate find to r
How is this a CakePHP question? Ensure that both versions are in sync
(eg. use rsync). Maybe the code is on the server but some other file
has not included it. If you view source, do you see your code?
On Tue, Jun 16, 2009 at 7:51 AM, Tamanna Afroze wrote:
> Hi everybody,
> I am new in this group
Assuming the territory will always be a 2-letter, lowercase code ...
Router::connect(
'/:territory/news',
array(
'controller' => 'news',
'action' => 'index'
),
array(
'territory' => '[a-z]{2}',
'pass'
Look in app/tmp/cache.
On Tue, Jun 16, 2009 at 1:05 AM, Rimoe wrote:
> add
> a little mistake
>
> my core.php like but my core.php is Configure::write('debug', 0);
> and the file of app\views\helpers\paginator.php has been new create,
> so it has been cached
>
> what if you can help me,
>
> Than
Hi,
Suppose you have a model class 'Person' which has a attribute
'birthdate' and a method 'get_age()'.
function get_age() {
return (int)date('Y') - self.birthdate;
}
How can I call the get_age() method in my Person views?
Thanks in advance.
--~--~-~--~~~---~--
On Mon, Jun 15, 2009 at 4:00 PM, Ashu wrote:
>
> Thanks.
>
> This is what I did in my view for add.ctp
>
> echo $form->input('user_id',array('value' => $user['User']['id']));
>
>
> But, I would like to make this statement invisible, as I am pulling
> this data for a logged-in user and he does not
Hi,
I'm writing a Controller test, that uses a Model that Acts As a
Behavior.
I'm using the "hard way" methodology by Mark Story to build the
controller in the test case.
My problem is as follows:
The controller method being tested makes a call to a Model method
implemented by the behavi
Use the RequestHandlerComponent::respondAs method. This should set the
appropriate content-type headers based on the $type that you give it.
http://api.cakephp.org/class/request-handler-component#method-RequestHandlerComponentrespondAs
-j.
On Jun 15, 4:15 pm, Miles J wrote:
> But it doesn't wo
That was it. Amazing. Thanks.
On Jun 16, 6:31 am, "Dr. Loboto" wrote:
> Check models filenames - they must be lowercased. Same about all other
> cake files.
>
> On Jun 16, 11:41 am, CharlesTMunger wrote:
>
> > I have developed a site on my windows machine and it is working
> > great. I uploa
I'm writing a facebook app and am having problems with my routing.
First off I changed App.base to point to my facebook canvas path:
Configure::write('App.base', '/my_app');
I did this so I could use $html->url() to construct my URLs in my
views. It works great except for one problem.
Try phpclasses.org
Rick
On Jun 15, 2:56 pm, Paulos23 wrote:
> Hi Cake people,
> I have a question about Xml.I am using httpSocket to hit a specific
> url in order to get some data.The url ishttp://www.geonames.organd i
> received details about destinations in order to implement
> geocoding.The
Hi together,
me again sorry ;-)
I've a little problem with my static images which don't get cached by
the browser.
You see in this screenshot for example the image "4.jpg":
http://files.getdropbox.com/u/31281/20090616_153337.png
it's included normally by $html->image tag into the page.
The i
Hi together,
thank you for the responses.
Link-Protection is not the only reason why i use them.
I also use Media Views for counting the hits on the images.
I changed the application in the way that thumbnails dont get loaded
by mediaview and only the high-res pictures (which should get counte
Hello,
I have a form input of type 'file' to choose a file
input('sourcedir', array('div' => false, 'label' => false,
'class' => 'text', 'type' => 'file')); ?>
Is it possible to select a directory instead of file?. If not how can I get the
full filepath..
i checked the $this
If I understand correctly, you're running some finds to produce a
giant array of user ids that match the conditions submitted by the
user. THEN you're trying to take that list of user ids and pass them
as a condition to a separate find to return the user details for each
of those ids?
First off,
ps: I think the code you might be looking for is:
var $paginate = array('page' => 1);
try adding this on top of the app_controller
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this gr
I usually add them from the app_controller:
var $paginate = array('');
http://api.cakephp.org/class/paginator-helper
If you want it for a view in particular, you could manually set them
there as seen here:
http://book.cakephp.org/view/166/Pagination-in-Views
Hope this helps
Good Luck!
--~--~
This? As in $this->recfunction...
On Jun 16, 1:56 pm, lakers fan wrote:
> Hello,
>
> I want to write a recursive function in my users controller which will
> be called from the url.
>
> http://localhost/cake/users/recfunction/param1/param2
>
> This recfunction will call itself if needed.
Hello cakemen,
I have a question about mapActions.I am trying to use Acl (not working
at the moment) and i dont know if it's besto to use mapActions.I want
to have 3 groups 1.Admin, 2.User_Premium , 3.User_Guest and i want
to set their permissions.I have 2 controllers User,Profiles with
plenty
Hi everybody,
I am new in this group.
The following code works well in my local machine.
if(top.upper.securityOptions.generate_instant_message)
{
securityOption=top.upper.securityOptions.generate_instant_message;
securityDelete =
top.upper.securityOptions.delete_instan
Hello,
I want to write a recursive function in my users controller which will be
called from the url.
http://localhost/cake/users/recfunction/param1/param2
This recfunction will call itself if needed..
function recfunction(param1, param2)
{
if(condition == true)
{
Hey I'm building my site with cakephp and I love it, cakephp has made
it fun again.
However I do use phpbb3 and would like to continue using it as it has
never let me down yet.
My directory is like this
./index.php <-- cake
./cake
./app
So I would like to know what I would have to do to get ph
Check models filenames - they must be lowercased. Same about all other
cake files.
On Jun 16, 11:41 am, CharlesTMunger wrote:
> I have developed a site on my windows machine and it is working
> great. I uploaded the entire cake directory to my ubuntu server and
> it appears to be working ok, ex
Hi,
I have a web application using cakephp-1.2 and jQuery-1.2.6.. Ajax
calls are
being made to dynamically fetch more data from cake. My problem is
that the
ajax requests invalidate the current session if Security.level is set
to
high. It works fine with medium.
After searching the web for simil
Just did this recently. I found the following resources valuable:
- Expandable Behavior:
http://debuggable.com/posts/unlimited-model-fields-expandable-behavior:48428c2e-9a88-47ec-ae8e-77a64834cda3
- EAV Plugin: http://github.com/morrislaptop/cakephp-eav/tree/master
- Dynamic Data Fields: Practical
Hey I'm building my site with cakephp and I love it, cakephp has made
it fun again.
However I do use phpbb3 and would like to continue using it as it has
never let me down yet.
My directory is like this
./index.php <-- cake
./cake
./app
So I would like to know what I would have to do to get ph
If you want to stay in Cake-land as much as possible try making use of
the joins key in your options for find().
Nate wrote a nice article showing how to get going:
http://bakery.cakephp.org/articles/view/quick-tip-doing-ad-hoc-joins-in-model-find
General advice (apart from your big search functi
Yes I will be using fbml also. I guess I can use explicit URLs. No
big deal.
Thanks for the excellent help.
On Jun 15, 11:49 pm, "Adam Royle" wrote:
> Sorry, I never used reverse routing like that. Maybe someone else with more
> experience can help out?
>
> With my facebook app I used fbml so
It's possible to use a combination of cake's magic and raw sql together, which
I use occasionally when I need something a bit out of the ordinary but still
want to use the cake methods (to make use of model binding, etc).
eg.
function getHomepageArtists() {
$query = array(
'fields'
Thanks for replying.
Actually, I've got everything properly indexed and closely followed
standards on that. I honestly just wanted to avoid writing a custom
query (lazy me). Was only hoping that there was a way to avoid custom
queries. Will give that a try then.
Thanks!
Femi
Adam Royle wr
Hi Femi,
You should really just use one query for that with a number of joins and let
the database do all the work. My advice is to get someone familiar with sql and
construct the raw query and get it running at a decent speed inside the mysql
console, and then find a way to get that sql into c
Hi all,
I'm having a scalability problem, and urgently need to
refactor. The project is just 2 months old and already has
over 20,000 users.
How do you handle passing an array with 5000+
values as a condition
e.g. $conditions = array('User.id'=>$bigArray);
As the records grow bigger, it tak
Hi Netram,
please read the Cookbook at least once, it will really help you in the
future. There is also the installation manual in there. Follow this
link: http://book.cakephp.org/
greets
Andreas
Netram Dhakar schrieb:
> Hi,
>
> I am new with CakePHP.How to install and configure.
>
> Please he
Lol, please quote the parts where i was ugly to him. I just gave him an
advice AND helped him with his problem! I was constructive, not like you.
Please don't bother me..thx
greets
Andreas
red mcgee schrieb:
> Re: Andreas:
>
> that's a foul way to respond to someone.
> please don't browse the f
PolymorphicBehavior and one or multiple "Attributes" models that you
bind to every model you need to.
Just my thought.
On Jun 15, 11:39 pm, "marco.rizze...@gmail.com"
wrote:
> Hi
> I must use a EAV schema for my web app but I have no idea about how
> realizate this in cake?
> I have a table with
Hey everyone,
Forgive me if I sound like an idiot. I haven't setup a cron job in the
past and I feel I am either missing files or I simply don't
understand. For a school project a friend of mine is trying to setup a
web application(written in cake php). I'm trying to give him a hand,
but I'm not
Hi,
I am new with CakePHP.How to install and configure.
Please help me.
Thanks & Regards
Netram dhakar
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to cake-php
Nobody? :/
--~--~-~--~~~---~--~~
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...@googlegro
Hi Wilson,
thats how my query looks like:
$checklist = $this->Checklist->find('first', array('conditions'
=> array('Checklist.id' => $id),
'contain' =>
array(
'Prod
91 matches
Mail list logo