Re: Vacancy for a CakePHP developer in London (Farringdon)

2016-04-08 Thread Jeremy Burns : Class Outfit
Thank you, but Delhi is a long commute. I don’t think that will work. This is 
an on site position.

> On 8 Apr 2016, at 08:18, Kamal Deol <kamal.d...@gmail.com> wrote:
> 
> 
> 
> On Fri, Apr 8, 2016 at 8:31 AM, Jeremy Burns <jeremybu...@classoutfit.com 
> <mailto:jeremybu...@classoutfit.com>> wrote:
> An old client of mine is looking someone to take over and develop some code I 
> built for them a year or so ago (CakePHP 2.6). They are only small, so it'd 
> be more of a junior than a senior role (they might consider contract). The 
> business is small but successful and is mainly based in Swindon, but the IT 
> is run from their very small but very friendly London office. The company is 
> run by a really cool switched on chap who understands technology and how 
> important it is to his business. This is an on site only position. No agents 
> or recruiters please.
> 
> Contact me if you'd like to know more. Send me your CV if you'd like to be 
> considered and I'll forward the good ones on to the client.
> 
> -- 
> Sign up for our Newsletter for updates.
> http://cakephp.org/newsletter/signup <http://cakephp.org/newsletter/signup>
>  
> We will soon be closing this Google Group. But don't worry, we have something 
> better coming. Stay tuned for an updated from the CakePHP Team soon.
>  
> Like Us on FaceBook https://www.facebook.com/CakePHP 
> <https://www.facebook.com/CakePHP>
> Follow us on Twitter http://twitter.com/CakePHP <http://twitter.com/CakePHP>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+unsubscr...@googlegroups.com 
> <mailto:cake-php+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> Sign up for our Newsletter for updates.
> http://cakephp.org/newsletter/signup <http://cakephp.org/newsletter/signup>
>  
> We will soon be closing this Google Group. But don't worry, we have something 
> better coming. Stay tuned for an updated from the CakePHP Team soon.
>  
> Like Us on FaceBook https://www.facebook.com/CakePHP 
> <https://www.facebook.com/CakePHP>
> Follow us on Twitter http://twitter.com/CakePHP <http://twitter.com/CakePHP>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+unsubscr...@googlegroups.com 
> <mailto:cake-php+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.
> 

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Vacancy for a CakePHP developer in London (Farringdon)

2016-04-07 Thread Jeremy Burns
An old client of mine is looking someone to take over and develop some code 
I built for them a year or so ago (CakePHP 2.6). They are only small, so 
it'd be more of a junior than a senior role (they might consider 
contract). The business is small but successful and is mainly based in 
Swindon, but the IT is run from their very small but very friendly London 
office. The company is run by a really cool switched on chap who 
understands technology and how important it is to his business. This is an 
on site only position. No agents or recruiters please.

Contact me if you'd like to know more. Send me your CV if you'd like to be 
considered and I'll forward the good ones on to the client.

-- 
Sign up for our Newsletter for updates.
http://cakephp.org/newsletter/signup

We will soon be closing this Google Group. But don't worry, we have something 
better coming. Stay tuned for an updated from the CakePHP Team soon.

Like Us on FaceBook https://www.facebook.com/CakePHP
Follow us on Twitter http://twitter.com/CakePHP
--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Dealing with MASSIVE Model Files

2015-09-09 Thread Jeremy Burns : Class Outfit
I sometimes splice chunks out into behaviours for this reason.

> On 9 Sep 2015, at 08:35, Michael Houghton  wrote:
> 
> I have some big projects in CakePHP and always follow the Fat Models, Skinny 
> Controllers approach.
> 
> The issue I have now, is some of my model files are 5000 lines!
> 
> Is there a better way to decouple code that putting it all into the model 
> files.  How could this code be separated into smaller files otherwise?
> 
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP 
> 
> Find us on Twitter http://twitter.com/CakePHP 
> 
> --- 
> You received this message because you are subscribed to the Google Groups 
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to cake-php+unsubscr...@googlegroups.com 
> .
> To post to this group, send email to cake-php@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/cake-php 
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3 Component

2015-07-18 Thread Jeremy Burns : Class Outfit
Yup - I understand that. But a method in a skinny controller (which I 
appreciate is the element that should provide feedback on progress) hands off 
to a single model function which then follows business rules and runs a series 
of processes in sequence. So my question is “when the progress one wants to 
track is within the model layer, how does one expose that to the controller 
layer”?

 On 18 Jul 2015, at 11:56, euromark dereurom...@gmail.com wrote:
 
 multi-step sounds like the C in MVC. the model itself has nothing to do with 
 stateful requests IMO.
 
 Am Freitag, 17. Juli 2015 11:08:21 UTC+2 schrieb Jeremy Burns:
 What about the situation where you have a multi-step process inside a model/s 
 and you want to make the progress status available to javascript calls?
 
 On 17 Jul 2015, at 09:55, euromark dereu...@gmail.com javascript: wrote:
 
 Your models should stay stateless, as such you should never internally use 
 the session.
 Instead, pass the data to the model layer or use events to pass them
 
 Use https://github.com/UseMuffin/Footprint 
 https://github.com/UseMuffin/Footprint
 
 Mark
 
 
 Am Donnerstag, 16. Juli 2015 23:03:45 UTC+2 schrieb Rafael Queiroz:
 Hi guys,
 
 I need loaded components in my Models, actually Auth Component, for store 
 user id logged. In old version, CakePHP 2.x, i using in my model:
 
 App::uses('AuthComponent', 'Controller/Component');
 
 public function beforeSave() {
 if (!$this-id) {
 $this-data[$this-alias]['user_id'] = AuthComponent::user('id');
 }
 }
 
 It's possible in Cake 3 ?
 
 -- 
 Atenciosamente,
 
 Rafael F. Queiroz
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP 
 https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+u...@googlegroups.com javascript:.
 To post to this group, send email to cake...@googlegroups.com javascript:.
 Visit this group at http://groups.google.com/group/cake-php 
 http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP 
 https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com 
 mailto:cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com 
 mailto:cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php 
 http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP 3 Component

2015-07-17 Thread Jeremy Burns : Class Outfit
What about the situation where you have a multi-step process inside a model/s 
and you want to make the progress status available to javascript calls?

 On 17 Jul 2015, at 09:55, euromark dereurom...@gmail.com wrote:
 
 Your models should stay stateless, as such you should never internally use 
 the session.
 Instead, pass the data to the model layer or use events to pass them
 
 Use https://github.com/UseMuffin/Footprint
 
 Mark
 
 
 Am Donnerstag, 16. Juli 2015 23:03:45 UTC+2 schrieb Rafael Queiroz:
 Hi guys,
 
 I need loaded components in my Models, actually Auth Component, for store 
 user id logged. In old version, CakePHP 2.x, i using in my model:
 
 App::uses('AuthComponent', 'Controller/Component');
 
 public function beforeSave() {
 if (!$this-id) {
 $this-data[$this-alias]['user_id'] = AuthComponent::user('id');
 }
 }
 
 It's possible in Cake 3 ?
 
 -- 
 Atenciosamente,
 
 Rafael F. Queiroz
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP 
 https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com 
 mailto:cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com 
 mailto:cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php 
 http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: AWS, Centos 7 and file caching

2015-05-24 Thread Jeremy Burns
Nope. We rebuilt the box with another version of Linux.

 On 25 May 2015, at 04:15, HL lecaoquoch...@gmail.com wrote:
 
 I met the same error. Did you fixed it? Thanks
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP 
 https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com 
 mailto:cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com 
 mailto:cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php 
 http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout 
 https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Saving test results

2015-03-17 Thread Jeremy Burns
I have a fixture:

public $import = array('model' = 'TestQuote', 'records' = true);

...which, as you'd expect, creates a table in my test database and imports 
the records. My test case iterates over the rows and runs a test quote for 
each row, comparing an expected price with a returned price. I want to 
capture the returned price and save it back into the test_quotes table in 
my default database so that test users can (i) manage the test quote cases 
and (2) see the results after testing.

How can I do this please?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Saving test results

2015-03-17 Thread Jeremy Burns
And then I found the solution.

// Set up the test model as normal:
$this-TestQuote = ClassRegistry::init('TestQuote');

// Then set up a duplicate model with a different name
$this-TestQuoteSource = ClassRegistry::init('TestQuote');

// Then set the datasource of the duplicate
$this-TestQuoteSource-setDatasource('default');

// At the point I want to save back to the source table:
$this-TestQuoteSource-id = $testQuote['TestQuote']['id'];
$this-TestQuoteSource-saveField('actual_price', $actualPrice);

On Tuesday, 17 March 2015 10:07:36 UTC, Jeremy Burns wrote:

 I have a fixture:

 public $import = array('model' = 'TestQuote', 'records' = true);

 ...which, as you'd expect, creates a table in my test database and imports 
 the records. My test case iterates over the rows and runs a test quote for 
 each row, comparing an expected price with a returned price. I want to 
 capture the returned price and save it back into the test_quotes table in 
 my default database so that test users can (i) manage the test quote cases 
 and (2) see the results after testing.

 How can I do this please?


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Wordpress

2014-12-14 Thread Jeremy Burns
So I'm two and a half months into a project replacing an e-commerce site 
with a custom built CakePHP site. The current site starts in Wordpress 
(LAMP) and flips to a horribly written PHP site (WAMP) with all sorts of 
reverse proxies and stuff going on. The client has now decided they want to 
retain the Wordpress site for CMS (I get that) and because it has great SEO 
rankings (I get that too). However, they want everything to happen inside 
Wordpress rather than flipping out to a stand alone site for order 
processing. I've already written much of the back end order processing 
stuff in Cake and it makes sense to retain that.

My question is: how can I display Cake elements (or views) inside the 
Wordpress site? For example, there's a quote form that takes in the 
customer's requirements, puts it through some fairly detailed calculations 
and returns prices, up-sells and postage details. My initial thoughts are 
to make an ajax call to the Cake API and return either fully rendered HTML 
or perhaps just some json data.  Before I spend days trying stuff out is 
there another route? Does anyone have any experience or advice? Should 
Wordpress exist in the webfoot folder (as if it were just being used as a 
blog) or should they be on separate domains ('/' and /-api, for example)? 
The next challenge will be sharing session information but there's plenty 
of existing searches for that.

Thanks.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: The (bad) perception and image of CakePHP in the public

2014-10-01 Thread Jeremy Burns : Class Outfit
I've found the documentation pretty good on the whole, but there are two common 
issues:

1) It sometimes it lacks context. I can see the code example, but where does it 
go, what does it rely on and what does it impact?
2) It sometimes relies on an existing knowledge of the subject matter or 
something related, so it doesn't always make sense.

- Jeremy

On 1 Oct 2014, at 19:56, mark_story mark.st...@gmail.com wrote:

 As someone who writes a pile of documentation, what kinds of advanced things 
 have you found lacking? I've found it challenging to add more advanced 
 examples as they often end up being very situational and we'll always have 
 some use case that doesn't have a full example. I'm interested in what you've 
 found lacking, perhaps there are generic enough examples that can be added.
 
 -Mark
 
 On Wednesday, 1 October 2014 11:42:59 UTC-4, John Sposato wrote:
 I think it's interesting that some people say the docs are terrible and 
 others list documentation as a reason why it's cool or productive.
 
 If you're build a blog application that will only do simple relationships and 
 not a lot of complex things, the documentation is great.  However, we 
 typically don't do things that simple.  We find the documentation lacking for 
 more advanced users.  And, since we're always pressed for time, figuring it 
 out isn't always a viable solution. 
 
 If you want people to come to your framework, the #1 thing should be 
 documentation. CakePHP 2.x is stable and works well so maybe some effort 
 could be redirected into adding to/improving the documentation?
 
 On Tuesday, September 30, 2014 4:28:32 AM UTC-4, José Lorenzo wrote:
 Before giving my own view into this problem, you you guys list the reasons 
 why you think CakePHP is a cool or productive framework to work with? Just 
 give me 3 reasons, no comparisons with other frameworks
 
 On Tuesday, September 30, 2014 6:24:30 AM UTC+2, Jeremy Burns wrote:
 This is so true. I'm a huge fan of Cake but we do feel like the whipping boys 
 sometimes. I recently hired someone into a project and the first thing he 
 tried to do was change the framework for a whole bunch of vague reasons like 
 'Laravel is just so much better'.
 
 Perhaps someone can devise some simple benchmarking challenges that the 
 guardians of the various frameworks can take up themselves and then compare 
 the actual results, rather than letting a random person do it out of the box. 
 A competition, if you will. So, for example, write a thousand records to a 
 database, read them back, perform some function and render them to screen. 
 Yes, yes, I know there would need to be some element of a level playing field 
 with server spec and the like, but it could be done. Then each framework can 
 show it's own best efforts and - importantly - will have no excuses about not 
 understanding the framework or setting it up correctly.
 
 I haven't had a 'job' for the past six years, but on the odd time that I 
 decide a regular income would be nice I rarely - if ever - see CakePHP as a 
 requirement. It's always Symfony, Zend, Drupal, Code Ingniter, sometimes 
 Laravel, sometimes ROR and sometimes something else. That's awkward and I 
 just can't help wondering if I am swimming against a tide. Perhaps everyone 
 else is right and I am wrong? TBH, I'm not clever enough to be able to 
 explain why Cake is the right choice compared to others; some help there 
 would be cool.
 
 On 30 Sep 2014, at 00:43, Reuben reuben...@gmail.com wrote:
 
 My apologies, dereuromark, for the incorrect spelling of your handle.
 
 On Tuesday, 30 September 2014 09:40:31 UTC+10, Reuben wrote:
 The few times that I've seen CakePHP compared to other PHP frameworks is in 
 performance tests, and it never looks pretty.  Usually the test is a very 
 simple Hello World test, or an action that reads/writes a bunch of records 
 to the database.  Not really real work tests, and no effort to configure the 
 application to make sure it's doing the best that it can (i.e. appropriate 
 cache options, etc).  
 
 There have been a few articles written on CakePHP and performance, and all 
 the stuff you can do before complaining about the framework itself.
 
 Unfortunately, when people are comparing PHP frameworks, they just look for 
 that performance index, and don't take too much notice of the merits of the 
 performance test taken.
 
 My perception is that at last check, there might be room for improvement in 
 the event model, but I don't do all the other things that can be done to get 
 better performance out of CakePHP, before going there, so it's never been an 
 issue for me.  I also understand that start up times have been improved with 
 CakePHP 3, and the routing configuration required.
 
 Of course, CakePHP is more than just performance of the framework.  The 
 documentation is great, the community is great and the core development team 
 are very approachable, via groups, irc and github issues. And the code 
 itself

Re: The (bad) perception and image of CakePHP in the public

2014-09-30 Thread Jeremy Burns : Class Outfit
My reasons are more practical than technical, but still very relevant:

1. Familiarity
2. Speed to get-go
3. Well maintained/supported

Without deep knowledge of other frameworks it's hard to come up with technical 
arguments, but I'd love have them in my armoury.

- Jeremy

