Sometimes, I give up.
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 4 Nov 2011, at 23:06, Andras Kende wrote:
> Daniel,
>
> The easiest way to do what you need is:
>
> class CategoriesController extends AppController {
>
> public function index($id = null) {
>
what is the request data containing prior to passing them on to the
model?
oh, and why dont u use the session component to access the session?
your code will most certainly trigger lots of warnings
On 5 Nov., 00:20, Will <000w.s.s@gmail.com> wrote:
> Hi all,
>
> I'm using CakePHP 2.0 on a sy
Hi all,
I'm using CakePHP 2.0 on a system running Windows 7, Apache 2, PHP 5.3
and SQL Server. I'm using a User model and UsersController that are
essentially the same as the example in the online book. Here's my add
function:
public function add() {
if($_SESSION['Auth']['User'
Daniel,
The easiest way to do what you need is:
Category->Post->find('all', array(
'conditions' => array('Category.id' => $id),
));
// print_r($posts); to debug...
$this->set(compact('posts'));
}
}
This will just do a single query with 2 left joins..
Just make sure all 3 models has the relati
Aw yeah that's definitely helpful. Thanks! Starting to really enjoy
CakePHP :)
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscr
On Nov 4, 6:55 pm, Jeremy Burns | Class Outfit
wrote:
> It's in the right place but you have amended it.
>
> You are populating a variable called $categories - you normally do that for a
> list. You are using find 'all' and then restricting it with a condition. Use
> find first instead (that
How about something like this...
if(AuthComponent::user('group_id') == 1) {
echo $this->Element('group1View');
}
On Fri, Nov 4, 2011 at 4:11 PM, Nate wrote:
> Just trying to improve how I'm doing things.
>
> I'm checking a user's usergroup id and displaying additional options
> if they are in
Just trying to improve how I'm doing things.
I'm checking a user's usergroup id and displaying additional options
if they are in a particular usergroup. (followed the 2 part ACL
tutorial in the 2.0 book)
Here's an example I have in one of my views, to display different
content if you have the per
It's in the right place but you have amended it.
You are populating a variable called $categories - you normally do that for a
list. You are using find 'all' and then restricting it with a condition. Use
find first instead (that was my original mistake). Your $category variable is
being popula
I'm thinking of apps running on internal banking servers (real case scenario)
where hosting it remotely is a no-no for security reasons. Encrypting that
would be pretty fantastic.
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 4 Nov 2011, at 18:42, WebbedIT wrote:
> @Jeremy: I would
On Nov 4, 6:35 pm, Jeremy Burns | Class Outfit
wrote:
> You're doing something wrong - this is very standard stuff. Have you got the
> Containable behaviour attached to the Category model? Or app_model?
>
Here is my category model:
array(
'notempty' => array(
@Jeremy: I would be wary of allowing any software licensed annually to
be hosted on another server. Apps licensed in this way tend to be more
like an SAAS app and as such would be centrally stored to allow for
maintenance, upgrades etc.
If it is a plugin that we're talking about then the license t
You're doing something wrong - this is very standard stuff. Have you got the
Containable behaviour attached to the Category model? Or app_model?
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 4 Nov 2011, at 17:41, Daniel wrote:
> On Nov 4, 5:20 pm, Jeremy Burns | Class Outfit
> wrote
Hello,
I'm starting to realize my helpers test and reviewing test the core
helpers find a function (getMock ()) and I could not find
documentation of this.
Someone can help me to know he does? or where to find the API
documentation.
Greetings.
--
Our newest site for the community: CakePHP Vid
My workers are just PHP. I've got one doing curl stuff to transfer big
files, and another to drive ffmpeg for slow encodes. You can write
your Gearman clients in pretty much anything, though. They've got a
bunch of client libraries. The PHP one is pretty comprehensive, and
I've experimented with py
On Nov 4, 5:20 pm, Jeremy Burns | Class Outfit
wrote:
> Daniel - this is 101 CakePHP - no, PHP - stuff.
>
> Your controller function will call a model function to do the find. Put the
> code inside that model function. Or - if you want to call this find directly
> from a controller (the revised
Daniel - this is 101 CakePHP - no, PHP - stuff.
Your controller function will call a model function to do the find. Put the
code inside that model function. Or - if you want to call this find directly
from a controller (the revised version I just sent you) - put it in a
controller function (vie
On Nov 4, 5:10 pm, Jeremy Burns | Class Outfit
wrote:
> Can you paste all your model code from the top until the end of this code.
> Looks like you're pasting outside of a function.
>
Your're right, oops, what function should it be in?
--
Our newest site for the community: CakePHP Video Tutori
perhaps you have a missing semicolon on within the code above this
- S
On 4 November 2011 17:08, Daniel wrote:
>$categories = $this->find(
>'all',
>array(
>'conditions' =>
> array('Category.catego
Can you paste all your model code from the top until the end of this code.
Looks like you're pasting outside of a function.
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 4 Nov 2011, at 17:08, Daniel wrote:
>
>
> On Nov 4, 4:49 pm, Jeremy Burns | Class Outfit
> wrote:
>> This code
On Nov 4, 4:49 pm, Jeremy Burns | Class Outfit
wrote:
> This code would go into the Category model.
$categories = $this->find(
'all',
array(
'conditions' => array('Category.category_id' =>
$id),
PPS Gah, really sorry for the spam, it *is* the call to find() where
the problem happens, sorry!
On Nov 4, 4:55 pm, toby1kenobi wrote:
> PS Apologies, to clarify the error happens even with just the call to
> ClassRegistry::init()
>
> On Nov 4, 4:44 pm, toby1kenobi wrote:
>
>
>
>
>
>
>
> > Hi th
PS Apologies, to clarify the error happens even with just the call to
ClassRegistry::init()
On Nov 4, 4:44 pm, toby1kenobi wrote:
> Hi there,
>
> I'm using CakePHP 2, and in the afterFind callback of one model I
> conditionally want to retrieve data from another. The two models
> aren't associa
This code would go into the Category model. If you want to call it from the
categories_controller, make a small change:
$categories = $this->Category->find(...
Still add the Containable behaviour and recursive setting to the Category model
or app_model though.
Jeremy Burns
Class Outfit
http:/
Hi there,
I'm using CakePHP 2, and in the afterFind callback of one model I
conditionally want to retrieve data from another. The two models
aren't associated. In the first model, when certain conditions are
met, I'm trying to do something along the lines of:
$model2 = ClassRegistry::init('Mode
Thanks for your help, but where do I put the "find" ?
On Nov 2, 4:10 am, Jeremy Burns | Class Outfit
wrote:
> This is basic stuff.
>
> var $actsAs = array('Containable');
> var $recursive = -1;
>
> Ideally do this in app_model so that your whole app uses the Contain
> behaviour.
>
> Your Categor
And applying two naming conventions to similar things is kind of
silly. The issues of camelcase folders was discussed on the cakephp-
core list and the general consensus there was to camelcase folders.
This meant the eventual namespace names would be cased the same as
classnames.
-Mark
On Nov 3,
On 4 November 2011 13:09, abhimanyu bv wrote:
> 1.3it is
>
> On Fri, Nov 4, 2011 at 6:27 PM, euromark wrote:
>>
>> cake1.3 or 2.0?
>>
>> On 4 Nov., 13:35, abhimanyu bv wrote:
>> > I am getting the following error when cron is running- 'PHP Fatal
>> > error: Class 'Shell' not found in /var/www/w
maybe you should post your shell code
or better how exactly you try to call your shell
On 4 Nov., 14:09, abhimanyu bv wrote:
> 1.3it is
>
>
>
>
>
>
>
> On Fri, Nov 4, 2011 at 6:27 PM, euromark wrote:
> > cake1.3 or 2.0?
>
> > On 4 Nov., 13:35, abhimanyu bv wrote:
> > > I am getting the followi
This issue was resolved yesterday, please checkout the latest code in the
2.0 branch
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To u
Cron is not only for particular times, its also for recurring events. It
certainly does make sense if you simply set your task to check what time it
is before executing. Then you just "try" to run it every minute (or every
page load), and it will fire only at the appropriate time. This makes
Oh that looks promising, if anything it should at least get us started.
Thank you for that : https://github.com/MSeven/cakephp_queue/wiki
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and h
I was thinking of the new key to display a localised version, but keep the old
one for editing; if you just convert it and then save the record it'd save the
'local' version, wouldn't it?
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 4 Nov 2011, at 13:32, euromark wrote:
> probably
probably
i wouldt apply new keys then, just override the old ones.
if you don't change the current keys your forms will have to be
modified.
There is no jack of all trades device for this, i guess.
setting the default_time_zone to your location only fixes the dtc
problem for this specific country
Couldn't you do an afterFind in a behaviour that sets new keys like 'LocalTime'?
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 4 Nov 2011, at 13:04, euromark wrote:
> maybe you can adopt some of this
> https://raw.github.com/jellehenkens/lemon_utils/master/View/Helper/TimeMachineHelpe
1.3it is
On Fri, Nov 4, 2011 at 6:27 PM, euromark wrote:
> cake1.3 or 2.0?
>
> On 4 Nov., 13:35, abhimanyu bv wrote:
> > I am getting the following error when cron is running- 'PHP Fatal
> > error: Class 'Shell' not found in /var/www/web/vendors/shells/
> > deals.php on line 3'.
> > How to rec
maybe you can adopt some of this
https://raw.github.com/jellehenkens/lemon_utils/master/View/Helper/TimeMachineHelper.php
I am wondering:
How do you guys handle the daylight saving time issue?
Currently we face this problem in 2.0:
- dates (created, modified, own ones) are saved without it (-1 hou
cake1.3 or 2.0?
On 4 Nov., 13:35, abhimanyu bv wrote:
> I am getting the following error when cron is running- 'PHP Fatal
> error: Class 'Shell' not found in /var/www/web/vendors/shells/
> deals.php on line 3'.
> How to rectify this error?
--
Our newest site for the community: CakePHP Video Tu
I am getting the following error when cron is running- 'PHP Fatal
error: Class 'Shell' not found in /var/www/web/vendors/shells/
deals.php on line 3'.
How to rectify this error?
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questi
Hi Paul
Thanks, and yeah, have officially stopped banging head :)
Basically I'm really enjoying cakephp in the few short weeks I've been
using it...and don't want to disparage it - I agree that the issue is
almost without doubt in my code...
I have seen it working ok..as mentioned in my second l
> Same for behavior as you described for me on cake 2.0.2 nginx ubuntu if
> echoing from controller...
Interesting that one can no longer echo from the controller though,
much more tailing required when debugging :)
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakeph
> Same for behavior as you described for me on cake 2.0.2 nginx ubuntu if
> echoing from controller...
>
> I guess its better to use a Views, this works:
>
> Controller :
>
> public function registerc() {
> $data = ………..
> $this->set(compact('data'));
> $this->layout = false;
On Nov 4, 11:41 am, majna wrote:
> @sams and @AD7six
> Yes, one element for each input. Performance is not issue here. Finally,
> you can cache those elements as any other View::element() calls.
Try what you're suggesting and benchmark it before dismissing
performance - rendering elements is no
@sams and @AD7six
Yes, one element for each input. Performance is not issue here. Finally,
you can cache those elements as any other View::element() calls.
This is not only about applying Twitter Bootstrap. FormHelper is not
flexible enough and extending large methods is not best solution.
It'
Hi,
that cake method you call from within the worker, is it written as a shell?
Or how do you do it?
I'm not familiar with gearman, but I think I'm gonna need it soon.
thanks
atenciosamente,
Werner Petry Moraes
werne...@gmail.com
On Fri, Nov 4, 2011 at 06:16, Eric Blanpied wrote:
> I think t
Thanks a lot, i used AD7six's shell . All work , now.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send
On Nov 4, 10:13 am, WebbedIT wrote:
> @Ryan: If you could not raise a smile at Andy's response in this
> thread then you really could do with a weekend off. Your response is
> nicer than Andy's but they both mean the same thing ... "Why on earth
> do you need to protect your code?!?"
Actually
thanks for answer my question. I will tried it .
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send emai
On Nov 4, 2:47 am, Miles J wrote:
> Ive always wanted this. Cakes defaults are pretty handy but once you
> want to break out of the norm it gets tedious.
>
> I would also change the HTML structure but thats just me :P
>
> @Sherlock - There's not much overhead in doing a basic PHP include.
using
I can see a point though. If you develop an application that is going to be
installed on a customer site, encrypting it in someway gives you a degree of
protection, particularly if you sell it on an annual license basis. Without
some sort of key, how can you ensure that they are not still using
Dear Community,
Not sure if this is the right place, but here goes. I've upgraded an
application from 1.3.10 to 2.0.2 and now get the following error:
"Fatal error: Access to undeclared static property: DboSource::
$methodCache in /var/www/html/myapp/lib/Cake/Model/Datasource/
DboSource.php on li
On Nov 4, 9:53 am, Điển vũ wrote:
> Convert UTF-8 Problem with php , but i don't know how to do .
> I want to ask cakephp about this because i use cakephp .
>
> In cakePHP 1.3 i use 'encoding' => 'UTF-8', it is my mistake. Now i known
> it must be 'encoding'=>'uft8' when update to update to cak
@Serkan: post your new question in a new thread please
On Nov 3, 3:59 pm, Serkan Sipahi wrote:
> hi Cake Community,
>
> CakePHP 2.0.2
> OS: Windows7
> Configure::write('debug', 2);
>
> Problem:
> My Auth Component is not working and i dont know why. Need Help.
>
> User Controller:
>
>
> class Us
@Ryan: If you could not raise a smile at Andy's response in this
thread then you really could do with a weekend off. Your response is
nicer than Andy's but they both mean the same thing ... "Why on earth
do you need to protect your code?!?"
@Rizki: I used to believe my code was golden and should
We used to be able to rate posts, when did that dissapear?
On Nov 3, 9:36 pm, Meroe Meroe wrote:
> Wish I could +1 an email.
> On Nov 2, 2011 12:11 AM, "Jeremy Burns | Class Outfit" <
>
>
>
>
>
>
>
> jeremybu...@classoutfit.com> wrote:
> > This is basic stuff.
>
> > var $actsAs = array('Containab
well, it should have been utf8 in the first place (even in 1.3 - it
shouldnt even work with utf-8).
maybe this is the problem?
is it possible that the encoding is already messed up in the database?
take a look at some utf8 content
is the text scrambled or visible?
that would be my guess.
try runni
Whilst I think the rudeness issue is interesting, and I am becoming
more guilty of tinging a lot of my replies with a healthy dose of
sarcasm (can equally be said that some questions are ridiculously rude
and/or very provoking), we have dropped off the main subject here.
@dave: I use radio without
Convert UTF-8 Problem with php , but i don't know how to do .
I want to ask cakephp about this because i use cakephp .
In cakePHP 1.3 i use 'encoding' => 'UTF-8', it is my mistake. Now i known
it must be 'encoding'=>'uft8' when update to update to cakephp 2.0
But i end up submit a lot Japanese c
My experience is that this issue is caused because you screwed up
slightly with your naming conventions (ie, left a foreign key column
pluralized). Try checking those.
On Oct 21, 12:32 pm, mdunham wrote:
> Me to:
>
> Brooksides-MacBook-Pro:app brooksidestudios$ cake bake model all
>
> Welcome to
to the top
On Oct 31, 10:18 pm, WTH wrote:
> Hello,
>
> Are you a Cake/PHP expert? Looking for a challenging project with a
> great company?
>
> We have a penny auction site that we need help with. The first
> project will include helping us implement a caching solution
> (memcached) that will
I think the best way to do it is with a queue. After doing several
websites in which cron jobs were used for various not-so-cron things
(cron job to wake up periodically and check for needed tasks? why not
just spawn the tasks?), I came to the conclusion that a job queue was
a much smarter answer.
What about using javascript. It would only work while the user is on the site,
but it would be able to call a function (also ajax if you want to trigger a php
method) very x seconds.
-flosky
Ryan Schmidt schrieb:
On Nov 4, 2011, at 00:17, zuha wrote:
> is there anyway to run a process sep
62 matches
Mail list logo