On 30 Sep 2014, at 09:28, José Lorenzo jose@gmail.com wrote:

 Before giving my own view into this problem, you you guys list the reasons 
 why you think CakePHP is a cool or productive framework to work with? Just 
 give me 3 reasons, no comparisons with other frameworks
 
 On Tuesday, September 30, 2014 6:24:30 AM UTC+2, Jeremy Burns wrote:
 This is so true. I'm a huge fan of Cake but we do feel like the whipping boys 
 sometimes. I recently hired someone into a project and the first thing he 
 tried to do was change the framework for a whole bunch of vague reasons like 
 'Laravel is just so much better'.
 
 Perhaps someone can devise some simple benchmarking challenges that the 
 guardians of the various frameworks can take up themselves and then compare 
 the actual results, rather than letting a random person do it out of the box. 
 A competition, if you will. So, for example, write a thousand records to a 
 database, read them back, perform some function and render them to screen. 
 Yes, yes, I know there would need to be some element of a level playing field 
 with server spec and the like, but it could be done. Then each framework can 
 show it's own best efforts and - importantly - will have no excuses about not 
 understanding the framework or setting it up correctly.
 
 I haven't had a 'job' for the past six years, but on the odd time that I 
 decide a regular income would be nice I rarely - if ever - see CakePHP as a 
 requirement. It's always Symfony, Zend, Drupal, Code Ingniter, sometimes 
 Laravel, sometimes ROR and sometimes something else. That's awkward and I 
 just can't help wondering if I am swimming against a tide. Perhaps everyone 
 else is right and I am wrong? TBH, I'm not clever enough to be able to 
 explain why Cake is the right choice compared to others; some help there 
 would be cool.
 
 On 30 Sep 2014, at 00:43, Reuben reuben.he...@gmail.com wrote:
 
 My apologies, dereuromark, for the incorrect spelling of your handle.
 
 On Tuesday, 30 September 2014 09:40:31 UTC+10, Reuben wrote:
 The few times that I've seen CakePHP compared to other PHP frameworks is in 
 performance tests, and it never looks pretty.  Usually the test is a very 
 simple Hello World test, or an action that reads/writes a bunch of records 
 to the database.  Not really real work tests, and no effort to configure the 
 application to make sure it's doing the best that it can (i.e. appropriate 
 cache options, etc).  
 
 There have been a few articles written on CakePHP and performance, and all 
 the stuff you can do before complaining about the framework itself.
 
 Unfortunately, when people are comparing PHP frameworks, they just look for 
 that performance index, and don't take too much notice of the merits of the 
 performance test taken.
 
 My perception is that at last check, there might be room for improvement in 
 the event model, but I don't do all the other things that can be done to get 
 better performance out of CakePHP, before going there, so it's never been an 
 issue for me.  I also understand that start up times have been improved with 
 CakePHP 3, and the routing configuration required.
 
 Of course, CakePHP is more than just performance of the framework.  The 
 documentation is great, the community is great and the core development team 
 are very approachable, via groups, irc and github issues. And the code 
 itself, should you need to look at it, is very readable.  The only part that 
 makes my brain hurt a little is the event system, especially when trying to 
 work out, when this event is fired, what is listening for it in the CakePHP 
 core.  
 
 Maybe there could be some articles written about the CakePHP core, to make 
 TheBakery a little more attractive to read. I'm more likely to read CakePHP 
 articles from Mark Story, AD7six or deuromark than peruse the 1 or 2 
 paragraph articles on TheBakery.
 
 Regards
 Reuben Helms
 
 On Tuesday, 30 September 2014 07:15:54 UTC+10, Florian Krämer wrote:
 In the official CakePHP Facebook group Yanuar Nurcahyo asked about opinions 
 on that link 
 http://www.quora.com/Why-isnt-Cakephp-popular-despite-being-one-of-the-earliest-php-framework-to-be-written
 
 I'll quote my own comment I've added to that posting:
 
 I'm a little shocked about the wrong information people spreading there as 
 well as the amount of false information. Especially the one that got 4 
 up-votes. Most of the answers there read like FUD or written by people who 
 can't or won't read documentation. Also I really don't get why people always 
 need bleeding edge php support. There is no urgent need or do you migrate 
 you app / server to a new php version just because it's cool? The only 
 problem

Re: The (bad) perception and image of CakePHP in the public

2014-09-29 Thread Jeremy Burns : Class Outfit
This is so true. I'm a huge fan of Cake but we do feel like the whipping boys 
sometimes. I recently hired someone into a project and the first thing he tried 
to do was change the framework for a whole bunch of vague reasons like 'Laravel 
is just so much better'.

Perhaps someone can devise some simple benchmarking challenges that the 
guardians of the various frameworks can take up themselves and then compare the 
actual results, rather than letting a random person do it out of the box. A 
competition, if you will. So, for example, write a thousand records to a 
database, read them back, perform some function and render them to screen. Yes, 
yes, I know there would need to be some element of a level playing field with 
server spec and the like, but it could be done. Then each framework can show 
it's own best efforts and - importantly - will have no excuses about not 
understanding the framework or setting it up correctly.

I haven't had a 'job' for the past six years, but on the odd time that I decide 
a regular income would be nice I rarely - if ever - see CakePHP as a 
requirement. It's always Symfony, Zend, Drupal, Code Ingniter, sometimes 
Laravel, sometimes ROR and sometimes something else. That's awkward and I just 
can't help wondering if I am swimming against a tide. Perhaps everyone else is 
right and I am wrong? TBH, I'm not clever enough to be able to explain why Cake 
is the right choice compared to others; some help there would be cool.

On 30 Sep 2014, at 00:43, Reuben reuben.he...@gmail.com wrote:

 My apologies, dereuromark, for the incorrect spelling of your handle.
 
 On Tuesday, 30 September 2014 09:40:31 UTC+10, Reuben wrote:
 The few times that I've seen CakePHP compared to other PHP frameworks is in 
 performance tests, and it never looks pretty.  Usually the test is a very 
 simple Hello World test, or an action that reads/writes a bunch of records to 
 the database.  Not really real work tests, and no effort to configure the 
 application to make sure it's doing the best that it can (i.e. appropriate 
 cache options, etc).  
 
 There have been a few articles written on CakePHP and performance, and all 
 the stuff you can do before complaining about the framework itself.
 
 Unfortunately, when people are comparing PHP frameworks, they just look for 
 that performance index, and don't take too much notice of the merits of the 
 performance test taken.
 
 My perception is that at last check, there might be room for improvement in 
 the event model, but I don't do all the other things that can be done to get 
 better performance out of CakePHP, before going there, so it's never been an 
 issue for me.  I also understand that start up times have been improved with 
 CakePHP 3, and the routing configuration required.
 
 Of course, CakePHP is more than just performance of the framework.  The 
 documentation is great, the community is great and the core development team 
 are very approachable, via groups, irc and github issues. And the code 
 itself, should you need to look at it, is very readable.  The only part that 
 makes my brain hurt a little is the event system, especially when trying to 
 work out, when this event is fired, what is listening for it in the CakePHP 
 core.  
 
 Maybe there could be some articles written about the CakePHP core, to make 
 TheBakery a little more attractive to read. I'm more likely to read CakePHP 
 articles from Mark Story, AD7six or deuromark than peruse the 1 or 2 
 paragraph articles on TheBakery.
 
 Regards
 Reuben Helms
 
 On Tuesday, 30 September 2014 07:15:54 UTC+10, Florian Krämer wrote:
 In the official CakePHP Facebook group Yanuar Nurcahyo asked about opinions 
 on that link 
 http://www.quora.com/Why-isnt-Cakephp-popular-despite-being-one-of-the-earliest-php-framework-to-be-written
 
 I'll quote my own comment I've added to that posting:
 
 I'm a little shocked about the wrong information people spreading there as 
 well as the amount of false information. Especially the one that got 4 
 up-votes. Most of the answers there read like FUD or written by people who 
 can't or won't read documentation. Also I really don't get why people always 
 need bleeding edge php support. There is no urgent need or do you migrate 
 you app / server to a new php version just because it's cool? The only 
 problem that CakePHP has is an image problem.
 
 What I would like to discuss in this thread is reasons and solution to them. 
 Why has CakePHP such a negative perception? The thing that bothers me 
 personally the most is why the *uck do people say it has a bad documentation? 
 Seriously, I don't get it. Can't they find the documentation? Can't they use 
 it? Or is it really just FUD by some random-framework fanboys?
 
 The stone age php version isn't a very valid argument IMHO. Yes, I agree, 
 CakePHP felt behind other frameworks for at least ~2 years and I've missed 
 the namespace support more than one time. But that was really the only 
 language 

Re: Warning (512): cake_model cache was unable to write

2014-09-29 Thread Jeremy Burns
I had a similar issue when running MAMP locally. I fixed it by turning off 
MAMP's internal caching. Not sure if that's the same issue you're facing.

On 30 Sep 2014, at 01:12, Andras Kende and...@gmail.com wrote:

 Try deleting the files within app/tmp folders.
 
 and adding  'mask' = 0777 to
 core.php
 Cache::config('_cake_core_', array(...
 Cache::config('_cake_model_', array(...
 https://github.com/cakephp/cakephp/blob/master/app/Config/core.php#L294
 
 Andras Kende
 
 
 On Sep 29, 2014, at 4:02 PM, ajt jagguy...@gmail.com wrote:
 
 2.5 but I checked many posts on the issue and I dont think that makes any 
 difference.
 The only solution was to chmod the app/tmp folders and subfolders but i did 
 that.
 
 I am using cpanel and have no command prompt to run scripts
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Angular/Polymer web components and CakePHP

2014-09-22 Thread Jeremy Burns
Canvassing some opinion...

I'm just about to start a project that has an Angular and/or Polymer web 
components front end, so the API only ever needs to send JSON responses and 
receive normal posts/get requests. As such, there is no need for the 'V' 
part of an MVC framework. I know CakePHP can do this very well (I've 
already built one) but is it still considered the best/an ideal framework 
for this purpose?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Angular/Polymer web components and CakePHP

2014-09-22 Thread Jeremy Burns
Good thoughts. The downside of familiarity, of course, is that I could be 
missing out on something better by sticking to what I know best. You are right 
about the V layer though.

On 22 Sep 2014, at 12:52, Dr. Tarique Sani tariques...@gmail.com wrote:

 You mean should you learn an entire new framework so that you could have one 
 layer less :D 
 
 Whenever I get such projects the temptation is strong to go with some of the 
 so called REST api frameworks but I keep coming back to cake for the 
 familiarity and flexibility. Imaging if you did want a V layer at a later 
 date...
 
 Just my 2c
 
 T  
 
 On Mon, Sep 22, 2014 at 2:27 PM, Jeremy Burns jeremybu...@classoutfit.com 
 wrote:
 Canvassing some opinion...
 
 I'm just about to start a project that has an Angular and/or Polymer web 
 components front end, so the API only ever needs to send JSON responses and 
 receive normal posts/get requests. As such, there is no need for the 'V' part 
 of an MVC framework. I know CakePHP can do this very well (I've already built 
 one) but is it still considered the best/an ideal framework for this purpose?
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 
 
 -- 
 =
 Hire a CakePHP dev team : http://sanisoft.com
 =
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 'In test' global variable?

2014-09-17 Thread Jeremy Burns : Class Outfit
I changed tack again as ajax requests (or requests that expect a json response) 
are setting debug to 0 in AppController. Instead, I Configure::write('in_test', 
true) in the setup of each test case, and check it in the main code. it works.

On 17 Sep 2014, at 05:30, Jeremy Burns jeremybu...@me.com wrote:

 Thanks everyone. I'm using HttpSocket to post JSON data to Mandrill rather 
 than using CakeEmail.
 
 On 16 Sep 2014, at 20:19, Stephen S hellospeak...@gmail.com wrote:
 
 If you don't want to write something like that, I have a blog post here with 
 code you could use providing your cake version is 2.4.x (Since been updated 
 but yet to post about it, it has flaws)
 
 http://www.stephenspeakman.co.uk/cakephp-sending-emails-in-the-background/
 
 Just don't enable the shell to send from the database
 
 On 16 September 2014 20:16, Stephen S hellospeak...@gmail.com wrote:
 You could define more than one email config, have a config to save the email 
 to a database table or similar and one to actually send the email using 
 Mandrill.
 
 Depending on where you send emails from you could use 
 AppController::beforeFilter() or elsewhere, simple example:
 
 $emailConfig = (Configure::read('debug')  0) ? 'database' : 'default'
 Configure::write('Email.config', $emailConfig);
 
 //.. somewhere else
 
 $email = new CakeEmail();
 $email-config(Configure::read('Email.config'));
 
 On 16 September 2014 14:24, Jeremy Burns : Class Outfit 
 jeremybu...@classoutfit.com wrote:
 Thanks Mark. After writing I decided to check the debug level. If  0 (i.e. 
 potentially in test) don't send the emails. I send via Mandrill so can't 
 easily log the result without actually sending it. It's cool.
 
 On 16 Sep 2014, at 14:14, euromark dereurom...@gmail.com wrote:
 
 I use custom Configure keys for my EmailLib (extends CakeEmail):
 
 Don't send emails without Configure::write('Email.live'), but log them away 
 verbosely. For testing.
 Basically, you will have to add something like this on your own I am afraid
 
 mark
 
 
 Am Dienstag, 16. September 2014 14:04:48 UTC+2 schrieb Jeremy Burns:
 My model code sends out emails, so when I run my test suite the system 
 triggers multiple emails - which is potentially bad for spam ratings. Is 
 there a global variable I can check so that when 'in test' the messages 
 aren't triggered?
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 
 
 -- 
 Kind Regards
  Stephen Speakman
 
 
 
 -- 
 Kind Regards
  Stephen Speakman
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https

'In test' global variable?

2014-09-16 Thread Jeremy Burns
My model code sends out emails, so when I run my test suite the system 
triggers multiple emails - which is potentially bad for spam ratings. Is 
there a global variable I can check so that when 'in test' the messages 
aren't triggered?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 'In test' global variable?

2014-09-16 Thread Jeremy Burns : Class Outfit
Thanks Mark. After writing I decided to check the debug level. If  0 (i.e. 
potentially in test) don't send the emails. I send via Mandrill so can't easily 
log the result without actually sending it. It's cool.

On 16 Sep 2014, at 14:14, euromark dereurom...@gmail.com wrote:

 I use custom Configure keys for my EmailLib (extends CakeEmail):
 
 Don't send emails without Configure::write('Email.live'), but log them away 
 verbosely. For testing.
 Basically, you will have to add something like this on your own I am afraid
 
 mark
 
 
 Am Dienstag, 16. September 2014 14:04:48 UTC+2 schrieb Jeremy Burns:
 My model code sends out emails, so when I run my test suite the system 
 triggers multiple emails - which is potentially bad for spam ratings. Is 
 there a global variable I can check so that when 'in test' the messages 
 aren't triggered?
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 'In test' global variable?

2014-09-16 Thread Jeremy Burns
Thanks everyone. I'm using HttpSocket to post JSON data to Mandrill rather than 
using CakeEmail.

On 16 Sep 2014, at 20:19, Stephen S hellospeak...@gmail.com wrote:

 If you don't want to write something like that, I have a blog post here with 
 code you could use providing your cake version is 2.4.x (Since been updated 
 but yet to post about it, it has flaws)
 
 http://www.stephenspeakman.co.uk/cakephp-sending-emails-in-the-background/
 
 Just don't enable the shell to send from the database
 
 On 16 September 2014 20:16, Stephen S hellospeak...@gmail.com wrote:
 You could define more than one email config, have a config to save the email 
 to a database table or similar and one to actually send the email using 
 Mandrill.
 
 Depending on where you send emails from you could use 
 AppController::beforeFilter() or elsewhere, simple example:
 
 $emailConfig = (Configure::read('debug')  0) ? 'database' : 'default'
 Configure::write('Email.config', $emailConfig);
 
 //.. somewhere else
 
 $email = new CakeEmail();
 $email-config(Configure::read('Email.config'));
 
 On 16 September 2014 14:24, Jeremy Burns : Class Outfit 
 jeremybu...@classoutfit.com wrote:
 Thanks Mark. After writing I decided to check the debug level. If  0 (i.e. 
 potentially in test) don't send the emails. I send via Mandrill so can't 
 easily log the result without actually sending it. It's cool.
 
 On 16 Sep 2014, at 14:14, euromark dereurom...@gmail.com wrote:
 
 I use custom Configure keys for my EmailLib (extends CakeEmail):
 
 Don't send emails without Configure::write('Email.live'), but log them away 
 verbosely. For testing.
 Basically, you will have to add something like this on your own I am afraid
 
 mark
 
 
 Am Dienstag, 16. September 2014 14:04:48 UTC+2 schrieb Jeremy Burns:
 My model code sends out emails, so when I run my test suite the system 
 triggers multiple emails - which is potentially bad for spam ratings. Is 
 there a global variable I can check so that when 'in test' the messages 
 aren't triggered?
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 
 
 -- 
 Kind Regards
  Stephen Speakman
 
 
 
 -- 
 Kind Regards
  Stephen Speakman
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: problems while upgrading from cakephp 1.2.5 to 2.5.3

2014-08-25 Thread Jeremy Burns : Class Outfit
You'll need to add a beforeFilter function (you'll find yourself using this a 
lot in the future): http://book.cakephp.org/2.0/en/controllers.html

On 23 Aug 2014, at 22:16, 'Dallas' via CakePHP cake-php@googlegroups.com 
wrote:

 Hello again Jeremy,
 Can you explain?  I do not see beforeFilter?  I tried to just remove but I 
 get another error message.
 Thanks
 D
 
 On Friday, August 22, 2014 10:03:44 PM UTC-4, Dallas wrote:
 I have migrated from  cakephp 1.2.5 to Cake 2.5.3 by installing new cake, 
 importing old database and importing files.  I have made changes to file as 
 per the migration guides but I am getting this error:Error: syntax error, 
 unexpected '$this' (T_VARIABLE), expecting function (T_FUNCTION)  
 File: 
 /home/dallasrosie/public_html/musicthatjumpedtheshark.com/app/Controller/GroupsController.php

 Line: 43
 here is line 43 of GroupsController.php:
   // Pass through the request and response objects 
 // AND declare the visibility of the method
 public function __construct($request = null, $response = null)
 {
 parent::__construct($request, $response);
 }
 $this-Layout = 'home';
 $this-PageTitle = 'Music That Jumped the Shark ~ groups';
 
 // get the random ad links
 include('includes/ad_selection.php');
 $this-set('top_ads', $_ads_top_link);
 $this-set('side_ads', $_ads_side_link);
 $this-top_ad_links = $_ads_top_link;
 $this-side_ad_links = $_ads_side_link;
 }
 
 // DEBUG
 public function under_construction()
 {
 $this-layout = 'temp';
 
 }
 I am getting this message on all pages like this: 
 musicthatjumpedtheshark.com/groups   /genres ...
 
 and on the blogs/   page I get this error?
 Error: Call to a member function parseAccept() on a non-object
 File: 
 /home/dallasrosie/public_html/musicthatjumpedtheshark.com/lib/Cake/Controller/Component/RequestHandlerComponent.php
  
 Line: 157
 here is line 157:
if (!$resp-is_valid)
 {
 # set the error code so that we can display it
 $comment_errors['captcha'] = 'span class=errorincorrect 
 response/span';
 $ret = false;
 }
 }
 
 // validate comment
 if($data['comment'] == '')
 {
 $comment_errors['comment'] = 'span class=errorcomment may not 
 be empty/span';
 $ret = false;
 }
 
 Please help.  I don't know if I should be using some kind of shell to upgrade 
 - I don't know how to use them yet.  Any suggestions are GREATLY appreciated.
 Thank you.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: problems while upgrading from cakephp 1.2.5 to 2.5.3

2014-08-23 Thread Jeremy Burns : Class Outfit
The $this statements need to sit inside a function - probably beforeFilter in 
your case.

On 23 Aug 2014, at 03:03, 'Dallas' via CakePHP cake-php@googlegroups.com 
wrote:

 I have migrated from  cakephp 1.2.5 to Cake 2.5.3 by installing new cake, 
 importing old database and importing files.  I have made changes to file as 
 per the migration guides but I am getting this error:Error: syntax error, 
 unexpected '$this' (T_VARIABLE), expecting function (T_FUNCTION)  
 File: 
 /home/dallasrosie/public_html/musicthatjumpedtheshark.com/app/Controller/GroupsController.php

 Line: 43
 here is line 43 of GroupsController.php:
   // Pass through the request and response objects 
 // AND declare the visibility of the method
 public function __construct($request = null, $response = null)
 {
 parent::__construct($request, $response);
 }
 $this-Layout = 'home';
 $this-PageTitle = 'Music That Jumped the Shark ~ groups';
 
 // get the random ad links
 include('includes/ad_selection.php');
 $this-set('top_ads', $_ads_top_link);
 $this-set('side_ads', $_ads_side_link);
 $this-top_ad_links = $_ads_top_link;
 $this-side_ad_links = $_ads_side_link;
 }
 
 // DEBUG
 public function under_construction()
 {
 $this-layout = 'temp';
 
 }
 I am getting this message on all pages like this: 
 musicthatjumpedtheshark.com/groups   /genres ...
 
 and on the blogs/   page I get this error?
 Error: Call to a member function parseAccept() on a non-object
 File: 
 /home/dallasrosie/public_html/musicthatjumpedtheshark.com/lib/Cake/Controller/Component/RequestHandlerComponent.php
  
 Line: 157
 here is line 157:
if (!$resp-is_valid)
 {
 # set the error code so that we can display it
 $comment_errors['captcha'] = 'span class=errorincorrect 
 response/span';
 $ret = false;
 }
 }
 
 // validate comment
 if($data['comment'] == '')
 {
 $comment_errors['comment'] = 'span class=errorcomment may not 
 be empty/span';
 $ret = false;
 }
 
 Please help.  I don't know if I should be using some kind of shell to upgrade 
 - I don't know how to use them yet.  Any suggestions are GREATLY appreciated.
 Thank you.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Security salt issue

2014-08-23 Thread Jeremy Burns : Class Outfit
I'd use the value from your old installation as it is used to encrypt passwords 
- if the salt is different no one will be able to log in as the encrypted 
version of the password they enter will not match the encrypted value stored in 
the database.

On 23 Aug 2014, at 03:25, 'Dallas' via CakePHP cake-php@googlegroups.com 
wrote:

 I installed a new version of Cakephp 2.5.3 and am migrating old files.  When 
 I first set up I used a new security salt number then I changed to the salt 
 number from the older version I was migrating because I read that I should do 
 this.  Now I am getting this message:
 
 Notice (1024): Please change the value of 'Security.salt' in 
 APP/Config/core.php to a salt value specific to your application. 
 [CORE/Cake/Utility/Debugger.php, line 846]
 
 Is there a way I can correct this - or should I re-instal and put former salt 
 value in so it gets set right?  Is there a way to correct this in the 
 database?
 
 Thank you.
 Dallas
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Advice on MVC pattern for stats site

2014-08-05 Thread Jeremy Burns : Class Outfit
I'd make them either separate controller actions or a single action that 
accepts a parameter and then tidy them up with a route. The controller function 
can then either render the view associated with the action(s), specify a view 
to render and/or specify a layout.


On 5 Aug 2014, at 20:08, Russell Lewis russell.le...@gmail.com wrote:

 I'm building an application that serves statistics for a local sports league. 
  I'd like to have separate views for the data depending on if the stats are 
 form league games or tournaments or just practice.  Ideally, a user would go 
 to domain.com/tournament/ or /league/ or /practice/ and get directed 
 appropriately.  Since I want to use different layouts, views, etc for each 
 different area but the underlying Models are going to be the same no matter 
 what.  I'm curious what the CakePHP way would be to accomplish this.  My 
 thinking right now is to have separate league, tournament and practice 
 controllers that don't actually tie to models themselves but just serve to 
 encapsulate the different areas of the site.  Does that make sense?  Is there 
 a smarter way to design this?  Gotchas or issues that might arise using 
 controllers that way?
 
 Thanks!
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Testing fixtures

2014-08-02 Thread Jeremy Burns
When I run my 'All models' test I can get different results than when I run 
each model individually, presumably because loaded fixtures have been 
updated in previous tests. How can I clear down previously loaded fixtures 
at the beginning of each test suite?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 403 error

2014-07-31 Thread Jeremy Burns : Class Outfit
Thanks Andy. Turns out it was something much simpler. I use MAMP Pro and had 
the cache module set to APC. As soon as I turned that off the issue went away.

On 31 Jul 2014, at 06:52, AD7six andydawso...@gmail.com wrote:

 That sounds like a consequence of web requests and CLI requests sharing the 
 same tmp folder. E.g. executing Console/cake as root will create cache and 
 log files which the web user can't edit.
 
 If that's the problem the simplest solution is to use different tmp folder 
 locations for web and CLI requests.
 
 Hth,
 
 AD
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 403 error

2014-07-24 Thread Jeremy Burns
It seems as if the cache files are being written as read only. Anyone got 
any suggestions please?

On Tuesday, 15 July 2014 16:35:48 UTC+1, Jeremy Burns wrote:

 I have a site that works fine most of the time, but on occasion I'll get 
 403 errors for a page even if I have previously viewed it successfully, 
 sometimes when I refresh a page. Sometimes clearing the cache resolves the 
 issue but on others I need to restart the browser. Any clues what's 
 happening?


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


403 error

2014-07-15 Thread Jeremy Burns
I have a site that works fine most of the time, but on occasion I'll get 
403 errors for a page even if I have previously viewed it successfully, 
sometimes when I refresh a page. Sometimes clearing the cache resolves the 
issue but on others I need to restart the browser. Any clues what's 
happening?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Cookbook: database query in controller???

2014-07-06 Thread Jeremy Burns : Class Outfit
It is using the model. It's calling the 'find' method of the Post model with 
the 'all' parameter. The Post model is then using the core Model functions to 
do the database extraction.

On 6 Jul 2014, at 11:59, Sam Clauw i...@bellewaerdefun.be wrote:

 I've a question about the MVC in CakePHP. Normally, the model should take 
 responsability for all the database queries.
 
 However, in the cookbook documentation, it seems this isn't respected. See 
 the following link: 
 http://book.cakephp.org/2.0/en/getting-started.html#create-a-posts-controller
 
 As you can see, the index action of PostsController contains 
 $this-Post-find('all'). Shouldn't this and this code for example:
 
 $this-set('areas', $this-Attraction-Area-find('list', array(
 'conditions' = array(
 'Area.deleted' = null
 ),
 'order' = array(
 'Area.sequence ASC',
 'Area.name ASC'
 )
 )));
 
 not be in the Model part instead of in the controller part???
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


User being logged out from iOS on missing image

2014-07-04 Thread Jeremy Burns
We've had an error that took a while to trace, and whilst we've solved it 
I'd like to get a better understanding of what was happening behind the 
scenes.

We're building an app that also acts as an API for an iOS app. Profile 
pictures are stored inside the /webroot/img folder, and the path to them is 
stored in the users table. When the users table points to an image that no 
longer exists (as happened when we moved from a test to a beta server) the 
web handles the error gracefully. If the url to a missing image is placed 
in a browser address bar we get a missing ImgController error, but the user 
remains logged in. When the iOS app tries to retrieve a missing image (and 
the error is not handled correctly) the user is being logged out. We've 
rectified the error by changing the iOS code but I'm keen to understand 
what might have been happened inside the Session. Can anyone shed any light 
please?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


CakePHP Queue Plugin

2014-07-03 Thread Jeremy Burns
I just set up the CakePHP Queue plugin (
https://github.com/dereuromark/cakephp-queue) and it works great. I’m 
building a messaging app where messages and replies are distributed via web 
sockets. Before the plugin the model layer was emitting the messages after 
save, which introduced a delay for the sending user while the web socket 
worked. With the plugin that delay goes as the messages are queued and 
emitted in a different process.

The challenge I have now is that - as I want the messages to be emitted 
instantly - my cron job is set up as:

* ****  cd path/to/app  Console/cake Queue.Queue runworker

…because even a second delay is too long. This is killing the CPU, which is 
running at 100%.

What is the recommended config for both the queue.php config file and cron 
job so that I get instant processing without CPU burn?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Grouping Api controllers in a seperate sub directory

2014-07-02 Thread Jeremy Burns : Class Outfit
It's simpler than that. Each controller function can act as an API method, so 
leave the folder structure as it is.You can detect the json extension by using 
the RequestHandler component and adding Router::setExtensions(array('json')); 
near the bottom of routes.php. Then you can call 
/controller/action/variable.json and it'll be handled as json - et voila you 
have an api.

If you want to reach them using a separate URL (/api/function_name.json) then 
using admin routing with an 'api' route. Then you api methods would have an api 
prefix (e.g. api_index) and would be reached via 
/api/controller/action/variable.json.

Here's a good article that explains it much better: 
http://www.dereuromark.de/2014/01/09/ajax-and-cakephp/. It's actually about 
ajax, but the set up and principles are very close.

On 2 Jul 2014, at 10:49, Hatem Ben Raïs hatem.benr...@gmail.com wrote:

 Hi,
 
 I have an app which requires some Api to expose its services. I am trying to 
 group all the Api related controllers in a directory as explained in the doc 
 here : http://book.cakephp.org/2.0/en/development/configuration.html
 
 So :
 1- I created a /app/Controller/Api folder and moved the controllers in it.
 2- added this code to my bootstrap.php : App::build(array('Controller' = 
 array(  DS . 'app' . DS . 'Controller', DS . 'app' . DS . 'Controller' . 
 DS . 'Api',), ));
 
 When I try to call one of the actions I get an error saying the controller 
 cannot be found :
 
 http://localhost:/X/api/articles.json
 
 returns 
 
 {code:404,name:Controller class ArticlesController could not be 
 found.,message:Controller class ArticlesController could not be 
 found.,url:\/\/api\/articles.json}
 
 
 Anyone can help me figuring out what is missing please? The doc seems so 
 clear...
 
 Thanks!
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cross tables in cake 1.3

2014-06-30 Thread Jeremy Burns : Class Outfit
That is A LOT of models to load and there is almost certainly a better way of 
cracking your nut. What are you trying to achieve?

On 30 Jun 2014, at 08:33, 'Chris' via CakePHP cake-php@googlegroups.com wrote:

 hi guys,.. I'm using to many cross tables in a controller,... and getting 
 memory error not enough bites,... 
 
   var $uses = array('User', 'Friend', 'FriendRequest', 'UserInvisiblePoint', 
 'UserStatusPost', 'StatusLike', 'StatusNotification', 'ZodiacType', 'Point', 
 'ProfileComment', 'Gift', 'Guest', 'Resume', 'UserBan', 'Invitation', 
 'Report', 'Photo', 'PhotoFavorite', 'PhotoLike', 'PhotoRating', 
 'PhotoComment', 'Blog', 'BlogComment', 'BlogFavorite', 'BlogLike', 'Group', 
 'GroupFavorite', 'GroupDiscussion', 'GroupMember', 'GroupPhoto', 'GroupLike', 
 'GroupComment', 'Dba', 'DbaFavorite', 'DbaLike', 'Video', 'VideoFavorite', 
 'VideoLike', 'VideoComment', 'Classified', 'Event', 'Notification', 
 'ProfileNotification', 'Bookmark', 'Message', 'Alert', 'Signin', 'Signin');
 
 how can I avoid this doing from user.php model,...? 
 
 thanks in advance,... 
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: CakePHP Login redirect

2014-06-30 Thread Jeremy Burns : Class Outfit
Are you certain the Auth-logout action is being called? Is the session clear 
(destroyed) after logout?

On 28 Jun 2014, at 12:54, Gagik Navasardyan gag...@gmail.com wrote:

 Hi everyone.
 
 I have one question. 
 
 I'm working on an application which is working in local network and acting as 
 POS(Point of Sale). As you understand it's based on CakePHP framework.
 Now I'm encountering a strange behaviour, and I don't know is it a bug or 
 not, so I've decided to ask you a question here.
 
 - I'm using CakePHP 2.4.2 and the built-in AuthComponent for authentication
 
 - The thing is, after user logs out and another user logs in (using the same 
 computer and browser), he is being redirected to the page on which the 
 previous user was when logged out. Instead of being redirected to the URL 
 defined in 'loginRedirect'
 
 - In this application I'm using role based user permissions system, and the 
 most of time system throwing permission error, because newly logged in user 
 doesn't have permission to view the page on which previous user was when 
 logged out.
 
 This behaviour is very strange to me, because as I know the logout function 
 is destroying session, but it seems keeping the last visited URL of the 
 previous user in the 'Auth.redirect' property in the new session.
 This seems a little bit strange to me, because I'm expecting this kind of 
 redirect in a few cases like:
 - If user session expired and user have to login again.
 - user trying to access to a page which is requiring authentication.  
 
 I analised the code and clearly the problem is in the framework core, and 
 there is no way to rewrite the 'Auth.redirect' property either before or 
 after the 'logout' function call (in any case the session being destroyed and 
 as I understand CakePHP taking and writing the last visited page URL to the 
 new session from HTTP REFERER).
 
 
 So question:
 Is this a Normal behaviour, and there are some reason why this must be this 
 way, or this is a bug?
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Auth Component

2014-06-27 Thread Jeremy Burns : Class Outfit
What happens if, when you define $user, you also include (contain?) the Person 
and Company models and log in with that $user variable?

On 27 Jun 2014, at 00:57, Matt Myers spartac...@gmail.com wrote:

 I've been hitting my head over this for quite some time now. When I login 
 using the Auth Component as such:
 
 $this-Auth-login()
 
 It will login just fine and define the following authUser:
 
 User
 User.Person
 User.Company
 
 But when I login in another situation like so:
 
 $this-Auth-login($user['User'])
 
 This will log them in just fine, but define the following authUser:
 
 User
 
 * Without User.Person or User.Company
 
 Does anyone know why this is? How can I get the same behavior across the 
 board? I would like he User.Person and User.Company in both instances.
 
 Thanks in advance.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Help me for First Application with CakePHP!

2014-06-25 Thread Jeremy Burns : Class Outfit
Sure. What would like us to build for you?

On 25 Jun 2014, at 06:30, Sankar V san...@vettritech.com wrote:

 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: How to Integrate paymentgateway in cakephp

2014-06-06 Thread Jeremy Burns | Class Outfit
By reading and researching.

Sent from my iPhone

 On 6 Jun 2014, at 07:00, vinothku...@constient.com wrote:
 
 This message has no content.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Testing components

2014-06-06 Thread Jeremy Burns
I have a component that is called from the UsersController and a few 
others. Code in the component calls a find on the User model via the 
controller:

$user = $this-Controller-User-findById($userId);

How do I set up a reference to the UsersController inside the component 
test case so I can call a function of the component within the test case?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: display data 3 tables

2014-06-05 Thread Jeremy Burns : Class Outfit
Isn't $tutor['Teacher']['User']['username'] what you're looking for?


On 5 Jun 2014, at 14:18, ajt jagguy...@gmail.com wrote:

 There just is no user being displayed with the below, there is with Teacher 
 in the find if I add it but every field is undefined in the view. 
 
   $this-Tutorsession-recursive = 2;
 
 $contain = array('Teacher' = array('User'));
 $this-set('tutor', $this-Tutorsession-find('first',array(
 'conditions' = array('Teacher.user_id' = $id),
 'contain' = $contain
 )));
 
 
 
 
 
 array(
   'Tutorsession' = array(
   'id' = '1',
   'teacher_id' = '1',
   'student_id' = '1',
   'subject' = 'maths',
   'sessiondate' = '2014-05-06',
   'sessiontime' = '2014-05-29 00:27:00',
   'available' = '1'
   ),
   'Teacher' = array(
   'id' = '1',
   'user_id' = '3',
   'firstname' = 'fred',
   'surname' = 'smith3',
   'address' = '1 hard str',
   'suburb' = 'chelsea2',
   'phone' = '0',
   'fullname' = 'fred smith3',
   'User' = array(
   'password' = '*',
   'id' = '3',
   'username' = 'teach',
   'role' = 'teacher',
   'created' = '2014-05-31 11:08:39',
   'modified' = '2014-05-31 11:08:39'
   ),
   'Tutorsession' = array(
   (int) 0 = array(
   'id' = '1',
   'teacher_id' = '1',
   'student_id' = '1',
   'subject' = 'maths',
   'sessiondate' = '2014-05-06',
   'sessiontime' = '2014-05-29 00:27:00',
   'available' = '1'
   )
   )
   ),
   'Student' = array(
   'id' = '1',
   'user_id' = '1',
   'firstname' = 'tom',
   'surname' = 'blog',
   'address' = '3 glen str ',
   'suburb' = 'chelsea',
   'phone' = '044',
   'fullname' = 'tom blog',
   'User' = array(
   'password' = '*',
   'id' = '1',
   'username' = 'admin',
   'role' = 'admin',
   'created' = '2014-05-30 03:19:36',
   'modified' = '2014-05-30 03:19:36'
   ),
   'Tutorsession' = array(
   (int) 0 = array(
   'id' = '1',
   'teacher_id' = '1',
   'student_id' = '1',
   'subject' = 'maths',
   'sessiondate' = '2014-05-06',
   'sessiontime' = '2014-05-29 00:27:00',
   'available' = '1'
   )
   )
   )
 )
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: display data 3 tables

2014-06-05 Thread Jeremy Burns : Class Outfit
With the Containable behaviour you should set recursive to -1. Recursion makes 
the model automatically attache related models n deep (where n is your 
recursion level) so can give unexpected (or at least uncontrolled) results. 
When it is -1 it only returns the model associations you specify. The 
Containable behaviour may well override that, but it's better to be safe than 
sorry.

On 5 Jun 2014, at 14:42, ajt jagguy...@gmail.com wrote:

 yes thats it, I just didnt know how I referenced it and with this code.
 This took hours to solve so well done
 
   $this-Tutorsession-recursive = 2;  
$this-Tutorsession-Teacher-contain('User');
   $this-set('tutor',   $this-Tutorsession-find('first',
   array(
  'conditions' = array('Teacher.user_id' = $id)) ) );
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: display data 3 tables

2014-06-05 Thread Jeremy Burns : Class Outfit
You are not doing something right. Can you show more code with the debugged 
output please? Cracking this and understanding what is happening will help you 
enormously with developing Cake apps from here.


On 5 Jun 2014, at 15:18, ajt jagguy...@gmail.com wrote:

 I set recursive to -1 and it doesnt work as I get user error again.
 Recursive set to 2 is what works
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: How to get URL parameters in cakephp with URL that ends with xml?

2014-06-04 Thread Jeremy Burns : Class Outfit
Have a look at 
http://book.cakephp.org/2.0/en/development/routing.html#Router::parseExtensions

On 4 Jun 2014, at 10:41, Sam lightai...@gmail.com wrote:

 I would like to pass URL parameters in cakephp with URL that ends with xml 
 like below;
 
 http://localhost/cp251/controller/api_get_info?page=1.xml
 The controller function looks like this;
 
 public function api_get_info()
 {
 if($this-RequestHandler-responseType() == 'xml')
 {
 //Problem is that the code never executes inside this if statement
 //Controller action
 
 }
 }
 The problem is that the code never executes inside the if statement 
 if($this-RequestHandler-responseType() == 'xml'). However, if the URL 
 becomes http://localhost/cp251/controller/api_get_info.xml, then the code 
 will execute inside the if statement. Unfortunately, this is not what I want 
 because the URL parameters cannot be sent.
 
 How can I pass URL parameters in cakephp with URL that ends with xml? I am 
 using cakephp 2.5.1
 
 Thank you.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Site down after restart

2014-06-04 Thread Jeremy Burns : Class Outfit
I had a weird error once where the Config folder was renamed to config (lower 
case c) after uploading some updates via FTP. The site just blanked out. After 
searching and debugging for a few hours I went to the test page and it 
presented the error to me. Might be worth a try.

On 4 Jun 2014, at 12:57, Rob M robmau...@gmail.com wrote:

 If this happens, start checking logs. CakePHP logs errors to /tmp/, and your 
 server access and error logs should also be reviewed. CakePHP depends on an 
 operating system, a web server, and a database server. Each of these need to 
 be up and running for Cake to do its thing.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: display data 3 tables

2014-06-04 Thread Jeremy Burns : Class Outfit
Look at the Containable behaviour: 
http://book.cakephp.org/2.0/en/core-libraries/behaviors/containable.html

On 4 Jun 2014, at 14:47, ajt jagguy...@gmail.com wrote:

 Hi,
 
 I just want to display fields from 3 tables which I have checked on how to do 
 this and I am not clear on this. Examples I have found concentrate on 2 
 fields or keyed in conditions on multiple tables.
 I have models all related in some way.
 I want the username from a tutorsession table and the middle table is the 
 teacher table.
 
 Tutorsession - related to teacher
 Teacher -related to tutorsession and teacher
 User= related to teacher
 
 The tutorsession automatically gets rows from teacher table but not user 
 table. I have checked the docs below and I am not sure what to use here as 
 the below doesnt work but I dont get errors.
 
   $this-set( 'tutor',$this-Tutorsession-find('all',array('conditions' = 
array('Teacher.user_id' = $id,'Teacher.user_id' = 
 'User.id';

 
   
   $this-set( 'tutor',$this-Tutorsession-find('all',array('conditions' 
 = array('Teacher.user_id' = $id;

 
 http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html
 http://book.cakephp.org/2.0/en/models/retrieving-your-data.html
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: display data 3 tables

2014-06-04 Thread Jeremy Burns : Class Outfit
A couple of things...

Why find all when presumably there is only one expected teacher? The contain 
statement doesn't go inside an array:

$this-set(
'tutor',
$this-Tutorsession-find(
'first',
array(
'conditions' = array('Teacher.user_id' = $id),
'contain' = 'User.username'
)
)
);

On 4 Jun 2014, at 15:20, ajt jagguy...@gmail.com wrote:

 This doesnt work as I get an error when displaying the username from the 
 associated table.
 I guess i am doing something wrong still.
 
  $this-set('tutor',  $this-Tutorsession-find('all',
   array('conditions' = array('Teacher.user_id' = $id)
   ,array('contain' = 'User.username')
   )));
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: display data 3 tables

2014-06-04 Thread Jeremy Burns : Class Outfit
You are referencing the $user variable when you have set a $tutor variable. Add 
this to your view so you can inspect the shape of the $tutor variable and work 
out how to access the key you are looking for:

die(debug($tutor));

It'll probably look something like this:

array(
'Tutorsession' = array(
'id' = 1,
'user_id' = 123,
'other_fields' = 'other_values',
'User' = array(
'id' = 123,
'username' = 'the_user_name'
)
)
)

If it does, you access the username with:

$tutor['Tutorsession']['User']['username']


On 4 Jun 2014, at 23:45, ajt jagguy...@gmail.com wrote:

 This still doesnt work as I get an error when I reference the user table 
 which should be linked unless I need to do this another way?
 
 view
  echo 'td'. $item['User']['username'].'/td'; ///error user undefined
 
 
 $this-set(
   'tutor',
   $this-Tutorsession-find(
   'first',
   array(
   'conditions' = array('Teacher.user_id' = $id),
   'contain' = 'User.username'
   )
   )
 );
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: button wont display as it should

2014-06-03 Thread Jeremy Burns : Class Outfit
Generally speaking you'd create your own CSS file and place it in 
/app/webroot/css and use that instead of the default Cake CSS. If you want to 
use both then call both in the head of your layout page.

On 3 Jun 2014, at 12:48, jagguy and...@itfutures.edu.au wrote:

 Hi,
 
 No I havent touched the css but  where do I do this,in which css file?
 
 
 P: (03) 9866 7737
 E: i...@itfutures.edu.au
 A: Suite 5 / Level 1 / 424 St Kilda Rd, Melbourne, 3004
 
 
 
 Connect with us: 
 
 
 
 Please consider the environment before printing this email.
  
 This e-mail and any attachments to it (the Communication) is, unless 
 otherwise stated, confidential,  may contain copyright material and is for 
 the use only of the intended recipient. If you receive the Communication in 
 error, please notify the sender immediately by return e-mail, delete the 
 Communication and the return e-mail, and do not read, copy, retransmit or 
 otherwise deal with it. Any views expressed in the Communication are those of 
 the individual sender only, unless expressly stated to be those of National 
 Training and Solutions Provider Pty Ltd ABN 34 123 831 023, or any of its 
 related entities. NTSP does not accept liability in connection with the 
 integrity of or errors in the Communication, computer virus, data corruption, 
 interference or delay arising from or in respect of the Communication.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cant find a field

2014-06-03 Thread Jeremy Burns : Class Outfit
You ask a lot of questions that are in the book...

Look at Model- field() : 
http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#model-field


On 3 Jun 2014, at 15:38, ajt jagguy...@gmail.com wrote:

 Hi, Is this is the correct way to find a 1 field in 1 row of data? 
 I just want the teacherID of a row of a given  userID but I never get a match
 
 $currentuserid=AuthComponent::user('id');
  
  $teacherid=$this-Teacher-find('first',array(
  'conditions' = array('Teacher.user_id' = $currentuserid),
   'fields' = array('Teacher.id'),
  ));
 
 if ( $teacherid==$id ){.//never matches when it should
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cant find a field

2014-06-03 Thread Jeremy Burns : Class Outfit
The code you pasted probably won't work.

$currentuserid=AuthComponent::user('id');  // Use $this-Auth-user('id') 
instead.

In the find you are using the user_id field as a condition but only returning 
the Teacher.id field - do the Teacher.id and Teacher.user_id fields contain the 
same value?

 $teacherid=$this-Teacher-find('first',array(
 'conditions' = array('Teacher.user_id' = $currentuserid),
  'fields' = array('Teacher.id'),
 ));

if ( $teacherid==$id ){.//never matches when it should

What's the point of doing a find using a known condition and checking that the 
result matches the condition you passed? If you want the Teacher.id value by 
searching in the Teacher.user_id field you should:

$teacherId = $this-Teacher-field('id, array('Teacher.user_id' = 
$currentUserId));

if (empty($teacherId) {
// The current user does not have a row in the teachers table
}


On 3 Jun 2014, at 23:48, jagguy and...@itfutures.edu.au wrote:

 This is for a view?
 I know the book and have tried this already for a controller.
 
 
 
 
 P: (03) 9866 7737
 E: i...@itfutures.edu.au
 A: Suite 5 / Level 1 / 424 St Kilda Rd, Melbourne, 3004
 
 
 
 Connect with us: 
 
 
 
 Please consider the environment before printing this email.
  
 This e-mail and any attachments to it (the Communication) is, unless 
 otherwise stated, confidential,  may contain copyright material and is for 
 the use only of the intended recipient. If you receive the Communication in 
 error, please notify the sender immediately by return e-mail, delete the 
 Communication and the return e-mail, and do not read, copy, retransmit or 
 otherwise deal with it. Any views expressed in the Communication are those of 
 the individual sender only, unless expressly stated to be those of National 
 Training and Solutions Provider Pty Ltd ABN 34 123 831 023, or any of its 
 related entities. NTSP does not accept liability in connection with the 
 integrity of or errors in the Communication, computer virus, data corruption, 
 interference or delay arising from or in respect of the Communication.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cant find a field

2014-06-03 Thread Jeremy Burns : Class Outfit
I missed a single speech mark when I typed my example For clarity it should be:

$teacherId = $this-Teacher-field('id', array('Teacher.user_id' = 
$currentUserId));

On 4 Jun 2014, at 06:46, Jeremy Burns : Class Outfit 
jeremybu...@classoutfit.com wrote:

 The code you pasted probably won't work.
 
 $currentuserid=AuthComponent::user('id');  // Use $this-Auth-user('id') 
 instead.
 
 In the find you are using the user_id field as a condition but only returning 
 the Teacher.id field - do the Teacher.id and Teacher.user_id fields contain 
 the same value?
 
  $teacherid=$this-Teacher-find('first',array(
  'conditions' = array('Teacher.user_id' = $currentuserid),
   'fields' = array('Teacher.id'),
  ));
 
 if ( $teacherid==$id ){.//never matches when it should
 
 What's the point of doing a find using a known condition and checking that 
 the result matches the condition you passed? If you want the Teacher.id value 
 by searching in the Teacher.user_id field you should:
 
 $teacherId = $this-Teacher-field('id, array('Teacher.user_id' = 
 $currentUserId));
 
 if (empty($teacherId) {
   // The current user does not have a row in the teachers table
 }
 
 
 On 3 Jun 2014, at 23:48, jagguy and...@itfutures.edu.au wrote:
 
 This is for a view?
 I know the book and have tried this already for a controller.
 
 
 
 
 P: (03) 9866 7737
 E: i...@itfutures.edu.au
 A: Suite 5 / Level 1 / 424 St Kilda Rd, Melbourne, 3004
 
 
 
 Connect with us: 
 
 
 
 Please consider the environment before printing this email.
  
 This e-mail and any attachments to it (the Communication) is, unless 
 otherwise stated, confidential,  may contain copyright material and is for 
 the use only of the intended recipient. If you receive the Communication in 
 error, please notify the sender immediately by return e-mail, delete the 
 Communication and the return e-mail, and do not read, copy, retransmit or 
 otherwise deal with it. Any views expressed in the Communication are those 
 of the individual sender only, unless expressly stated to be those of 
 National Training and Solutions Provider Pty Ltd ABN 34 123 831 023, or any 
 of its related entities. NTSP does not accept liability in connection with 
 the integrity of or errors in the Communication, computer virus, data 
 corruption, interference or delay arising from or in respect of the 
 Communication.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: button wont display as it should

2014-06-02 Thread Jeremy Burns : Class Outfit
Use $this-Form-button...

On 2 Jun 2014, at 14:37, jagguy and...@itfutures.edu.au wrote:

 Hi,
 
 I simply want to display a button instead of a link but the button doesnt 
 appear as I cant override the link display with htmlHelper
 In older versions of cake 2.x this does work.
 
 echo td .$this-Html-link('Edit', array('controller' = 'users',
 'action' = 'editteacher/'.$item['User']['id']), array('class' = 
 'button')) .td;
 http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html
 
 
 P: (03) 9866 7737
 E: i...@itfutures.edu.au
 A: Suite 5 / Level 1 / 424 St Kilda Rd, Melbourne, 3004
 
 
 
 Connect with us: 
 
 
 
 Please consider the environment before printing this email.
  
 This e-mail and any attachments to it (the Communication) is, unless 
 otherwise stated, confidential,  may contain copyright material and is for 
 the use only of the intended recipient. If you receive the Communication in 
 error, please notify the sender immediately by return e-mail, delete the 
 Communication and the return e-mail, and do not read, copy, retransmit or 
 otherwise deal with it. Any views expressed in the Communication are those of 
 the individual sender only, unless expressly stated to be those of National 
 Training and Solutions Provider Pty Ltd ABN 34 123 831 023, or any of its 
 related entities. NTSP does not accept liability in connection with the 
 integrity of or errors in the Communication, computer virus, data corruption, 
 interference or delay arising from or in respect of the Communication.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: button wont display as it should

2014-06-02 Thread Jeremy Burns : Class Outfit
Then just use CSS.

On 2 Jun 2014, at 15:01, jagguy and...@itfutures.edu.au wrote:

 Form buttons should not be used as simple links, so this cant be the solution
 
 http://stackoverflow.com/questions/13491421/cakephp-create-simple-buttons-that-redirects-to-views
 
 
 P: (03) 9866 7737
 E: i...@itfutures.edu.au
 A: Suite 5 / Level 1 / 424 St Kilda Rd, Melbourne, 3004
 
 
 
 Connect with us: 
 
 
 
 Please consider the environment before printing this email.
  
 This e-mail and any attachments to it (the Communication) is, unless 
 otherwise stated, confidential,  may contain copyright material and is for 
 the use only of the intended recipient. If you receive the Communication in 
 error, please notify the sender immediately by return e-mail, delete the 
 Communication and the return e-mail, and do not read, copy, retransmit or 
 otherwise deal with it. Any views expressed in the Communication are those of 
 the individual sender only, unless expressly stated to be those of National 
 Training and Solutions Provider Pty Ltd ABN 34 123 831 023, or any of its 
 related entities. NTSP does not accept liability in connection with the 
 integrity of or errors in the Communication, computer virus, data corruption, 
 interference or delay arising from or in respect of the Communication.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Order using Containable-Behaviour on deeper levels (1)

2014-05-29 Thread Jeremy Burns
Look at Hash::sort - 
http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::sort

On 29 May 2014, at 11:28, LDSign fr...@lamozik.de wrote:

 Hi
 
 This was discussed several times on the inet - it seems that it is not 
 possible to use an order on a deeper association connected with the 
 containable behaviour, because the behaviour splits the query in several 
 parts :(
 
 Whats the best approach to make sorting on deeper levels work with 
 containable?
 
 Ive found an older behaviour called Linkable which promised to fill this 
 gap, but unfortunatley it doesn't work with cake 2.5 :(
 
 Thanks for your input!
 
 Regards,
 Frank
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Order using Containable-Behaviour on deeper levels (1)

2014-05-29 Thread Jeremy Burns : Class Outfit
Ah. Not sure, but it looks like it sorts by a single key. Sorry.

On 29 May 2014, at 11:55, LDSign fr...@lamozik.de wrote:

 Thanks. Ive already looked at the Hash::sort method.
 
 But with that it is not possible to sort on multiple fields in priority. e.g. 
 first lastname than firstname 
 
 Or do I miss something?
 
 Frank
 
 Am Donnerstag, 29. Mai 2014 12:41:00 UTC+2 schrieb Jeremy Burns:
 Look at Hash::sort - 
 http://book.cakephp.org/2.0/en/core-utility-libraries/hash.html#Hash::sort
 
 On 29 May 2014, at 11:28, LDSign fr...@lamozik.de wrote:
 
 Hi
 
 This was discussed several times on the inet - it seems that it is not 
 possible to use an order on a deeper association connected with the 
 containable behaviour, because the behaviour splits the query in several 
 parts :(
 
 Whats the best approach to make sorting on deeper levels work with 
 containable?
 
 Ive found an older behaviour called Linkable which promised to fill this 
 gap, but unfortunatley it doesn't work with cake 2.5 :(
 
 Thanks for your input!
 
 Regards,
 Frank
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+u...@googlegroups.com.
 To post to this group, send email to cake...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Access $this-Session from a model

2014-05-28 Thread Jeremy Burns : Class Outfit
Pass the current user's id to the model from the calling controller, which can 
reference the session.

On 28 May 2014, at 09:23, Thomas von Hassel darx...@gmail.com wrote:

 If your model depends on knowing, by it self, who the user is, you are doing 
 it wrong ..
 
 /thomas
 
 
 On 27 May 2014, at 20:59, Henry Gabriel González Montejo 
 angeldiac...@gmail.com wrote:
 
 Hi i have the same problem with the plugin 
 https://github.com/robwilkerson/CakePHP-Audit-Log-Plugin, i put the method 
 in my Model (AppModel) so it can be used in others models, my solution was:
 
 function currentUser() 
  {
  //pr($this-Session-read('Auth.User'));
  //pr($this-Auth-user());
  //pr(AuthComponent::user());
  //die();
  
  $user=AuthComponent::user();
  
  return $user;
  
  } 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: cant edit but can add row cakephp

2014-05-28 Thread Jeremy Burns : Class Outfit
What happens when you try the save? Does it create a new row instead or does it 
fail somewhere?

On 28 May 2014, at 15:10, jagguy and...@itfutures.edu.au wrote:

 Hi,
 
 In cakephp I cant edit a row from my mysql db but I can add a new row  on the 
 same table without error.
 Not sure what to do or how to debug this. The edittutorsession function is 
 the problem
 
 Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an 
 error in your SQL syntax; check the manual that corresponds to your MySQL 
 server version for the right syntax to use near 'setFlash' at line 1
 
 public function addtutorsession() {
 
  
 $te= $this-Tutorsession-Teacher-find('list', array('fields' =  
 'Teacher.fullname'));
  $this-set( 'te',$te);
  
 $this-set( 'st',$this-Tutorsession-Student-find('list', 
 array('fields' = array('Student.fullname') )));
  

  if ($this-request-is('post')) {
 $this-Tutorsession-create();
 if ($this-Tutorsession-save($this-request-data)) {
 $this-Session-setFlash(__('Your post has been saved.'));
 return $this-redirect(array('action' = 'displayall'));
 }
 $this-Session-setFlash(__('Unable to add your post.'));
 }
 
 }
 
 
 public function edittutorsession($id = null) {
 
 
 $te= $this-Tutorsession-Teacher-find('list', array('fields' =  
 'Teacher.fullname'));
  $this-set( 'te',$te);
  
 $this-set( 'st',$this-Tutorsession-Student-find('list', 
 array('fields' = array('Student.fullname') )));
  
 
 
 if (!$id) {
 throw new NotFoundException(__('Invalid post'));
 }
 
 $post = $this-Tutorsession-findById($id);
 if (!$post) {
 throw new NotFoundException(__('Invalid post'));
 }
 
 if ($this-request-is(array('post', 'put'))) {
 $this-Tutorsession-id = $id;
 if ($this-Tutorsession-save($this-request-data)) {
 $this-Tutorsession-setFlash(__('Your post has been updated.'));
 return $this-redirect(array('action' = 'displayall'));
 }
 $this-Session-setFlash(__('Unable to update your post.'));
 }
 
 if (!$this-request-data) {
 $this-request-data = $post;
 }
 }
 
 
 ///
 view edittutorsession
 
 ?php
 echo $this-Form-create('Tutorsession');
  echo $this-Form-input('teacher_id', array('options' = $te));
  echo $this-Form-input('student_id', array('options' = $st));
 
  echo $this-Form-input('subject');   //text
 echo $this-Form-input('sessiondate', 
array('label' = 'Session'));  
 echo $this-Form-input('sessiontime', 
array('label' = 'time'));  
  echo $this-Form-input('available');  
 echo $this-Form-end('Save Post');
 ?
 
 
 
 
 P: (03) 9866 7737
 E: i...@itfutures.edu.au
 A: Suite 5 / Level 1 / 424 St Kilda Rd, Melbourne, 3004
 
 
 
 Connect with us: 
 
 
 
 Please consider the environment before printing this email.
  
 This e-mail and any attachments to it (the Communication) is, unless 
 otherwise stated, confidential,  may contain copyright material and is for 
 the use only of the intended recipient. If you receive the Communication in 
 error, please notify the sender immediately by return e-mail, delete the 
 Communication and the return e-mail, and do not read, copy, retransmit or 
 otherwise deal with it. Any views expressed in the Communication are those of 
 the individual sender only, unless expressly stated to be those of National 
 Training and Solutions Provider Pty Ltd ABN 34 123 831 023, or any of its 
 related entities. NTSP does not accept liability in connection with the 
 integrity of or errors in the Communication, computer virus, data corruption, 
 interference or delay arising from or in respect of the Communication.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: adding a new record with foreign key option

2014-05-26 Thread Jeremy Burns | Class Outfit
Try looking at find-list 
)http://book.cakephp.org/2.0/en/models/retrieving-your-data.html#find-list). 
It'll return a key = value array where key is the value you want to store 
(teacher_id or student_id) and value is the name of the teacher or student that 
will be displayed in the drop down. Check out the displayField model property 
(http://book.cakephp.org/2.0/en/models/model-attributes.html#displayfield).

On 26 May 2014, at 04:40, jagguy and...@itfutures.edu.au wrote:

 Hi,
 
 I am wanting to add a new record  where I have a form input and the user 
 types in the details of the new record in a form using cakePHP ( I cant find 
 anything in the cakePHP manual or google as yet).
 
 I can do this already but I get too much information in the drop down list in 
 the form entry .
 
  2 of the fields are foreign keys so the user needs to select the field 
 instead of typing them in. 
 
 I have  simple case of student, teacher and tutor sessions where I am 
 entering in data on tutor session only. The user selects the existing teacher 
 and student name instead of typing them .
 
 Now I dont get an error but  the drop down list for student and teacher has 
 too much information like the name, id and the tablename.
 
 I just want the name of student and teacher (only) to appear in the drop down 
 list of the add new form entry.
 I do get the right information just too much.
 
 yes i checked the manual on cake php
 
 model
 class Tutorsession extends AppModel
 {
 
   
  public $belongsTo = array(
 'Teacher' = array(
 'className' = 'Teacher',
 'foreignKey' = 'teacher_id'
 ),
  'Student' = array(
 'className' = 'Student',
 'foreignKey' = 'student_id'
 ),
 );
 controller
 
 public function add() {
 
 $this-set( 'st',$this-Tutorsession-find('all', array('contain' = 
 array('Student'),
 'fields' = array('DISTINCT Student.firstname') )));
   
 $this-set( 'te',$this-Tutorsession-find('all', array('contain' = 
 array('Teacher'),
 'fields' = array('DISTINCT Teacher.firstname') )));
 
 view
 ?php
 echo $this-Form-create('Tutorsession');
  echo$this-Form-input('teacher_id', array('options' = $te));
  echo$this-Form-input('student_id', array('options' = $st));
 
 
 
 
 
 
 
 
 
 
 P: (03) 9866 7737
 E: i...@itfutures.edu.au
 A: Suite 5 / Level 1 / 424 St Kilda Rd, Melbourne, 3004
 
 
 
 Connect with us: 
 
 
 
 Please consider the environment before printing this email.
  
 This e-mail and any attachments to it (the Communication) is, unless 
 otherwise stated, confidential,  may contain copyright material and is for 
 the use only of the intended recipient. If you receive the Communication in 
 error, please notify the sender immediately by return e-mail, delete the 
 Communication and the return e-mail, and do not read, copy, retransmit or 
 otherwise deal with it. Any views expressed in the Communication are those of 
 the individual sender only, unless expressly stated to be those of National 
 Training and Solutions Provider Pty Ltd ABN 34 123 831 023, or any of its 
 related entities. NTSP does not accept liability in connection with the 
 integrity of or errors in the Communication, computer virus, data corruption, 
 interference or delay arising from or in respect of the Communication.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: filter data with controller or model?

2014-05-23 Thread Jeremy Burns | Class Outfit
As a general rule, let the model do all the heavy lifting (fat models, thin 
controllers). It keeps the business logic in one place. What you have described 
below are two different things. The first is a find command called by the 
controller. The second is the code that associates this model with others. Both 
are important but do different things. The practice I adopt is to have methods 
within each model that accept parameters, do the finding and parsing and return 
a completed result. This can be called from another model or from a controller. 
For example, in the post model you might have a method:

public function findLatest($authorId = null, $limit = 3) {
if (!$authorId) {
return array();
}

return $this-find(
'all',
array(
'conditions' = array('Post.author.id = $authorId)
'order' = array('Post.created = 'desc'),
'limit' = $limit
)
);
}

Then from the post controller you can call:

$lastThreePosts = $this-Post-findLatest($authorId, 3);

Or from the Author model (assuming Author hasMany Post):

$latestPost = $this-Post-findLatest($authorId, 1);


On 24 May 2014, at 04:33, Andrew Barry jagguy...@gmail.com wrote:

 In cakephp what is the method to filter data on a database request.
 Do I filter the data from a model or a controller?
 
 Say if I have a table with 1000's of rows and I only want to select rows on a 
 condition , like a where clause on sql.
 
 The user enters in a certain fields to select rows from a table.
 
 I then pass this variable to the controller and the controller filters this 
 data or is the model supposed to filter the rows selected?
 
 I didnt quite see this clearly from the cakephp docs.
 I am not sure if a model or controller is the best way to go about it.
 
 a controller would do ///
  public function view($id = null) {
   $post = $this-Post-findById($id);
 
 
 $this-set('post', $post);
 }
 
 a model would do something like the below where you set the condition and 
 this seems a really messy way to go about things.
 
 class Recipe extends AppModel {
 public $hasAndBelongsToMany = array(
 'Ingredient' =
 array(
 'className' = 'Ingredient',
 'joinTable' = 'ingredients_recipes',
 'foreignKey' = 'recipe_id',
 'associationForeignKey' = 'ingredient_id',
 'unique' = true,
 'conditions' = '',
 'fields' = '',
 'order' = '',
 'limit' = '',
 'offset' = '',
 'finderQuery' = '',
 'with' = ''
 )
 );
 }
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


saveAssociated and $this-id

2014-05-19 Thread Jeremy Burns
I have a Message model that hasMany MessageRecipients. I have a form that 
posts data into a controller which passes it straight to a method in the 
Message model.

Three questions really...

1) How should the form be set up?
The MessageRecipient model expects two fields; message_id and user_id. When 
I create the form I add a control called 'MessageRecipient'. This just 
passes a keyed array of user ids. How can I make those sit in the user_id 
field? Naming the field MessageRecipient.user_id is not the answer.

2) Once the data array arrives at the model it is not in the same shape as 
that suggested by the book. The book suggests it should look like this:
$data = array(
'Article' = array('title' = 'My first article'),
'Comment' = array(
array('body' = 'Comment 1', 'user_id' = 1),
array('body' = 'Comment 2', 'user_id' = 12),
array('body' = 'Comment 3', 'user_id' = 40),
),
);
... rather than:

array(
'Message' = array(
'subject' = '',
'content' = 'Test',
'user_id' = 1,
'MessageRecipient' = array(
(int) 0 = 2,
(int) 1 = 3
)
)
)

... as passed by the form. Do the numeric keys really matter? How do I get 
the array to be in this shape:

array(
'Message' = array(
'subject' = '',
'content' = 'Test',
'user_id' = 1,
'MessageRecipient' = array(
array ('user_id' = 2),
array ('user_id' = 3)
)
)
)

... without parsing the data?

3) After the data is saved using $this-saveAssociated() I'd expect the id 
of the new message to be in $this-id, yet it is always null. I can reach 
$this-MessageRecipient-id and 
$this-MessageRecipient-field('message_id') but that feels wrong. What's 
the recommended approach?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: How to retrieve data from anther table in one model

2014-04-30 Thread Jeremy Burns | Class Outfit
You're doing it all wrong so even if you get this to work you are exposing 
yourself to problems down the line.

First, each table should have its own model. Second, name your tables correctly 
if you can. If you can't for whatever reason, then place public $useTable = 
'your_table_name'; at the top of the model (rather than public $useTable = 
false;). Third, link your models through table associations. Then you can daisy 
chain models. For example, $this-TableOne-TableTwo-find('all');

On 30 Apr 2014, at 05:44:22, gyrate360 gyrate...@gmail.com wrote:

 I wanna retrieve data from anther table in one model.
 case is like this:
 in a model,eg:StaticTable,I set $useTable as false;
 so in one function,I just wanna get data from some table.how can I manage
 it?
 Here is my code,but it doese't work.
 part of the code in app/Model/StaticTable.php:
 class StaticTable  extends Model{
   public $useTable = false;
   protected $_tableName = '';
   public function get_some_data(){
  $this-_tableName = 'tb_server_info';
  $serverInfo = $this-find('all', array(
  'conditions' = array('status'=1),
   'order'=array('created_date'='asc')
));
 $this-_tableName = 'tb_platform_info';
 $platformInfo= $this-find('all', array(
 'conditions' = array('status'=1),
 'order'=array('created_date'='asc')
));
 return
 array('server_info'=$serverInfo.'platform_info'=$platformInfo);
   }
 }
 
 
 
 --
 View this message in context: 
 http://cakephp.1045679.n5.nabble.com/How-to-retrieve-data-from-anther-table-in-one-model-tp5718071.html
 Sent from the CakePHP mailing list archive at Nabble.com.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.




Jeremy Burns
Class Outfit

http://www.classoutfit.com

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


json extensions and redirects

2014-04-23 Thread Jeremy Burns
Our iOS app now calls json extensions, which is great. But, if the app does 
an internal redirect it loses the json extension and renders full html 
instead of json.

What is the best approach to keep the json extension throughout the request 
lifecycle?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Mobile safari shows blank page

2014-04-20 Thread Jeremy Burns
Parse json extensions; that's the answer.

On Sunday, 20 April 2014 05:45:07 UTC+1, Jeremy Burns wrote:

 So I guess my next question is: What is the best way to determine if a 
 request is coming from an iOS device (or Android etc) rather than a mobile 
 browser so that I can return JSON data instead of rendered HTML?

 On Sunday, 20 April 2014 05:39:26 UTC+1, Jeremy Burns wrote:

 I have isolated the issue. In my AppController beforeFilter function I 
 have these lines:

 if ($this-request-isMobile()) {
 Configure::write('debug', 0);
 $this-RequestHandler-renderAs($this, 'json');
 }

 This is so that the iOS app we are developing alongside the web app can 
 get the JSON output it expects. It seems that isMobile is returning true 
 even when viewed from mobile safari.


 On Saturday, 19 April 2014 08:20:22 UTC+1, Jeremy Burns wrote:

 I have a site (test.nudgedeck.com) that renders as expected in web 
 browsers. But when viewed in mobile Safari all I see is this:

 html

 head/head
 body

 pre style=word-wrap: break-word; white-space: pre-wrap;[]/pre

 /body

 /html

 Any clues what this could be? CakePHP 2.4.7 fully installed.



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Mobile safari shows blank page

2014-04-19 Thread Jeremy Burns
I have a site (test.nudgedeck.com) that renders as expected in web 
browsers. But when viewed in mobile Safari all I see is this:

html

head/head
body

pre style=word-wrap: break-word; white-space: pre-wrap;[]/pre

/body

/html

Any clues what this could be? CakePHP 2.4.7 fully installed.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Mobile safari shows blank page

2014-04-19 Thread Jeremy Burns
I have isolated the issue. In my AppController beforeFilter function I have 
these lines:

if ($this-request-isMobile()) {
Configure::write('debug', 0);
$this-RequestHandler-renderAs($this, 'json');
}

This is so that the iOS app we are developing alongside the web app can get 
the JSON output it expects. It seems that isMobile is returning true even 
when viewed from mobile safari.


On Saturday, 19 April 2014 08:20:22 UTC+1, Jeremy Burns wrote:

 I have a site (test.nudgedeck.com) that renders as expected in web 
 browsers. But when viewed in mobile Safari all I see is this:

 html

 head/head
 body

 pre style=word-wrap: break-word; white-space: pre-wrap;[]/pre

 /body

 /html

 Any clues what this could be? CakePHP 2.4.7 fully installed.


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Mobile safari shows blank page

2014-04-19 Thread Jeremy Burns
So I guess my next question is: What is the best way to determine if a 
request is coming from an iOS device (or Android etc) rather than a mobile 
browser so that I can return JSON data instead of rendered HTML?

On Sunday, 20 April 2014 05:39:26 UTC+1, Jeremy Burns wrote:

 I have isolated the issue. In my AppController beforeFilter function I 
 have these lines:

 if ($this-request-isMobile()) {
 Configure::write('debug', 0);
 $this-RequestHandler-renderAs($this, 'json');
 }

 This is so that the iOS app we are developing alongside the web app can 
 get the JSON output it expects. It seems that isMobile is returning true 
 even when viewed from mobile safari.


 On Saturday, 19 April 2014 08:20:22 UTC+1, Jeremy Burns wrote:

 I have a site (test.nudgedeck.com) that renders as expected in web 
 browsers. But when viewed in mobile Safari all I see is this:

 html

 head/head
 body

 pre style=word-wrap: break-word; white-space: pre-wrap;[]/pre

 /body

 /html

 Any clues what this could be? CakePHP 2.4.7 fully installed.



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Image is not displaying

2014-04-17 Thread Jeremy Burns : Class Outfit
I've experienced this before and it was nothing to do with the images. Try 
checking that all of your CSS and JS files are being called correctly. I have 
noticed that if you are trying to load a non-existent file through the Html 
helper, other things break.


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 17 Apr 2014, at 14:34, baker of cake icewing...@gmail.com wrote:

 Hi to All,
 
 I have been trying to display the images after they have been uploaded using 
 $this-Html-image(). It provides the right path to the image but the image 
 is not showing. mod_rewrite is working fine, and no error seems to occur. I 
 tried displaying the image directly from the web browser with the link 
 provided in the image path, it gives me the following error:
 
 Missing Controller
 Error: ImgController could not be found.
 Error: Create the class ImgController below in file: 
 app\Controller\ImgController.php
 
 Image location is on default location 'img'. I tried Googling for an hour 
 already with no working result. I am using version 2.4.7 if that helps things 
 sort out.
 
 Thanks,
 Andrew
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Redirect to json extension

2014-04-04 Thread Jeremy Burns
In our continued head long plunge into iOS app integration we have now got 
the iOS app talking nicely with the Cake controller code using json, 
Router::parseExtensions(); and json views. The next challenge is 
redirecting.

For example, the Auth component's loginRedirect is set to a non json view 
(e.g. /users/profile) as that is where the web site expects to go after a 
successful login. When the login comes from the iOS app (via 
/users/login.json) I really need it to redirect to the json equivalent 
(e.g. /users/profile.json) else the iOS receives the fully rendered HTML 
(which is bad).

What's the recommended way of dealing with this? Hard coding json specific 
redirects, or is there something clever available within the RequestHandler 
component that can detect that the current action is a json action and any 
redirect should also be to a json action?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Redirect to json extension

2014-04-04 Thread Jeremy Burns
So this seems to work...

In AppController-beforeFilter():

if ($this-request-isMobile()) {
$this-RequestHandler-renderAs($this, 'json');
}

Now all mobile requests (including redirections) se the json equivalent 
view (e.g. /Views/Users/json/login.ctp instead of /Views/Users/login.ctp) 
even if the mobile app posts to the non json extension.

On Friday, 4 April 2014 11:50:00 UTC+1, Jeremy Burns wrote:

 In our continued head long plunge into iOS app integration we have now got 
 the iOS app talking nicely with the Cake controller code using json, 
 Router::parseExtensions(); and json views. The next challenge is 
 redirecting.

 For example, the Auth component's loginRedirect is set to a non json view 
 (e.g. /users/profile) as that is where the web site expects to go after a 
 successful login. When the login comes from the iOS app (via 
 /users/login.json) I really need it to redirect to the json equivalent 
 (e.g. /users/profile.json) else the iOS receives the fully rendered HTML 
 (which is bad).

 What's the recommended way of dealing with this? Hard coding json specific 
 redirects, or is there something clever available within the RequestHandler 
 component that can detect that the current action is a json action and any 
 redirect should also be to a json action?


-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


iOS app development

2014-04-03 Thread Jeremy Burns
We're developing an iOS app alongside a CakePHP web app. At this point the 
iOS developer is using the XCode simulator. I have some questions about how 
the PHP code should be altered to handle requests from iOS. We are learning 
as we go along...

- When I do a check for $this-request-isMobile() the result is false; is 
that because we are using the simulator?
- When the right data is posted from the log in screen the users controller 
redirects the user to the next page. The iOS app is receiving the full HTML 
of that page. Do I need to put isMobile() checks throughout my PHP code and 
return different responses? See the false isMobile check above.
- What part does the RequestHandler component play in this? I have included 
it in AppController.
- The CakePHP app contains al the correct redirects and logic flow. Does 
the iOS app need to replicate these (in other words, the logic is stored in 
two places) or can the CakePHP code drive the redirect equivalent 
statements for iOS?
- Are there any good resources for co-developing iOS and CakePHP apps?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


iOS app authentication

2014-04-02 Thread Jeremy Burns
We're developing a CakePHP web site alongside an iOS app. Our iOS developer 
is trying to get the app to authenticate via the /users/login function of 
the web site (which uses form authentication) but it isn't working. The 
users controller cannot read $this-request-data. Are we missing something 
blindingly obvious or do we need a different approach?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: iOS app authentication

2014-04-02 Thread Jeremy Burns : Class Outfit
Thanks Jose - we'll try that.

On 2 Apr 2014, at 21:19, José Lorenzo jose@gmail.com wrote:

 Send the data encoded with application/x-www-form-urlencoded
 
 On Wednesday, April 2, 2014 10:04:40 PM UTC+2, Jeremy Burns wrote:
 We're developing a CakePHP web site alongside an iOS app. Our iOS developer 
 is trying to get the app to authenticate via the /users/login function of the 
 web site (which uses form authentication) but it isn't working. The users 
 controller cannot read $this-request-data. Are we missing something 
 blindingly obvious or do we need a different approach?
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Testing a logged in user

2014-03-27 Thread Jeremy Burns
I've read and searched and am stumped. I have set up test cases and 
fixtures for my (built) models and controllers. I want to run a controller 
test that logs in a specific user (who exists in my users fixture) and then 
run a controller action. I want to test that the displayed values meet 
expectations. Lots of answers point to using generate to mock objects, but 
- unless I'm being really dumb here - I don't need to mock anything. The 
users controller exists and it includes both the Auth and Session 
components (from AppController). Can anyone point me in the right 
direction, please?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Testing a logged in user

2014-03-27 Thread Jeremy Burns : Class Outfit
Thanks Mark. How do I incorporate --stderr into tests run via the web, rather 
than from the command line?

On 27 Mar 2014, at 10:45, euromark dereurom...@gmail.com wrote:

 Yes, you can simple use the Session to store and fake a logged in user.
 Just make sure you dont forget --stderr to append to your test command. 
 Otherwise the session based tests will fail.
 
 
 Am Donnerstag, 27. März 2014 11:43:54 UTC+1 schrieb Jeremy Burns:
 I've read and searched and am stumped. I have set up test cases and fixtures 
 for my (built) models and controllers. I want to run a controller test that 
 logs in a specific user (who exists in my users fixture) and then run a 
 controller action. I want to test that the displayed values meet 
 expectations. Lots of answers point to using generate to mock objects, but - 
 unless I'm being really dumb here - I don't need to mock anything. The users 
 controller exists and it includes both the Auth and Session components (from 
 AppController). Can anyone point me in the right direction, please?
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: How to return json message inside controller?

2014-03-13 Thread Jeremy Burns | Class Outfit
I put this in AppController beforeFilter:

if ($this-request-is('ajax')) {
Configure::write('debug', 0);
$this-autoRender = false;
$this-layout = 'ajax';
$this-disableCache();
}

On 13 Mar 2014, at 11:29, Wladimir Chopite wchop...@gmail.com wrote:

 Use at the beginning of your controller function:
 
 $this-autoRender=false;
 
 
 Wladimir Chópite
 +584249700264
 ve.linkedin.com/in/wchopite
 Mejor pirata de la armada. Hack the planet!
 
 El 13/03/2014 06:57, Sam lightai...@gmail.com escribió:
 
 
 On Thursday, March 13, 2014 7:21:26 PM UTC+8, wchopite wrote:
 Use the php function json_encode( ).
 
 http://php.net/manual/en/function.json-encode.php
 
 You can generate an associative array with the message you want, and use:
 
 return json_encode($your_array);
 
 Thanks. This worked. I can see the json message in the HTTP response. But I 
 still have a problem. When I look at the HTTP response, it is full of other 
 HTML code besides the json message. How can I remove the other HTML code and 
 leave behind only a clean json message? 
 
 Thank you.
  
 Wladimir Chópite
 +584249700264
 ve.linkedin.com/in/wchopite
 Mejor pirata de la armada. Hack the planet!
 
 El 13/03/2014 06:45, Sam light...@gmail.com escribió:
 I have a controller which takes in an id and checks whether this id exists 
 inside the Model. If it does not exist, I would like the controller to return 
 a validation error message id not found in json when it returns the HTTP 
 response. This controller takes in a normal HTTP POST which is not in json.
 
 How can this be done in Cakephp 2.4.5?
 
 My controller code looks something like this;
 
 public function controller_function($id=null)
 {
 if ($this-request-is('post')) 
 {
$field=$this-request-data['Model']['field'];
$Model_id = $this-Model-findFieldID($field);
if (empty($Model_id) ) //record not found. Return validation error
{
//Send validation error back in JSON. How??
}
 }
 }
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+u...@googlegroups.com.
 To post to this group, send email to cake...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Is Cake Dead Or Just Catching Up?

2014-03-12 Thread Jeremy Burns : Class Outfit
I was also surprised to see Zend so far down - any glance over the job boards 
suggests this is one of the most in demand frameworks. I'm not losing any sleep 
over this survey.

On 12 Mar 2014, at 14:50, kdubya kenwin...@winanstech.com wrote:

 I'm taking the bait:
 
 Looking at the article and the pie chart I have the following observations:
 
 Given that the bottom 8 frameworks (pear is a framework?) all have a 
 response of 1.50% (likely one response each) and the intervals between the 
 other groups (Zend 1 and none likely had 2 responses each , etc.) one can 
 infer that the sample size of the valid responses to the survey was 67 +/-. 
 Hardly a valid sample size. They conveniently left out this fact from their 
 article. Any good survey ALWAYS gives the sample size.
 
 What is sitepoint.com and what gives them the brass to say their readership 
 mirrors the PHP Community at large?
 
 I have used CakePHP for 5 years and I'm very happy with most aspects. The 
 changes from 1.3 to 2.x really were a big improvement. I have not begun 
 looking at 3.0 yet. 
 
 I have tired Codeigniter and Symphony 2 briefly but ran back to Cake very 
 quickly. It fits my thinking.
 
 Also, judging by participation in the Google CakePHP group is not very valid 
 either. StackOverflow seems to be more active now and the questions seem to 
 be better.
 
 Ken
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Is Cake Dead Or Just Catching Up?

2014-03-11 Thread Jeremy Burns : Class Outfit
This question is a bit like What's your favourite colour; triangle or banana? 
It's largely a matter of interpretation, habit and opinion. Or Who's the best 
looking actress?.

I don't measure Cake's qualities on how popular it is or how many support 
questions are raised. I measure it on its ability to do a job for me and my 
clients. It's still my go-to-framework and I'm looking forward to v3. Perhaps 
others are better or faster, but that would take time and effort on my part to 
go and discover.

I also only consider the performance of the sites I build, not the tool itself. 
Cake is just a tool. In the wrong hands it could be a dog, just like any other 
toolset. In the right hands it could be the best, just like any other toolset.

I remember asking the same question not long after I adopted it (v1.1 perhaps?) 
when some core members left the team. It didn't die then and it isn't going to 
die now.

It's all good.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 11 Mar 2014, at 06:24, Dr. Tarique Sani tariques...@gmail.com wrote:

 CakePHP is far from dead. Have been hearing about since a few years now ;-) 
 Not a flame bait but anyone here remembers Lithium? 
 
 The dev team is busy putting finishing touches to version 3.0 which promises 
 to be a huge leap. I will confess that I did wander over to Laravel land but 
 I am back. There are several things which are pretty cool in Laravel but a 
 lot of things just require too much work. I am seeing a lot of what I loved 
 in Laravel already available in V3.0 dev preview 
 
 Also the biggest for me - there are very few Laravel jobs out there at the 
 moment and things do not seem to have changed from November to now.
 
 Cheers
 Tarique
 
 
 
 
 On Tue, Mar 11, 2014 at 10:43 AM, Advantage+ movepix...@gmail.com wrote:
 Looking at these stats is Cake dead?
 
  
 
 http://www.sitepoint.com/best-php-frameworks-2014/
 
  
 
 Can it keep up or catch up?
 
  
 
 Over the years I would see 50 Cake messages a day, now it's lucky if you see 
 2 topics with 1 response in the daily abridged update.
 
 Very few questions hit the inbox, less and less ever day.
 
  
 
 Don't get me wrong I love Cake but is heading out to the pasture to call it a 
 day?
 
 Seems no longer a popular framework as others pop up.
 
  
 
 Others are much faster, and have everything Cake has to offer and more.
 
  
 
 Everyone has an opinion, let's see if anyone replies or too busy with other 
 frameworks J
 
  
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 
 
 -- 
 =
 The Conference Schedule Creator : http://shdlr.com
 
 PHP for E-Biz : http://sanisoft.com
 =
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Is Cake Dead Or Just Catching Up?

2014-03-11 Thread Jeremy Burns : Class Outfit
By the way, I've noticed the same thing about the Google forum. I used to spend 
perhaps an hour a day answering questions where I could. But then the trend 
became that quite a lot of the questions were either so basic that anyone 
reading even the first few pages of the Cookbook wouldn't ask, or Someone help 
me build a Facebook copy - and hurry! Its urgent!. I found it more and more 
difficult to contribute any value, so drifted away. I still read every question 
but rarely feel the urge to respond. But I still don't use that as a measure of 
the quality of the tool.


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 11 Mar 2014, at 06:35, Jeremy Burns : Class Outfit 
jeremybu...@classoutfit.com wrote:

 This question is a bit like What's your favourite colour; triangle or 
 banana? It's largely a matter of interpretation, habit and opinion. Or 
 Who's the best looking actress?.
 
 I don't measure Cake's qualities on how popular it is or how many support 
 questions are raised. I measure it on its ability to do a job for me and my 
 clients. It's still my go-to-framework and I'm looking forward to v3. Perhaps 
 others are better or faster, but that would take time and effort on my part 
 to go and discover.
 
 I also only consider the performance of the sites I build, not the tool 
 itself. Cake is just a tool. In the wrong hands it could be a dog, just like 
 any other toolset. In the right hands it could be the best, just like any 
 other toolset.
 
 I remember asking the same question not long after I adopted it (v1.1 
 perhaps?) when some core members left the team. It didn't die then and it 
 isn't going to die now.
 
 It's all good.
 
 Jeremy Burns
 Class Outfit
 
 http://www.classoutfit.com
 
 On 11 Mar 2014, at 06:24, Dr. Tarique Sani tariques...@gmail.com wrote:
 
 CakePHP is far from dead. Have been hearing about since a few years now ;-) 
 Not a flame bait but anyone here remembers Lithium? 
 
 The dev team is busy putting finishing touches to version 3.0 which promises 
 to be a huge leap. I will confess that I did wander over to Laravel land but 
 I am back. There are several things which are pretty cool in Laravel but a 
 lot of things just require too much work. I am seeing a lot of what I loved 
 in Laravel already available in V3.0 dev preview 
 
 Also the biggest for me - there are very few Laravel jobs out there at the 
 moment and things do not seem to have changed from November to now.
 
 Cheers
 Tarique
 
 
 
 
 On Tue, Mar 11, 2014 at 10:43 AM, Advantage+ movepix...@gmail.com wrote:
 Looking at these stats is Cake dead?
 
  
 
 http://www.sitepoint.com/best-php-frameworks-2014/
 
  
 
 Can it keep up or catch up?
 
  
 
 Over the years I would see 50 Cake messages a day, now it's lucky if you see 
 2 topics with 1 response in the daily abridged update.
 
 Very few questions hit the inbox, less and less ever day.
 
  
 
 Don't get me wrong I love Cake but is heading out to the pasture to call it 
 a day?
 
 Seems no longer a popular framework as others pop up.
 
  
 
 Others are much faster, and have everything Cake has to offer and more.
 
  
 
 Everyone has an opinion, let's see if anyone replies or too busy with other 
 frameworks J
 
  
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 
 
 -- 
 =
 The Conference Schedule Creator : http://shdlr.com
 
 PHP for E-Biz : http://sanisoft.com
 =
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/d/optout.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit

Re: Any problems if foreign key is defined in the table creation SQL script?

2014-02-23 Thread Jeremy Burns : Class Outfit
I always view them separately. The model associations tell Cake how different 
tables are related but doesn't enforce it. The SQL absolutely defines the 
relationships and enforces the integrity.  I wouldn't omit the integrity as 
that is the golden source.


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 23 Feb 2014, at 12:30, Sam lightai...@gmail.com wrote:

 In cakephp, the table relationship is defined in the Models and no foreign 
 key needs to be defined in the table creation SQL script. However, I have a 
 SQL script created using MySQL workbench that defines the foreign key. Will 
 this be a problem in cakephp?
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Does the choice of framework matter to ease of ajax dynamic front-end coding?

2014-01-20 Thread Jeremy Burns : Class Outfit
CakePHP is absolutely fine for Ajax. Your approach sounds right - it’s what I 
do.

On 20 Jan 2014, at 14:58, Sam lightai...@gmail.com wrote:

 I have an upcoming project which may use lots of ajax dynamic front-end 
 features. Does the choice of framework matter to ease of ajax dynamic 
 front-end coding? I have never used ajax before, so I am kind of nervous at 
 whether cakephp would be the right choice or if there is a simpler framework.
 
 My understanding is that for ajax, it makes web services calls to the 
 controller through sending the right URL and the controller returns the reply 
 in json. Therefore, it should not really matter which framework is used 
 because to the ajax, it just makes the right web service calls. Is my 
 understanding correct? Thank you.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Customise authError message class

2013-12-13 Thread Jeremy Burns : Class Outfit
Why not just specify the element you need as the second parameter then create 
an element for each message type - then you have complete control over layout, 
styling, classes and eventhing.?
http://book.cakephp.org/2.0/en/core-libraries/components/sessions.html#SessionComponent::setFlash


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 12 Dec 2013, at 22:59, seba sebastian.allo...@gmail.com wrote:

 Solved. Here's the working solution for reference- 
 
 Code snippet in /Controller/AppController.php: 
 
 public function beforeFilter() { 
   //Set custom authError message if user tries to access a controller when 
 not logged in 
   $this-Auth-authError = __('You are not authorized to view this page.'); 
   $this-Auth-flash['params']['class'] = 'alert alert-danger'; //Add this 
 line to control output auth flash class
 }
 
 On Thursday, 12 December 2013 23:46:39 UTC+11, seba wrote:
 I'm looking for advice on how to customize the authError message class (I'm 
 using Twitter Bootstrap, so would like to use the alert styles from 
 Bootstrap).
 
 In /Controller/AppController.php I have the following snippet:
 
 public function beforeFilter() {
   //Set custom authError message if user tries to access a controller when 
 not logged in
   $this-Auth-authError = __('You are not authorized to view this page.');
 }
 Which produces this HTML (class=message:
 
 div id=authMessage class=message You are not authorized to view this 
 page./div
 
 What I'd like to output is this HTML (class=alert alert-danger):
 div id=authMessage class=alert alert-danger You are not authorized to 
 view this page./div
 
 Much thanks in advance.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Is it possible to retrieve webroot folder location in Javascript?

2013-10-29 Thread Jeremy Burns : Class Outfit
Not sure if it's the approved way, but I do this:

script
var baseUrl = '?php echo $this-Html-url('/', true); ?';
/script

...before I load jQuery, which means I can use the baseUrl variable.




Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 30 Oct 2013, at 01:43, Sam lightai...@gmail.com wrote:

 I use the following ?php echo $this-webroot; ? to retrieve the webroot 
 location in cakephp. I wonder how one can use Cakephp to retrieve webroot 
 location in Javascript.
 
 On Wednesday, October 30, 2013 7:08:30 AM UTC+8, Sam wrote:
 I am writing javascript with jquery currently. Is it possible to retrieve 
 webroot folder location in Javascript? This will be good if webroot changes 
 in future.
 
 Thank you.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to relate table with one of many others?

2013-09-30 Thread Jeremy Burns | Class Outfit
Surely there would be a 1-many relationship between:
orders_types (which ought to be called order_types) and orders
domains to orders
hostings to orders?

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 30 Sep 2013, at 13:05:18, Kemal ahmetkemala...@gmail.com wrote:

 Hello,
 
 I have created a topic on stackoverflow but didn't get attention. So...
 
 I am little confused about my db design. I have orders table that may have 
 records from one of many others. So is it OK to relate each tables with 1:1 
 to orders. Please look at orders domains andhostings table relations.
 
 My orders table rows has either a domain or hosting regarding to its 
 orders_type value. There will be more than 10 products like domains, hostings 
 etc. So creating a column on orders table for each product would not be a 
 good practice.
 
 What is the best way to build my structure for CakePhp?
 
 
 
 
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to relate table with one of many others?

2013-09-30 Thread Jeremy Burns | Class Outfit
Scrub that - I see there is an orders_id field on hostings and domains. Sorry. 
However, some of your fields have incorrect names:

domains-orders_id ought to be 'order_id'
hostings-orders_id ought to be 'order_id'
orders-orders_types_id ought to order_type_id
clients_bills table name ought to be client_bills
client_bills-clients_id ought to be client_id

I note that you have both clients_id and client_id on the orders table. I'm 
assuming that one would be the id used by the client? If so, the joining field 
will be order_id. I'd consider renaming orders_id to something that doesn't end 
in _id as Cake will try to find a related table and build an association with 
it; perhaps client_reference would be better?

If you made those changes you could get your basic models built using cake bake.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 30 Sep 2013, at 13:23:25, Jeremy Burns | Class Outfit 
jeremybu...@classoutfit.com wrote:

 Surely there would be a 1-many relationship between:
 orders_types (which ought to be called order_types) and orders
 domains to orders
 hostings to orders?
 
 Jeremy Burns
 Class Outfit
 
 http://www.classoutfit.com
 
 On 30 Sep 2013, at 13:05:18, Kemal ahmetkemala...@gmail.com wrote:
 
 Hello,
 
 I have created a topic on stackoverflow but didn't get attention. So...
 
 I am little confused about my db design. I have orders table that may have 
 records from one of many others. So is it OK to relate each tables with 1:1 
 to orders. Please look at orders domains andhostings table relations.
 
 My orders table rows has either a domain or hosting regarding to its 
 orders_type value. There will be more than 10 products like domains, 
 hostings etc. So creating a column on orders table for each product would 
 not be a good practice.
 
 What is the best way to build my structure for CakePhp?
 
 
 
 
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: How to relate table with one of many others?

2013-09-30 Thread Jeremy Burns | Class Outfit
Cake won't/can't but your code can make it happen.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 30 Sep 2013, at 13:55:01, Kemal ahmetkemala...@gmail.com wrote:

 I am using Mysql Workbench and it forces plural names. I will fix them. Will 
 cakephp decide whether it is a domain or a hosting looking by order_type_id?
 
 On Monday, September 30, 2013 3:35:15 PM UTC+3, Jeremy Burns wrote:
 Scrub that - I see there is an orders_id field on hostings and domains. 
 Sorry. However, some of your fields have incorrect names:
 
 domains-orders_id ought to be 'order_id'
 hostings-orders_id ought to be 'order_id'
 orders-orders_types_id ought to order_type_id
 clients_bills table name ought to be client_bills
 client_bills-clients_id ought to be client_id
 
 I note that you have both clients_id and client_id on the orders table. I'm 
 assuming that one would be the id used by the client? If so, the joining 
 field will be order_id. I'd consider renaming orders_id to something that 
 doesn't end in _id as Cake will try to find a related table and build an 
 association with it; perhaps client_reference would be better?
 
 If you made those changes you could get your basic models built using cake 
 bake.
 
 Jeremy Burns
 Class Outfit
 
 http://www.classoutfit.com
 
 On 30 Sep 2013, at 13:23:25, Jeremy Burns | Class Outfit 
 jerem...@classoutfit.com wrote:
 
 Surely there would be a 1-many relationship between:
 orders_types (which ought to be called order_types) and orders
 domains to orders
 hostings to orders?
 
 Jeremy Burns
 Class Outfit
 
 http://www.classoutfit.com
 
 On 30 Sep 2013, at 13:05:18, Kemal ahmetke...@gmail.com wrote:
 
 Hello,
 
 I have created a topic on stackoverflow but didn't get attention. So...
 
 I am little confused about my db design. I have orders table that may have 
 records from one of many others. So is it OK to relate each tables with 1:1 
 to orders. Please look at orders domains andhostings table relations.
 
 My orders table rows has either a domain or hosting regarding to its 
 orders_type value. There will be more than 10 products like domains, 
 hostings etc. So creating a column on orders table for each product would 
 not be a good practice.
 
 What is the best way to build my structure for CakePhp?
 
 
 
 
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+u...@googlegroups.com.
 To post to this group, send email to cake...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+u...@googlegroups.com.
 To post to this group, send email to cake...@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Cake PhP Beginner: nested associations and views

2013-09-16 Thread Jeremy Burns | Class Outfit
Have a look at the Containable behaviour, add it to your AppModel (so it is 
always available) and set recursive to -1 in your AppModel. Containable is your 
friend. It gives you complete control over what associated data is returned.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 16 Sep 2013, at 14:33:43, Luca Simonella thermopo...@gmail.com wrote:

 Hi, this is my first week on CakePhP and I found it awesome.
 I'm developing a web site for my fantasy football championship and I made a 
 few model with the following associations:
 
 Team has Many Player
 Player belongTo Team
 Player hasMany Vote
 Vote belongTo Player
 
 So relationships are Team -- Player -- Vote. Now I want to make a view that 
 lists all the players for a specific team AND for each player I want to show 
 statics about their votes. My Player mdoel is made like this:
 
 class Player extends AppModel{
   public $belongsTo = 'Team';
   public $hasMany = array(
   'Vote' = array(
   'className' = 'Vote',
   'fields' = array(
   'AVG(Voto) as Media',
   'SUM(Goal) as Goal',
   'SUM(GoalSubito) as GoalSubito',
    other fields with italian names btw
   ),
   'group' = array('Giornata')
   )
   );  
 }
 
 when I wrote view for a specific player it works, but If I'm going to wrote 
 the specific team view, data about single player votes does not appear from 
 debug.
 
 Array
 (
 [Team] = Array
 (
 [ID] = 1
 [Nome] = Lokomotiv Wagon
 [Allenatore] = Luca Ponch Simonella
 [Budget] = 320
 [Stadio] = Julian Ross Stadium Memorial
 [Maglia] = 
 [Logo] = 
 [id] = 1
 )
 
 [Player] = Array
 (
 [0] = Array
 (
 [ID] = 292
 [Nome] = AMELIA
 [Ruolo] = P
 [Squadra] = MILAN
 [Quota] = 1
 [QuotaIniziale] = 2
 [team_id] = 1
 )
 
 [1] = Array
 (
 [ID] = 291
 [Nome] = ABBIATI
 [Ruolo] = P
 [Squadra] = MILAN
 [Quota] = 13
 [QuotaIniziale] = 13
 [team_id] = 1
 )
 ...
 }
 
 Have I to use recursive option? How can i go deeply on my association to 
 retrieve data? I hope you could help.
 
 Thank you
 
 Luca
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Unrelated data

2013-09-14 Thread Jeremy Burns
A question that I perhaps I should know the answer to, but I am not clear 
on the recommended approach - I am open to ideas.

I want to add a wizard process to an app. A wizard takes a user through a 
series of steps by visiting pages in sequence. Wizard availability and 
progress is managed in the session. The wizards are configurable with the 
definitions stored in tables (wizards, wizard_types and wizard_steps) - I 
have all the MVC goodness sorted for managing those. The wizard tables are 
not associated with any other tables.

I want to make those wizards available to users. So first I need to grab 
the list of wizards from the Wizard model and store them in session. When a 
user chooses one, an element appears that gives them information about the 
wizard, shows the completed, current and next steps and takes them to a 
page. So I need to access the wizard data/models/controllers from other 
models/controllers that are not related to any others. Ideally this would 
be a plugin as it lays over other functionality that ought to be agnostic 
of it. I guess I could:

1) Make it a plugin - but I still have the same challenge - how do I call a 
plugin-controller function from another?
2) Do some clever plugin/component callback trickery that is beyond me.
3) Use loadModel - but then I don't have access to controller functions 
(for managing the session, for example) and need to stitch functions into 
core models.
4) User requestAction in elements - but that seems a bit hacky. In any 
case, I probably need something triggered in AppController-beforeFilter to 
check the wizard status and decide what to do next.

So - pardon my ignorance - but I am really not sure the preferred way of 
doing this. What are your recommendations?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Putting custom code in a separate repository

2013-09-09 Thread Jeremy Burns : Class Outfit
Check out Git submodules - that's exactly what they are for.


Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 9 Sep 2013, at 14:17, David Suna david.s...@gmail.com wrote:

 I started a project locally by cloning the git repository for CakePHP (branch 
 2.4). I would like to maintain the ability to do a pull on the git repository 
 to get any updates as new releases are put out.  I assume I should be on 
 branch 2.4 rather than on master.
 
 I would also like to have my code in a separate repository.  That includes 
 any changes I made to files that come as part of the CakePHP repository (so 
 far this includes app/Config/bootstrap.php, app/Config/core.php, 
 app/Config/routes.php and app/Controller/AppController.php) as well as files 
 that I have added (i.e. everything under Config, Controller, Model, Test, 
 View and webroot).
 
 There are also Plugins that have been retrieved from other repositories but 
 since those are contained under a single directory that isn't a problem to 
 maintain.
 
 Does anyone have a recommendation as to how to go about doing this?
 
 Thanks.
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Putting custom code in a separate repository

2013-09-09 Thread Jeremy Burns : Class Outfit
You add submodules in a path relative to the root of the git repository. I am a 
Git command line coward so use SourceTree (http://sourcetreeapp.com) which does 
it all for me. I have all (most) of my plugins as submodules.

On 9 Sep 2013, at 14:48, David Suna david.s...@gmail.com wrote:

 Thanks for the suggestion.
 
 From a quick look at git submodules it seems that they are geared to using 
 them in a single directory.  The changes to a clean CakePHP installation end 
 up being across multiple directories as well as include changes to some of 
 the files in the original CakePHP repository.  I didn't see how submodules 
 would handle that situation.  Do you have a reference that would explain this 
 more?
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Ajax Login - Redirect Help

2013-09-05 Thread Jeremy Burns : Class Outfit
Don't know if this is the best way of handling this, but this is what I do: 
https://gist.github.com/classoutfit/6459420 It seems to work pretty well.



Jeremy Burns
Class Outfit






Mob: +44 (0) 7973 481949
Tel: +44 (0) 208 123 3822
Skype: jeremy_burns
classoutfit.com
@classoutfit

On 5 Sep 2013, at 21:51, Advantage+ movepix...@gmail.com wrote:

 I have / working on a site where 90% of the admin area is handled via ajax / 
 json.
  
 So I am at the point where I login, destroy the session (on purpose) and try 
 to perform an action, which obviously fails but how can I trigger it to force 
 the user back to login page, your session has expired please login to 
 continue message type setup?
  
 I know about 'ajaxLogin' = '/Elements/users/ajax_login', which is what I 
 used before altering all calls to be JSON so no HTML is now getting spit back 
 to the view.
 Just wondering what the easiest, site wide approach would be to direct a user 
 to the login page if their session has expired when attempting an ajax 
 request.
  
 Any and all ideas welcome,
  
 Thanks
  
 Dave
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.
inline: mail.png

Re: My awesome flash system

2013-09-04 Thread Jeremy Burns : Class Outfit
How is that more awesome than what you do out of the box?

On 4 Sep 2013, at 16:14, Prashant Shah pshah.mum...@gmail.com wrote:

 Hi,
 
 This is first time I am working with cakephp and I was not satisfied with the 
 flash message system in cakephp.
 
 Here is how to setup your own awesome flash system (MIT License) :
 
 - Multiple messages for each type
 - Separate divs for each type
 - Each message shown as li
 
 Create a file : app/View/Helper/FlashExtHelper.php
 
 ?php
 // MIT License
 App::uses('AppHelper', 'View/Helper');
 App::uses('CakeSession', 'Model/Datasource');
 
 class FlashExtHelper extends AppHelper {
 
 public function flashExt() {
 $out = false;
 
 if (CakeSession::check('FlashExt')) {
 $messages = (array)CakeSession::read('FlashExt');
 foreach($messages as $key = $type) {
 $out .= 'div id=flash class=' . $key . '\';
 $out .= 'ul';
 foreach ($type as $key = $message) {
 $out .= 'li' . $message . '/li';
 }
 $out .= '/ul';
 $out .= '/div';
 }
 CakeSession::delete('FlashExt');
 }
 
 return $out;
 }
 }
 ?
 
 Add the following in app/Controller/AppController.php :
 
 class AppController extends Controller {
 public $helpers = array('FlashExt');
 
 // MIT License
 function setFlashExt($message, $type) {
 $messages = (array)$this-Session-read('FlashExt');
 $messages[$type][] = $message;
 $this-Session-write('FlashExt', $messages);
 }
 }
 
 Use it in your views :
 
 ?php echo $this-FlashExt-flashExt(); ?
 
 Use it in your controllers :
 
 $this-setFlashExt('message', 'notice');
 $this-setFlashExt('message', 'success');
 $this-setFlashExt('message', 'error');
 
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: decrypt password

2013-08-30 Thread Jeremy Burns : Class Outfit
It (deliberately) uses one way encryption. All it can do is encrypt your 
password attempt and see if it matches what is stored (which is also encrypted).

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 30 Aug 2013, at 10:53, raj kumar Pustela pustela...@gmail.com wrote:

 hi to all,
 
 how to decrypt  password in cakephp.if any one known pls help 
 me.. 
 
 
 Thannks,
 Rajakumar
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Include count of nested associated object as virtual field.

2013-08-18 Thread Jeremy Burns | Class Outfit
counterCache is your friend.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 17 Aug 2013, at 23:02:51, Nicholas Amon nicholasa...@gmail.com wrote:

 Hi,
 
 I have the following model relationships
 
 Question belongs to Chapter
 Chapter belongs to Unit
 
 I want to add a virtual field in the Unit model that counts how many 
 questions a unit has.  I tried this:
 
   public $virtualFields = array(
   questionCount = 'SELECT COUNT(*) FROM questions as 
 Question JOIN chapters as Chapter ON (Question.chapter_id = Chapter.id) JOIN 
 units as Unit ON (Chapter.unit_id = Unit.id)'
   );
 
 The problem here is that it returns the same value for all untis.  The issue 
 here is that I want the count for each Unit instance.  In other words, I 
 would like to add a where clause so that the query becomes something similar 
 to:
 
   public $virtualFields = array(
   questionCount = 'SELECT COUNT(*) FROM questions as 
 Question JOIN chapters as Chapter ON (Question.chapter_id = Chapter.id) JOIN 
 units as Unit ON (Chapter.unit_id = Unit.id)  WHERE Unit.id = 
 CAKE_REPLACE_WITH_CURRENT_ID'
   );
 
 How do I get cake to CAKE_REPLACE_WITH_CURRENT_ID to be the ID of the current 
 Unit instance that is being retrieved?
 
 I hope I have made my question clear.  Thanks in advance.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Where are the sites?

2013-08-18 Thread Jeremy Burns | Class Outfit
What a pretty site shows is good graphic skills and CSS, neither of which have 
anything material to do with CakePHP, which is a 'scaffolding' language - for 
want of a better expression. PHP just supplies the framework that you can drape 
with a good looking presentation layer. Without a decent back end the pretty 
site will not work very well. You could say judging the mechanics of a site by 
focussing on how good it looks is like putting a vacuum cleaner motor inside a 
Ferrari body, no?

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 18 Aug 2013, at 05:40:03, Advantage+ movepix...@gmail.com wrote:

 That’s like saying a who cares about the ferrari engine just put it in a box .
  
 You need to showcase the goods. That’s all I am saying.
 Front end is what people see, they do not see requests, database 
 optimization, sure good code but people do not see that.
 They see a website and say well that is nice. Not hum I wonder if it's cached 
 or how mant HTTP requests.
  
 Does that make sense?
  
 I will put it out there I love Cake, no doubt about it. Fantastic framework 
 but you still need a front end visual. Check out my work! I have worked for 
 some big names. And saying well code is everything is wrong. You need to back 
 up the code with visuals people see!
  
  
 Dave Maharaj
 Freelance Designer | Developer
 image001.jpg
 www.movepixels.com  |  d...@movepixels.com  |  709.800.0852
  
 From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf 
 Of Simon Males
 Sent: Saturday, August 17, 2013 11:34 PM
 To: cake-php@googlegroups.com
 Subject: Re: Where are the sites?
  
 A pretty looking site, has very little to do with the backend.
  
 
 On Sun, Aug 18, 2013 at 5:16 AM, Advantage+ movepix...@gmail.com wrote:
 Just a curiosity question.
  
 So many people are part of the Cake group yet we never see any actual work.
  
 No hey check out my site I did this, very little showcase.
  
 Sure on the Cake home page there are 5 sites which have been there for a 
 year. Really? And they suck ass! Ni real design just half assed crap!
 I took a look at cakeDc site and what a joke!
 Ugliest site ever who did that?
  
 Sure code all you li9ke but you still need to appeal to the end user. Hello 
 1997 html my first web page look. Only thing missing is a animated 
 gif!.
  
  
  
  
 For such a great framework why is there a lack luster amount of sites?
  
  
  
 Dave Maharaj
 Freelance Designer | Developer
 image001.jpg
 www.movepixels.com  |  d...@movepixels.com  |  709.800.0852
  
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.
 
 
 
 -- 
 Simon Males
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Data validation: Client or Server?

2013-08-16 Thread Jeremy Burns | Class Outfit
I still view jQuery as progressive enhancement. Even if it is mostly on it can 
still be turned off, which would - if you relied only on client side code - 
skip your validation. You also never know how your site will be accessed; what 
if (remote, I know) you wanted to open it up as a web service or API? Then 
you'd need to load up your validation anyone. Just my 2c.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 16 Aug 2013, at 12:32:29, jer...@anthemwebsolutions.com wrote:

 I wanted to get some opinions on this. Cake's validation structure is easy to 
 apply and works flawlessly (so far, wink,wink). But I've also written some 
 data validation with jQuery which is activated at the client side. 
 
 Is there still a need to validate at the server if most browsers support 
 javascript? Do some of you leave off the server side validation in lieu of 
 client side? How's that HTML5 data validation working for you?
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


IE6 and IE7 losing sessions - can't log in - solved

2013-08-15 Thread Jeremy Burns
I'm posting this as I had a problem that was driving me nuts. I know IE7 is 
ancient, so there are some posts on this subject from 2008/9, but none 
solved it for me. I have a global banking client trying my software and 
their standard browser is IE6. That is not at all uncommon in large 
corporates; upgrading a browser version is a big task and when you have 
hundreds or thousands of web apps that 'work' in IE6 retesting them is a 
major project. Microsoft even have a special IE6 support arrangement with 
them.

IE6 was proving a step too far for anything approaching a modern web site 
(that - as you'd expect - works perfectly in modern browsers) so they have 
agreed to limit it to users with IE7, which had some residual problems that 
also occurred in IE6.

Anyhow, that's the background, here's the problem and the solution. I just 
hope it helps at least one other person with this issue.

I'm using CakePHP version 2.3.9, but I suspect this would work in previous 
2.x versions too.

*The problem*

Users can log in with any browser but not IE6/7. Even if the right 
credentials work (and you know by using debug statements that the user is 
being logged in) they are constantly returned to the login screen as not 
logged in. Tracking it back, it's all good until the user is redirected, 
when for some reason the session fails, losing the logged in state. For the 
record, I am using database sessions - not sure how relevant this is to 
other session variants.

*The solution*

Add these lines to core.php:

Configure::write(
'Session',
array(
'defaults' = 'database',
'cookie' = '[something]',
'cookieTimeout' = 0,
'checkAgent' = false,
'ini' = array (
'session.cookie_secure' = false,
'session.referer_check' = false
)
)
);

Note that you need to add something relevant as the cookie name. I'd 
recommend avoiding underscores and special characters as there are other IE 
issues related to domain names that contain underscores and - even if they 
have nothing to do with this issues - I prefer to avoid them.

You cannot imagine my joy when I was able to log in after applying this fix.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Prefilling form data doesn't seem to work

2013-08-14 Thread Jeremy Burns : Class Outfit
$data = $this-Model-find etc...

unset($data['Model']['id'];

$this-data = $data;


On 14 Aug 2013, at 19:40, Anja Liebermann c...@anjaliebermann.de wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hi David,
 
 
 this is how I would do it:
 
 copy your edit method and rename it to copy. Like with edit you fetch
 the data which should be cloned and show then in a view copy.ctp which
 has a form like for adding a new record.
 Then when the user submits you call your copy method again in the hey I
 have post data fork and save it as a new record by unsetting a probably
 exiting id.
 
 That should do it.
 
 HTH!
 Anja
 
 
 
 Am 14.08.2013 20:22, schrieb David Carr:
 Here's what I am trying to accomplish:
 
 A user fills out a form, saves a record.  At some later date they wish to 
 clone this record, but may want to make a few tweaks.  This clone 
 functionality should direct them to a form that is pre-filled with the 
 previous record's data so that they can review it, edit as needed, and 
 submit it as a new record.
 
 What I'm trying:
 
 I've modified my add() function to accept a parameters:
 
 function add($cloneid = NULL)
 
 Then created a Clone link that sends them to site/model/add/id
 
 Then, I get the data from that model:
 
 $clone_source = $this-Model-findById($cloneid);
 $this-data['Model']['field1'] = $clone_source['Model']['field1'];
 
 and so on.  Based on Google searching and other posts, this should work. 
 But what actually happens is that upon clicking the 'Clone' link, the user 
 is directed and the form submits itself immediately (failing to save the 
 record, since it fails validation) and the user never actually sees the 
 form.
 
 What am I doing wrong?  (Also I should note, there are relational models 
 present, but I don't think this should be the cause of any problems...I 
 hope).
 
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iEYEARECAAYFAlILzzsACgkQbOdiIJzHNKHLNQCgrshOiC1PR3d3fC5R033EBvqF
 1fkAn2/8z7qSKbalW6aEdYHIQI0ymhhm
 =RTV3
 -END PGP SIGNATURE-
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
 
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Security and Ajax

2013-08-08 Thread Jeremy Burns : Class Outfit
Because the keys are 'use once', so when submitted by ajax become invalid. See 
this page for a solution: 
http://book.cakephp.org/2.0/en/core-libraries/components/security-component.html#SecurityComponent::$csrfUseOnce

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 8 Aug 2013, at 20:53, Advantage+ movepix...@gmail.com wrote:

 I know forms submitted via ajax that the security component does not work. 
 (Checking for edits / tampering)
  
 What is the reason for this? I understand if you add fields dynamically why 
 it would not work because of the hashed fields when the form is rendered.
  
 But if you are simply sending a form as coded $this-Form as standard 
 procedure, no edits or fields added why would it not act the same?
 The exact data is being sent as if it was submitted http. No?
  
 Just curious.
  
 Thanks,
  
 Dave
  
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: rawurlencode() expects parameter 1 to be string, array given [CORE/Cake/Routing/Route/CakeRoute.php, line 503]

2013-08-06 Thread Jeremy Burns | Class Outfit
Looks like $menuList is an array but a string is expected.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 6 Aug 2013, at 15:58:54, Nicholas Amon nicholasa...@gmail.com wrote:

 Hi,
 
 I am making this requestAction call in my menu.ctp:
 
 $menus = $this-requestAction(array(
   'controller' = 'menus',
   'action' = 'menus'
 ), array(
   'pass' = array(
   $menuList
   )
 ));
 
 I am getting the following warning on the page:  rawurlencode() expects 
 parameter 1 to be string, array given [CORE/Cake/Routing/Route/CakeRoute.php, 
 line 503]
 
 I am using CakePHP 2.3.8.  Any idea what can be causing this?
 
 Thanks in advance.
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Re: illuminate, remove Year in birthday field in cake 1.3

2013-06-22 Thread Jeremy Burns | Class Outfit
Have you thought about adding month and day fields to the table and populating 
them beforeSave? Less processing required when you want to run your cron job.

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 22 Jun 2013, at 21:13:01, Chris chris...@yahoo.com wrote:

 Hi guys,... can anyone help me please
 Ho w can I illuminate (remove) Year in birthday field from users table? The 
 concept is to find ONLY Month and Day (e.g. 06-21) from 1964-06-21 
 I'm doing this cronjob feature to send email to friends of a user once the 
 Birthday is reached... e.g. $this-Email-subject = 
 ucfirst(i18n::translate('your friend'))  . ' : ' . $user['User']['firstname'] 
 . ' ' . ucfirst(i18n::translate('celebrating birthday')); on a Social Network 
 site. 
 
 thanks in advance 
 chris
 
 -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Order Tree output

2013-06-11 Thread Jeremy Burns
I've got a multi-tenancy site that includes some tables that use the Tree 
behaviour. By multi-tenancy I mean that several different clients all store 
their data in the same database and they can only access and manage their 
own data.

For example, each client stores their departments in the 'departments' 
table. Each department has a client_id field, as well as parent_id, lft and 
rght. Each client will have one or more top level departments (where 
parent_id is null and client_id = $theirClientId).

My aim is to produce reports where the departments are ordered by parent 
department name - child department name down through the tree to whatever 
level where the nodes at each level are also sorted. Ideally I'd user 
Tree-reorder when departments are added or updated so they are stored in 
the right order and I can simply sort by lft on find, but I'm finding that 
performance is poor. This is partly because if a new top level department 
is added I need to reorder where parent_id is null, and that impacts all 
top level departments not just those belonging to this client. That can 
trigger a lot of cascading updates.

Is there a way to either:
1) use Tree-reorder but pass in extra criteria (parent_id = null AND 
client_id = 123) or
2) Sort the data once it's been found - there plenty of examples using the 
lft column but that isn't correct if the title field isn't also sorted 
correctly when stored.

If the answer is 1 (which sounds right) it can still trigger an update of 
the complete tree if a new top level department is added that begins with 
'A', as all subsequent rows will have to be moved down.

What's the recommended approach?

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Order Tree output

2013-06-11 Thread Jeremy Burns
I solved this - it works but might be either brilliant or stupid.

I added a new field called path. In that field I store the full path from 
the top level of the tree through all children to 'this' one - something 
like this:

   - Top Level Department  Parent Department  Child Department  This 
   Department
   

I can now report the hierarchy by doing a straight sort on this field 
without doing any Tree stuff or parsing.

I have a beforeSave function that identifies if the save is going to change 
the title field or the parent_id. If so, it sets a global variable. The 
afterSave function looks for that variable, and if found it clears the 
variable (to prevent an endless save loop), gets the full path from this 
node back to the root, implodes it with '  ' and updates the 'path' field 
with a long string. It then finds all children of this node (between its 
lft and rght values) and updates those too.

It works nicely and is quite snappy. I also built a temporary function to 
populate the file for migration.

On Tuesday, 11 June 2013 16:02:01 UTC+1, Jeremy Burns wrote:

 I've got a multi-tenancy site that includes some tables that use the Tree 
 behaviour. By multi-tenancy I mean that several different clients all store 
 their data in the same database and they can only access and manage their 
 own data.

 For example, each client stores their departments in the 'departments' 
 table. Each department has a client_id field, as well as parent_id, lft and 
 rght. Each client will have one or more top level departments (where 
 parent_id is null and client_id = $theirClientId).

 My aim is to produce reports where the departments are ordered by parent 
 department name - child department name down through the tree to whatever 
 level where the nodes at each level are also sorted. Ideally I'd user 
 Tree-reorder when departments are added or updated so they are stored in 
 the right order and I can simply sort by lft on find, but I'm finding that 
 performance is poor. This is partly because if a new top level department 
 is added I need to reorder where parent_id is null, and that impacts all 
 top level departments not just those belonging to this client. That can 
 trigger a lot of cascading updates.

 Is there a way to either:
 1) use Tree-reorder but pass in extra criteria (parent_id = null AND 
 client_id = 123) or
 2) Sort the data once it's been found - there plenty of examples using the 
 lft column but that isn't correct if the title field isn't also sorted 
 correctly when stored.

 If the answer is 1 (which sounds right) it can still trigger an update of 
 the complete tree if a new top level department is added that begins with 
 'A', as all subsequent rows will have to be moved down.

 What's the recommended approach?



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




  1   2   3   4   5   6   7   8   9   10   >