Re: uppercase letter names in controller not working in shared hosting

2013-03-28 Thread Miles J
How are you constructing the URLs? If I remember correctly, it should be 
'controller' => 'notification_message'.

On Thursday, March 28, 2013 1:45:24 PM UTC-7, Soumya Ranjan sahu wrote:
>
> I have a cakephp site on bluehost. I have several contollers and some are 
> named with 2  uppercase letters, i.e:- NotificationMessagesContoller.php 
> while others are with 1 uppercase letters, i.e:- UsersController.php
>
> The Users controller working fine but the NotificationMessage contoller 
> shows problem like this "Missing controller: Error: 
> NotificationmessageController not found ; 
> createNotificationmessageController class in the .php file"
>
> If I run the cakephp site on any localhost, all the links are working 
> perfectly without any error.
>
> Is there anybody who has faced this issue any time ?
>
> Thanks for help
>
>
>

-- 
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: Benchmark framework article

2013-03-28 Thread Miles J
It may be ridiculous comparing such different frameworks/languages, but it 
does prove a good point on which ones would perform better given whatever 
scope your application needs to fulfill.

On Thursday, March 28, 2013 12:25:41 PM UTC-7, phpirate wrote:
>
> With all due respect but this benchmark is ridicules!, comparing native 
> coded application with a framework app doesn't make any sense, worst yet 
> comparing programming languages in terms of performance taking in mind the 
> natural diffs between programming languages, its almost like comparing 
> water with milk where both of them are liquids but each one of them has its 
> own use!
>
>
> On Thu, Mar 28, 2013 at 8:58 PM, Miles J 
> > wrote:
>
>> Found this article. Pretty interesting that Cake is last place in every 
>> benchmark (given that it's multiple languages).
>>
>> http://www.techempower.com/blog/2013/03/28/framework-benchmarks/
>>  
>> -- 
>> 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?hl=en.
>> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Benchmark framework article

2013-03-28 Thread Miles J
Found this article. Pretty interesting that Cake is last place in every 
benchmark (given that it's multiple languages).

http://www.techempower.com/blog/2013/03/28/framework-benchmarks/

-- 
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: Should validation 'allowEmpty' be removed?

2013-03-25 Thread Miles J
+1

notEmpty and required sort of solve this already.

On Saturday, March 23, 2013 8:25:41 AM UTC-7, Sebastiaan van Stijn wrote:
>
> I've encountered many new CakePHP users that were a bit confused by the 
> 'allowEmpty' option in validation rules. Thinking about this issue, I must 
> say that I agree.
>
> 'allowEmpty' is confusing because it's both an 'option' for a validation 
> rule (it can be combined with another rule), *and *can be used as a 
> 'validation rule' on itself. When it *is* used on itself, it seems to 
> duplicate the 'notEmpty()' Core Validation Rule ().
>
> Another side-effect of the 'allowEmpty' option, is that (by default) it 
> doesn't work in combination with custom validation rules (
> http://stackoverflow.com/questions/15570376/custom-validation-is-not-taking-allowempty-option
> )
>
> If I'm not overlooking things, all validate arrays below basically do the 
> same:
>
>public $validate = array(
> 'name' => array(
>  'allowEmpty' => false,
>);
>);
>
>
>  // Simple notation, no options provided
>
>public $validate = array(
> 'name' => 'notEmpty';
>);
>
>
>  // Array notation, no options provided
>
>public $validate = array(
> 'name' => array(
>  'rule' => 'notEmpty'
>);
>);
>
> My suggestion is to remove the 'allowEmpty' option. (or at least make sure 
> that it is taken into account for custom validation-methods on a Model).
> If this option is to be removed, an exception should be thrown that a 
> deprecated option is used to prevent users from unwanted behavior :)
>
>
> I'm new to this group (not new to CakePHP), so I don't know if this is the 
> proper channel to make feature requests/suggestions in this location. If 
> not, hints on where to file these kind of requests are welcome!
>
>
>
>

-- 
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: uploading file

2013-03-25 Thread Miles J
Pick one:

https://github.com/davidpersson/media
https://github.com/bmcclure/CakePHP-Media-Plugin
https://github.com/milesj/Uploader

https://www.google.com/search?q=cakephp+file+uploading&aq=f&oq=cakephp+file+uploading

On Sunday, March 24, 2013 8:12:08 PM UTC-7, Rian Falam Simanjuntak wrote:
>
> somebody please help me to upload file 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Solution for CakePHP newbies who are stuck with messages like - Error: PostController could not be found

2013-03-23 Thread Miles J
CakePHP requires that you understand PHP. The fact that you didn't know 
that is unsettling.

On Saturday, November 24, 2012 12:53:19 PM UTC-8, Mike Pritchard wrote:
>
> I struggled with the problems described in messages from new CakePHP 
> users.  The Cake install looked OK, but when I went through the Blog Adding 
> a Layer tutorial I'd get these kinds of messages.
>
> Error: PostController could not be found
> Error: Create the class PostController below in file: 
> app/Controller/PostsController.php
>
> After reading lots of threads, going through the tutorial again and again, 
> reinstalling, checking mod_rewrite, etc., I finally figured it out.  So 
> hopefully this will help others.
>
> The Cakewalk tutorials omit to mention that the php files need to start 
> with  this was correct - part of the Cakewalk process. And also discovered that 
> the php files that start with .
>
> When I added the  everything started working!  I've been able to finish the tutorial and even 
> extend it a little.
>
> Onward and upward.
> MIke
>
>

-- 
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: FULL_BASE_URL error using requestAction()

2012-12-07 Thread Miles J
Anyone have an idea?

On Monday, November 26, 2012 12:11:05 PM UTC-8, Miles J wrote:
>
> The latest, 2.2.2 I believe.
>
> On Thursday, November 22, 2012 5:40:38 AM UTC-8, jsundquist wrote:
>>
>> What version are you using.
>> On Nov 22, 2012 1:39 AM, "Miles J"  wrote:
>>
>>> I keep seeing this in my debug.log, any ideas?
>>>
>>> 2012-11-22 03:22:36 Notice: Notice (8): Use of undefined constant 
>>> FULL_BASE_URL - assumed 'FULL_BASE_URL' in 
>>> [/var/www/cake/latest/lib/Cake/Core/Object.php, line 87]
>>> Trace:
>>> Object::requestAction() - CORECake/Core/Object.php, line 87
>>> include - /var/www//public/app/View/Elements/sidebar.ctp, line 1
>>> View::_evaluate() - CORECake/View/View.php, line 921
>>> View::_render() - CORECake/View/View.php, line 884
>>> View::element() - CORECake/View/View.php, line 422
>>> include - APP/View/News/index.ctp, line 9
>>> View::_evaluate() - CORECake/View/View.php, line 921
>>> View::_render() - CORECake/View/View.php, line 884
>>> View::render() - CORECake/View/View.php, line 476
>>> Controller::render() - CORECake/Controller/Controller.php, line 956
>>> Dispatcher::_invoke() - CORECake/Routing/Dispatcher.php, line 193
>>> Dispatcher::dispatch() - CORECake/Routing/Dispatcher.php, line 161
>>> [main] - APP/webroot/index.php, line 98
>>>
>>> And the sidebar element:
>>>
>>> requestAction('/sidebar/' . $sidebar, array('return', 
>>> 'bare' => false)); ?>
>>>
>>> Should I just define FULL_BASE_URL? 
>>>
>>> -- 
>>> 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 post to this group, send email to cake...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> cake-php+u...@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>>  
>>>  
>>>
>>

-- 
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: FULL_BASE_URL error using requestAction()

2012-11-26 Thread Miles J
The latest, 2.2.2 I believe.

On Thursday, November 22, 2012 5:40:38 AM UTC-8, jsundquist wrote:
>
> What version are you using.
> On Nov 22, 2012 1:39 AM, "Miles J" > 
> wrote:
>
>> I keep seeing this in my debug.log, any ideas?
>>
>> 2012-11-22 03:22:36 Notice: Notice (8): Use of undefined constant 
>> FULL_BASE_URL - assumed 'FULL_BASE_URL' in 
>> [/var/www/cake/latest/lib/Cake/Core/Object.php, line 87]
>> Trace:
>> Object::requestAction() - CORECake/Core/Object.php, line 87
>> include - /var/www//public/app/View/Elements/sidebar.ctp, line 1
>> View::_evaluate() - CORECake/View/View.php, line 921
>> View::_render() - CORECake/View/View.php, line 884
>> View::element() - CORECake/View/View.php, line 422
>> include - APP/View/News/index.ctp, line 9
>> View::_evaluate() - CORECake/View/View.php, line 921
>> View::_render() - CORECake/View/View.php, line 884
>> View::render() - CORECake/View/View.php, line 476
>> Controller::render() - CORECake/Controller/Controller.php, line 956
>> Dispatcher::_invoke() - CORECake/Routing/Dispatcher.php, line 193
>> Dispatcher::dispatch() - CORECake/Routing/Dispatcher.php, line 161
>> [main] - APP/webroot/index.php, line 98
>>
>> And the sidebar element:
>>
>> requestAction('/sidebar/' . $sidebar, array('return', 
>> 'bare' => false)); ?>
>>
>> Should I just define FULL_BASE_URL? 
>>
>> -- 
>> 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 post to this group, send email to cake...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> cake-php+u...@googlegroups.com .
>> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>>  
>>  
>>
>

-- 
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




FULL_BASE_URL error using requestAction()

2012-11-21 Thread Miles J
I keep seeing this in my debug.log, any ideas?

2012-11-22 03:22:36 Notice: Notice (8): Use of undefined constant 
FULL_BASE_URL - assumed 'FULL_BASE_URL' in 
[/var/www/cake/latest/lib/Cake/Core/Object.php, line 87]
Trace:
Object::requestAction() - CORECake/Core/Object.php, line 87
include - /var/www//public/app/View/Elements/sidebar.ctp, line 1
View::_evaluate() - CORECake/View/View.php, line 921
View::_render() - CORECake/View/View.php, line 884
View::element() - CORECake/View/View.php, line 422
include - APP/View/News/index.ctp, line 9
View::_evaluate() - CORECake/View/View.php, line 921
View::_render() - CORECake/View/View.php, line 884
View::render() - CORECake/View/View.php, line 476
Controller::render() - CORECake/Controller/Controller.php, line 956
Dispatcher::_invoke() - CORECake/Routing/Dispatcher.php, line 193
Dispatcher::dispatch() - CORECake/Routing/Dispatcher.php, line 161
[main] - APP/webroot/index.php, line 98

And the sidebar element:

requestAction('/sidebar/' . $sidebar, array('return', 
'bare' => false)); ?>

Should I just define FULL_BASE_URL?

-- 
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 post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: Facebook PHP SDK, session_regenerate_id

2012-07-11 Thread Miles J
Could the order of session creation be the problem? Make sure the FB 
sessions are being created after Cakes.

On Wednesday, July 11, 2012 9:03:41 PM UTC-7, Afif Abu Bakar wrote:
>
> Hi all.
>
> I'm having some problems working with authenticate users that login via 
> Facebook. Users cannot login to the system because of session_regenerate_id 
> error.
> Do you guys know why it is happens? And how to overcome this problem? I 
> really need help.
>
> Thank you. 
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Manage large multilingual project

2012-07-01 Thread Miles J
One thing I want to point out, is that using keys instead of sentences as 
keys is much easier to manage.

msgid "welcome.intro"
msgstr "Welcome %s"

Much better than:

msgid "Welcome %s"
msgstr ""

On Saturday, June 9, 2012 5:05:13 AM UTC-7, heohni wrote:
>
> Hi,
>
> I have a project with currently 5 languages and I am using.po files for 
> the translations.
> Now the project is live and running and I  have to update the site content 
> (static text) and have to include the translations.
>
> Right now I feel the work extremely inefficient as I have to replace the 
> text within my template file and have to replace the msgid in the po files 
> and have to add the translation to msgstr in all po files.
>
> Does anyone has some experience with large multilingual projects and could 
> share  experience about a goof and efficient work flow?
>
> Thanks and kind regards!
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Why using HTML->link instead of manually writing an anchor text ?

2012-07-01 Thread Miles J
http://milesj.me/blog/read/end-html-helper

On Saturday, June 30, 2012 6:38:36 PM UTC-7, Marcelo Custódio wrote:
>
> Isn't it much slower concerning development time ?
>
> What are the advantages of of HTML->link ?
>
> Thanks !
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP Image Upload and Remote Delete

2012-06-27 Thread Miles J
So the images on B are on its own local file system?

The only real solution is to make some kind of API call from A using curl 
that posts to B telling it to delete a certain file.

Or I would suggest moving everything to Amazon S3.

On Monday, June 25, 2012 7:39:16 AM UTC-7, GerarD wrote:
>
> Hi there...
>
> Right now, I have two system using CakePHP on two different servers. 
> System A, is on a local server, while System B is hosted remotly. I need to 
> upload an image in System B and be able to see it on System A. I managed to 
> do this using http://milesj.me/code/cakephp/uploader uploader component, 
> works like a charm. 
>
> Now, the problem is that in some point, I need A to delete that image from 
> B after doing something on my controller. I have no idea how to do this, 
> because there is no way to call an action controller of B from A.
>
> Any ideas.?
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CMS with cakephp

2012-06-27 Thread Miles J
Just use Croogo

http://croogo.org/

On Wednesday, June 27, 2012 8:25:25 PM UTC-7, Mr. Manager wrote:
>
> Dear All,
>
> If everyone between cakephp 1.3 and cakephp 2x. which one is better if I 
> want to make website with unlimited content management system.
>
> Please let me know if anyone know about this.
>
> Sincerely Yours,
> Mr. Manager,
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Notice: Constant CAKE_CORE_INCLUDE_PATH already defined in

2012-06-02 Thread Miles J
Search and find out where its being defined twice.

On Saturday, June 2, 2012 8:55:14 AM UTC-7, alvin567 wrote:
>
> Notice: Constant CAKE_CORE_INCLUDE_PATH already defined in 
>
> how do I cancel out this error?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Serialization of 'Closure' is not allowed

2012-05-19 Thread Miles J
MThomas, the error pretty much says what you want to know.

You cant serialize closures, so where are you using a closure?

On Friday, May 18, 2012 9:14:29 AM UTC-7, MThomas wrote:
>
> Hi! 
>
> First of all I'm pretty new to CakePHP. Although it sometimes gives me 
> headaches I love. 
>
> On problem keeps coming up and I really do not know what it is caused 
> by. The following error keeps popping up: "[Exception] Serialization 
> of 'Closure' is not allowed". I'm using a Amazon EC2 and Ubuntu is 
> installed. 
>
> Any thoughts on this matter? 
>
> The error in more detail: 
>
> Fatal Error (256): [Exception] Serialization of 'Closure' is not 
> allowed 
> #0 /var/www/example.com/htdocs/cakephp/lib/Cake/Cache/Engine/ 
> FileEngine.php(0): serialize() 
> #1 
> /var/www/example.com/htdocs/cakephp/lib/Cake/Cache/Cache.php(295):
>  
>
> FileEngine->write('cake_toolbar_ca...', Array, 14400) 
> #2 /var/www/example.com/htdocs/cakephp/app/Plugin/debug_kit/Controller/ 
> Component/ToolbarComponent.php(437):
>  
>
> Cache::write('toolbar_cachee5...', Array, 'debug_kit') 
> #3 /var/www/example.com/htdocs/cakephp/app/Plugin/debug_kit/Controller/ 
> Component/ToolbarComponent.php(309):
>  
> ToolbarComponent- 
> >_saveState(Object(CakeErrorController), Array) 
> #4 [internal function]: ToolbarComponent- 
> >beforeRender(Object(CakeErrorController)) 
> #5 /var/www/example.com/htdocs/cakephp/lib/Cake/Utility/ 
> ObjectCollection.php(130): call_user_func_array(Array, Array) 
> #6 [internal function]: ObjectCollection->trigger(Object(CakeEvent)) 
> #7 /var/www/example.com/htdocs/cakephp/lib/Cake/Event/ 
> CakeEventManager.php(246): call_user_func(Array, Object(CakeEvent)) 
> #8 /var/www/example.com/htdocs/cakephp/lib/Cake/Controller/ 
> Controller.php(924): CakeEventManager->dispatch(Object(CakeEvent)) 
> #9 /var/www/example.com/htdocs/cakephp/lib/Cake/Error/ 
> ExceptionRenderer.php(285): Controller->render('error500') 
> #10 /var/www/example.com/htdocs/cakephp/lib/Cake/Error/ 
> ExceptionRenderer.php(267): ExceptionRenderer- 
> >_outputMessageSafe('error500') 
> #11 /var/www/example.com/htdocs/cakephp/lib/Cake/Error/ 
> ExceptionRenderer.php(187): ExceptionRenderer- 
> >_outputMessage('missingBehavior') 
> #12 [internal function]: ExceptionRenderer- 
> >_cakeError(Object(MissingBehaviorException)) 
> #13 /var/www/example.com/htdocs/cakephp/lib/Cake/Error/ 
> ExceptionRenderer.php(165): call_user_func_array(Array, Array) 
> #14 /var/www/example.com/htdocs/cakephp/lib/Cake/Error/ 
> ErrorHandler.php(127): ExceptionRenderer->render() 
> #15 [internal function]: 
> ErrorHandler::handleException(Object(MissingBehaviorException)) 
> #16 {main} [CORE/Cake/Error/ErrorHandler.php, line 136] 
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Wrong request method (2.1.2)

2012-05-04 Thread Miles J
I believe it has changed so if you are doing an edit it sends a PUT, else 
if you are doing a create it sends a POST.

I ran into that same issue today.

On Friday, May 4, 2012 1:17:31 PM UTC-7, SigalX wrote:
>
> I've seen that cake had sent "PUT" in the "_method" variable but it was 
> POST and I got "PUT" from $this->request->method() in the controller as 
> well. How to get truly request method via cake?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem with Miles J. Uploader plugin and image name

2012-05-04 Thread Miles J
What version are you using?

On Thursday, May 3, 2012 9:49:21 AM UTC-7, Xoubaman wrote:
>
> This is my behavior setup:
>
> public $actsAs = array(
> 'Uploader.Attachment' => array(
> 'image_upload' => array(
> 'name'=> 'formatFileName', 
> 'baseDir'=> IMAGES,
> 'uploadDir'=> 'writers',
> 'dbColumn'=> 'image', 
> 'maxNameLength'=> 200, 
> 'overwrite' => true,
> 'transforms' => array(
> array('method' => 'resize', 'width' => IMAGE_WRITER_H, 
> 'height' => IMAGE_WRITER_H, 'dbColumn' => 'image', 'append' => false),
> array('method' => 'resize', 'width' => 
> IMAGE_WRITER_THUMB_W, 'height' => IMAGE_WRITER_THUMB_W, 'dbColumn' => 
> 'thumb', 'append' => '_thumb')
> )
> )
> )
> );
>
> The problem is that the saved image in 'image' column is "bowser-1.png", 
> instead the expected "bowser.png".
>
> The thumb works fine and is named "bowser_thumb.png" as expected.
>
> Any idea?
>
>
On Thursday, May 3, 2012 9:49:21 AM UTC-7, Xoubaman wrote:
>
> This is my behavior setup:
>
> public $actsAs = array(
> 'Uploader.Attachment' => array(
> 'image_upload' => array(
> 'name'=> 'formatFileName', 
> 'baseDir'=> IMAGES,
> 'uploadDir'=> 'writers',
> 'dbColumn'=> 'image', 
> 'maxNameLength'=> 200, 
> 'overwrite' => true,
> 'transforms' => array(
> array('method' => 'resize', 'width' => IMAGE_WRITER_H, 
> 'height' => IMAGE_WRITER_H, 'dbColumn' => 'image', 'append' => false),
> array('method' => 'resize', 'width' => 
> IMAGE_WRITER_THUMB_W, 'height' => IMAGE_WRITER_THUMB_W, 'dbColumn' => 
> 'thumb', 'append' => '_thumb')
> )
> )
> )
> );
>
> The problem is that the saved image in 'image' column is "bowser-1.png", 
> instead the expected "bowser.png".
>
> The thumb works fine and is named "bowser_thumb.png" as expected.
>
> Any idea?
>
>
On Thursday, May 3, 2012 9:49:21 AM UTC-7, Xoubaman wrote:
>
> This is my behavior setup:
>
> public $actsAs = array(
> 'Uploader.Attachment' => array(
> 'image_upload' => array(
> 'name'=> 'formatFileName', 
> 'baseDir'=> IMAGES,
> 'uploadDir'=> 'writers',
> 'dbColumn'=> 'image', 
> 'maxNameLength'=> 200, 
> 'overwrite' => true,
> 'transforms' => array(
> array('method' => 'resize', 'width' => IMAGE_WRITER_H, 
> 'height' => IMAGE_WRITER_H, 'dbColumn' => 'image', 'append' => false),
> array('method' => 'resize', 'width' => 
> IMAGE_WRITER_THUMB_W, 'height' => IMAGE_WRITER_THUMB_W, 'dbColumn' => 
> 'thumb', 'append' => '_thumb')
> )
> )
> )
> );
>
> The problem is that the saved image in 'image' column is "bowser-1.png", 
> instead the expected "bowser.png".
>
> The thumb works fine and is named "bowser_thumb.png" as expected.
>
> Any idea?
>
>
On Thursday, May 3, 2012 9:49:21 AM UTC-7, Xoubaman wrote:
>
> This is my behavior setup:
>
> public $actsAs = array(
> 'Uploader.Attachment' => array(
> 'image_upload' => array(
> 'name'=> 'formatFileName', 
> 'baseDir'=> IMAGES,
> 'uploadDir'=> 'writers',
> 'dbColumn'=> 'image', 
> 'maxNameLength'=> 200, 
> 'overwrite' => true,
> 'transforms' => array(
> array('method' => 'resize', 'width' => IMAGE_WRITER_H, 
> 'height' => IMAGE_WRITER_H, 'dbColumn' => 'image', 'append' => false),
> array('method' => 'resize', 'width' => 
> IMAGE_WRITER_THUMB_W, 'height' => IMAGE_WRITER_THUMB_W, 'dbColumn' => 
> 'thumb', 'append' => '_thumb')
> )
> )
> )
> );
>
> The problem is that the saved image in 'image' column is "bowser-1.png", 
> instead the expected "bowser.png".
>
> The thumb works fine and is named "bowser_thumb.png" as expected.
>
> Any idea?
>
>
On Thursday, May 3, 2012 9:49:21 AM UTC-7, Xoubaman wrote:
>
> This is my behavior setup:
>
> public $actsAs = array(
> 'Uploader.Attachment' => array(
> 'image_upload' => array(
> 'name'=> 'formatFileName', 
> 'baseDir'=> IMAGES,
> 'uploadDir'=> 'writers',
> 'dbColumn'=> 'image', 
> 'maxNameLength'=> 200, 
> 'overwrite' => true,
> 'transforms' => array(
> array('method' => 'resize', 'width' => IMAGE_WRITER_H, 
> 'height' 

Re: Problem with Miles J. Uploader plugin and image name

2012-05-03 Thread Miles J
Are you trying to overwrite the original image with the resized one?

Try adding overwrite = true to the resize transformation.

On Thursday, May 3, 2012 9:49:21 AM UTC-7, Xoubaman wrote:
>
> This is my behavior setup:
>
> public $actsAs = array(
> 'Uploader.Attachment' => array(
> 'image_upload' => array(
> 'name'=> 'formatFileName', 
> 'baseDir'=> IMAGES,
> 'uploadDir'=> 'writers',
> 'dbColumn'=> 'image', 
> 'maxNameLength'=> 200, 
> 'overwrite' => true,
> 'transforms' => array(
> array('method' => 'resize', 'width' => IMAGE_WRITER_H, 
> 'height' => IMAGE_WRITER_H, 'dbColumn' => 'image', 'append' => false),
> array('method' => 'resize', 'width' => 
> IMAGE_WRITER_THUMB_W, 'height' => IMAGE_WRITER_THUMB_W, 'dbColumn' => 
> 'thumb', 'append' => '_thumb')
> )
> )
> )
> );
>
> The problem is that the saved image in 'image' column is "bowser-1.png", 
> instead the expected "bowser.png".
>
> The thumb works fine and is named "bowser_thumb.png" as expected.
>
> Any idea?
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Best IDE for CakePHP 2.1

2012-04-11 Thread Miles J
Most IDEs all do the same thing, so how did none of those meet your needs?

For reference, I use PHPStorm.

On Wednesday, April 11, 2012 10:23:46 PM UTC-7, Reza Talamkhani wrote:
>
> Hi,
> I Need an IDE for CakePHP 2.1 that integerated with cake console and 
> suggestion...
> I test eclipse, netbeans & Codelobster but it did not meet any...
>
> Please help me to choose the best IDE. 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: mysql gone away

2012-04-03 Thread Miles J
Are these PDFs being created in the CLI/cron? If not, they should be.

On Tuesday, April 3, 2012 12:54:27 AM UTC-7, Sandy wrote:
>
> HI There, 
>
> I'm facing a big problem with cakephp 1.2 
>
> first one is that cakephp is creating connection with mysql using 
> mysql_pconnect, but in database.php I've set "persistent" to false. 
> For this I've changed core files and change mysql_pconnect to 
> mysql_connect. I know it is not a good idea. could any body suggest me 
> a better one, as mysql is not changing the connection type from 
> database.php 
>
> second one, I'm creating pdf and excel reports using html2pdf library, 
> while creating small reports it works fine, But when a report with 
> large data is provided it takes about 40+ minutes to created the 
> report in this case my report get created but after creating the 
> report, I need to send a email alert to users about the report, for 
> which I've to pick some data from database and at this time I get an 
> error 
> "Mysql gone away 2006" 
>
> I've increase 
>
> mysql_wait_timeout 
>
> max_allowed_packet 
>
> but not succeeded. 
>
> Could any one suggest me what to do to figure out this problem. 
>
> Thanks in advance

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Using Cupcake Forum with CakePHP 2.0

2012-04-02 Thread Miles J
Version 3.0 of the forum is for CakePHP 2.0.

https://github.com/milesj/cake-forum

For future reference, you can check the compatibility section in the readme.

On Monday, April 2, 2012 9:17:33 AM UTC-7, WhyNotSmile wrote:
>
> I'm trying to integrate the Cupcake forum (version 2.3) with my app, 
> which is written in Cake 2.0. 
>
> Setting up the db etc was fine, but then it couldn't seem to find any 
> of the classes and so on.  I figured maybe it needed to follow Cake 
> 2.0 conventions, so I changed file and folder names to fit with that. 
> I *think* I've changed all of them, but I'm now getting 
>
> Fatal error: Class 'ClassRegistry' not found 
>
> Am I along the right lines in trying to rename things, or is there a 
> better way to do all of this? 
>
> Or, is there a better forum to use for Cake 2.0? 
>
> Thanks!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Image Upload

2012-04-01 Thread Miles J
You can't save files with AJAX. Are you using a JS script that's using the 
iframe hack?

On Saturday, March 31, 2012 12:41:41 PM UTC-7, aSh!Q's wrote:
>
> I wanted to upload a picture of the user via ajax. I checked the media 
> plugin but found it a little bit hard seeing all those instructions. Is 
> there any better way ? What is the best way ?
> I was thinking of using the submit option of the jshelper . And i created 
> the following page. 
>
>
>
> 
> echo $this->Form->create('Photo',array('type'=>'file'));
> echo $this->Form->file('Photo.image');
> echo $this->Js->Submit('Add 
> Picture',array('url'=>'/users/savepicture','class'=>'button',
> 'before'=>$this->Js->get('#right-box')->effect('fadeOut') ,
>
> 'success'=>$this->Js->get('#right-box')->effect('fadeIn'),'update'=>'#right-box'
>  ));
> echo $this->Form->end(); 
> echo $this->Js->writebuffer();
> ?>
>
>
> In the controller I tried to debug ($this->data) just to get an 
> understanding of how the file is uploaded . But i see no data being 
> uploaded . The debug returns an empty array . Help me ??
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cost of cakePHP2 developers

2012-03-29 Thread Miles J
Really depends on location.

I've seen wages ranging from $30 an hour up to $80 an hour.

On Wednesday, March 28, 2012 3:03:47 AM UTC-7, DerekGardiner wrote:
>
> Does anyone know what the typical hourly rate of a cakephp dev (in 
> USD) would be? For a junior, intermediate and senior developer?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Controller can't access the Session

2012-03-29 Thread Miles J
On a side note, you are including tons of models.

You don't need to include every model if specific models have associated 
models you can utilize. You should also load models on a per action basis 
using loadModel().

On Sunday, March 18, 2012 5:37:02 PM UTC-7, Felipe Roman wrote:
>
> Hi,
>
> Has someone ever seen only one controller does not access the cake session 
> ?
>
> The session works fine for all controllers except for one specific
> controller. I tried debug the problem but I didn't find the reason.
>
> The controller code:
>
> class ExecutivosController extends AppController {
>
> var $name = 'Executivos';
> var $uses = array('Executivo', 'FormacaoAcademica',
> 'FormacaoComplementar', 'Executivo', 'Empresa', 'Unidade', 'Cargo',
> 'ExecutivoCargo', 'AtuacaoProfissional', 'ExecutivoIdioma', 'Decisao',
> 'Mobilidade', 'PotencialProntidao', 'Arquivo', 'Usuario');
> var $components = array('RequestHandler', 'Email');
>
> function index() {
>
> // Get login information
> $Login = $this->Session->read('Login');
>
> debug($_SESSION);
> debug($Login);
>
> and the others controllers are similar:
>
>  class CargosController extends AppController {
>
> var $name = 'Cargos';
> var $uses = array('Cargo', 'Empresa', 'Unidade', 'Executivo',
> 'RespostaColaboradore');
> var $components = array('RequestHandler', 'Email');
>
> function index() {
> // Le informações de login
> $Login = $this->Session->read('Login');
>
> debug($_SESSION);
> debug($Login);
>
>
> When I access the Cargos controller all session information are
> printed by debug funcion as expected, when I try access the first one
> the Session and $_SESSION is empty. If I reload the second one again
> the session values are still there (it means the session isn't
> erased).
>
> The app_controller.php file:
>
> class AppController extends Controller {
> var $helpers = array('Html', 'Javascript', 'Session', 'Ajax',
> 'Time', 'Form');
>
> function  beforeFilter() {
> //debug($this);
> if (($this->name != "Usuarios") or ($this->action != 'login')){
>
> if($this->Session->read('Login')) {
> } else {
> $this->Session->setFlash(__('Efetue o login para
> acessar o sistema', true));
> $this->redirect(array('controller' => 'usuarios',
> 'action' => 'login'));
> }
> }
> }
>
> Has someone have any ideas why the Executivos controller can't access
> the session ?
>
> Thanks
>
> -- 
> Best Regards,
> Felipe Roman
> Phone 55 51 8454 8110
> LinkedIn http://au.linkedin.com/in/feliperoman
>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Is it possible to implement a "no answer" null value on a boolean field?

2012-03-27 Thread Miles J
You shouldn't be using booleans as keys, just use strings.

$options = array('1' => 'yes', '0' => 'no'); 
echo $this->Form->input('music', array('options' => $options, 'empty' => 
'no answer')); 


On Tuesday, March 27, 2012 2:16:28 PM UTC-7, Daniel wrote:
>
> Is it possible to implement a "no answer" null value on a boolean 
> field?  For example this is what I have in the view but it does not 
> work: 
> $options = array(true => 'yes', false => 'no', null => 'no answer'); 
> echo $this->Form->input('music', array('options' => $options, 'empty' 
> => null)); 
>
> Answering 'no' saves ok to the database, but it shows '(no answer)' 
> when editing the record.  And giving 'no answer' does not save a null 
> to the database.  What's the correct way to do this? 
>
> Thanks. 
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: milesj ​cake-auto_login I can't get it working

2012-03-26 Thread Miles J
This doesn't work with AJAX as it uses the beforeRedirect() method callback 
to process logic.

You can save the cookie yourself though: $this->AutoLogin->save($username, 
$password);

-Miles

On Monday, March 26, 2012 5:01:41 AM UTC-7, heohni wrote:
>
> Hi,
>
> I downloaded the version 3.4.
> I added the checkbox echo $this->Form->input('auto_login', array('label' 
> => __('Stay'), 'value' => 1, 'type' => 'checkbox', 'div' => 
> 'checkbox'));
> I added the component to my appController.
>
> But I use a ajax validation for my login popup and it looks like this:
>
> public function login() {
>if($this->request->isAjax()){
>   if ($this->Auth->login()) {
>// log last visit
>// return 'OK' to ajax call
>   }else{
>   // validation failed
>
> I don't understand at what point the component is called and does its work 
> to create the cookie?
>
> What do i miss?
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Where to save utility routines

2012-03-22 Thread Miles J
If you also need to use it outside of the view, you can just create a 
static class and include it, then use the methods statically in the view.

SomeClass::staticMethod().

On Wednesday, March 21, 2012 12:01:20 PM UTC-7, Graham wrote:
>
> Dear all, still new to CakePHP but learning all the time.
>
> I have a small PHP utility routine for ​formatting text that I want to be 
> able to call from my views. Where should I save it so that it is available 
> to all views?
>
> Thanks for your thoughts.
>
> Graham
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Upgrading to 2.1

2012-03-16 Thread Miles J
You should probably do the 1.x -> 2.0 first then the 2.0 -> 2.1.

http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html
http://book.cakephp.org/2.0/en/appendices/2-1-migration-guide.html

On Friday, March 16, 2012 7:53:39 AM UTC-7, rainerpl wrote:
>
> Hi 
>
> Could somebody point me to a tutorial on how to upgrade from 2.0 to 
> 2.1 
>
> I searched the cakePHP site and didnt find any instructions. The only 
> thing i could find was for version 1.2 or so, and it said that 
> replacing the whole lib folder with newer version would pretty much do 
> it. 
> But there is a big difference between 1.2 and 2.x so things have 
> probably changed. 
>
> Thank you.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: recursive attr in Model not worked in cake2.1

2012-03-14 Thread Miles J
Wasn't recursive deprecated? Use the containable behavior.

On Monday, March 12, 2012 6:54:17 PM UTC-7, piku wrote:
>
> I just used cake2.1 ,but Model section when i try to use $this- 
> >Model(alias name)->recursive =1 
> it did not work , but when i used same code in cake 1.3 it works , 
> could any one say is it new bug in cake . 
>
> @cakeLover

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How to remove a field from $this->request->data so that it is not saved?

2012-03-14 Thread Miles J
Or you can just use the whitelist in Model::save($this->request->data, 
true, array('fieldName')).

On Wednesday, March 14, 2012 10:15:30 AM UTC-7, Daniel wrote:
>
> How do I remove a field from $this->request->data so that it is not 
> saved / touched on the database when doing a $this->User->save($this- 
> >request->data) ? 
>
> Thanks.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: @Miles J - Uploader

2012-03-11 Thread Miles J
Awesome :]

Glad you got it working.

On Saturday, March 10, 2012 11:31:37 PM UTC-8, CrotchFrog wrote:
>
> @Miles: 
>
> I have it working as expected now. 
> The problem was that I was inadvertently supplying delete() with an array. 
> I was using named keys in the array and Cake's Core Model.php read() 
>
> if (is_array($this->id)) {
> $id = $this->id[0];
> }
>
> was failing with an undefined index [0]. I sorted out the array issue and 
> looped through the delete and it's now working perfectly. 
> Uploader is a huge time saver and I couldn't be any happier with it ;)
>
> Tanks a bunch Miles. 
>
> Regards, 
> ED 
>
> On Saturday, March 10, 2012 1:52:29 AM UTC-5, Miles J wrote:
>>
>> Does the debug() statement appear when doing a model delete?
>>
>> On Friday, March 9, 2012 9:25:09 PM UTC-8, CrotchFrog wrote:
>>>
>>> It's correctly generating the path and works fine when manually deleting 
>>> with Uploader. 
>>>
>>> On Friday, March 9, 2012 1:30:31 PM UTC-5, Miles J wrote:
>>>>
>>>> Can you throw some debug($path)'s in Uploader.delete() to see if its 
>>>> generating the correct absolute path.
>>>>
>>>> On Thursday, March 8, 2012 9:38:05 PM UTC-8, CrotchFrog wrote:
>>>>>
>>>>> Using Cake 2.1 & Uploader 3.3
>>>>>
>>>>> 'Uploader.Attachment' => array(
>>>>> 'fileName' => array(
>>>>> 'name' => 'generateFilename', 
>>>>> 'baseDir' => '', 
>>>>> 'uploadDir' => 'img/artist', 
>>>>> 'dbColumn' => 'path',
>>>>> 'importFrom' => '', 
>>>>> 'defaultPath' => '', 
>>>>> 'maxNameLength' => 30, 
>>>>> 'overwrite' => true, 
>>>>> 'stopSave' => true, 
>>>>> 'allowEmpty' => false, 
>>>>> 'transforms' => array(), 
>>>>> 's3' => array(), 
>>>>> 'metaColumns' => array( 
>>>>> 'ext' => 'ext',
>>>>> 'type' => 'type',
>>>>> 'size' => 'size',
>>>>> 'group' => 'group',
>>>>> 'width' => '',
>>>>> 'height' => '',
>>>>> 'filesize' => 'filesize',
>>>>> 'name' => 'name'
>>>>> )
>>>>> )
>>>>> )
>>>>>
>>>>> public $belongsTo = array(
>>>>> 
>>>>> 'Artist' => array(
>>>>> 'className' => 'Artist',
>>>>> 'foreignKey' => 'artist_id',
>>>>> 'conditions' => '',
>>>>> 'fields' => '',
>>>>> 'order' => ''
>>>>> )
>>>>> );
>>>>>
>>>>> - ED 
>>>>>
>>>>> On Thursday, March 8, 2012 3:56:50 AM UTC-5, CrotchFrog wrote:
>>>>>>
>>>>>> @Miles, 
>>>>>>
>>>>>> With the newest version of your uploader, when deleting a row from 
>>>>>> the db the corresponding file should be deleted locally. 
>>>>>>
>>>>>> I have everything else working great except for file deletion. 
>>>>>>
>>>>>> What am I overlooking? 
>>>>>>
>>>>>> Regards, 
>>>>>> ED 
>>>>>>
>>>>>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: @Miles J - Uploader

2012-03-09 Thread Miles J
Does the debug() statement appear when doing a model delete?

On Friday, March 9, 2012 9:25:09 PM UTC-8, CrotchFrog wrote:
>
> It's correctly generating the path and works fine when manually deleting 
> with Uploader. 
>
> On Friday, March 9, 2012 1:30:31 PM UTC-5, Miles J wrote:
>>
>> Can you throw some debug($path)'s in Uploader.delete() to see if its 
>> generating the correct absolute path.
>>
>> On Thursday, March 8, 2012 9:38:05 PM UTC-8, CrotchFrog wrote:
>>>
>>> Using Cake 2.1 & Uploader 3.3
>>>
>>> 'Uploader.Attachment' => array(
>>> 'fileName' => array(
>>> 'name' => 'generateFilename', 
>>> 'baseDir' => '', 
>>> 'uploadDir' => 'img/artist', 
>>> 'dbColumn' => 'path',
>>> 'importFrom' => '', 
>>> 'defaultPath' => '', 
>>> 'maxNameLength' => 30, 
>>> 'overwrite' => true, 
>>> 'stopSave' => true, 
>>> 'allowEmpty' => false, 
>>> 'transforms' => array(), 
>>> 's3' => array(), 
>>> 'metaColumns' => array( 
>>> 'ext' => 'ext',
>>> 'type' => 'type',
>>> 'size' => 'size',
>>> 'group' => 'group',
>>> 'width' => '',
>>> 'height' => '',
>>> 'filesize' => 'filesize',
>>> 'name' => 'name'
>>> )
>>> )
>>> )
>>>
>>> public $belongsTo = array(
>>> 
>>> 'Artist' => array(
>>> 'className' => 'Artist',
>>> 'foreignKey' => 'artist_id',
>>> 'conditions' => '',
>>> 'fields' => '',
>>> 'order' => ''
>>> )
>>> );
>>>
>>> - ED 
>>>
>>> On Thursday, March 8, 2012 3:56:50 AM UTC-5, CrotchFrog wrote:
>>>>
>>>> @Miles, 
>>>>
>>>> With the newest version of your uploader, when deleting a row from the 
>>>> db the corresponding file should be deleted locally. 
>>>>
>>>> I have everything else working great except for file deletion. 
>>>>
>>>> What am I overlooking? 
>>>>
>>>> Regards, 
>>>> ED 
>>>>
>>>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: @Miles J - Uploader

2012-03-09 Thread Miles J
Can you throw some debug($path)'s in Uploader.delete() to see if its 
generating the correct absolute path.

On Thursday, March 8, 2012 9:38:05 PM UTC-8, CrotchFrog wrote:
>
> Using Cake 2.1 & Uploader 3.3
>
> 'Uploader.Attachment' => array(
> 'fileName' => array(
> 'name' => 'generateFilename', 
> 'baseDir' => '', 
> 'uploadDir' => 'img/artist', 
> 'dbColumn' => 'path',
> 'importFrom' => '', 
> 'defaultPath' => '', 
> 'maxNameLength' => 30, 
> 'overwrite' => true, 
> 'stopSave' => true, 
> 'allowEmpty' => false, 
> 'transforms' => array(), 
> 's3' => array(), 
> 'metaColumns' => array( 
> 'ext' => 'ext',
> 'type' => 'type',
> 'size' => 'size',
> 'group' => 'group',
> 'width' => '',
> 'height' => '',
> 'filesize' => 'filesize',
> 'name' => 'name'
> )
> )
> )
>
> public $belongsTo = array(
> 
> 'Artist' => array(
> 'className' => 'Artist',
> 'foreignKey' => 'artist_id',
> 'conditions' => '',
> 'fields' => '',
> 'order' => ''
> )
> );
>
> - ED 
>
> On Thursday, March 8, 2012 3:56:50 AM UTC-5, CrotchFrog wrote:
>>
>> @Miles, 
>>
>> With the newest version of your uploader, when deleting a row from the db 
>> the corresponding file should be deleted locally. 
>>
>> I have everything else working great except for file deletion. 
>>
>> What am I overlooking? 
>>
>> Regards, 
>> ED 
>>
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: @Miles J - Uploader

2012-03-08 Thread Miles J
File deletion during row deletion works fine in my test cases.

What versions are you using? (I haven't touched file deletion in a long 
time)
Whats your behavior settings look like?
What type of association? Or is it direct?

On Thursday, March 8, 2012 12:56:50 AM UTC-8, CrotchFrog wrote:
>
> @Miles, 
>
> With the newest version of your uploader, when deleting a row from the db 
> the corresponding file should be deleted locally. 
>
> I have everything else working great except for file deletion. 
>
> What am I overlooking? 
>
> Regards, 
> ED 
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Undefined controller: Controller!

2012-03-08 Thread Miles J
Is there a reason why you are calling redirect() twice?

On Thursday, March 8, 2012 8:08:39 AM UTC-8, muka wrote:
>
>  Hi,
> I got a strange behaviour ajax-sending a form.
> In controller the record is saved correctly but I get a 404 response 
> withᅵ "Missing Controller, Error: Controller could not be found."
>
> This happens calling:
> - $this->redirect( $this->referer() ); 
> - $this->redirect( array( "controller" => "apples", "action" => "index" ) 
> ); 
> but works with:
> - $this->redirect( array( "action" => "index" ) ); 
>
> Following the stack trace I found that the $request passed to 
> Dispatcher->dispatch() contains empty values, causing probably the error.
> May be a bug somewhere in the process of rendering the ajax response?
>
> Thanks in advance,
> Luca
>
> Stack Trace:
>
>- CORE/Cake/Core/Object.php line 102 → 
>Dispatcher->dispatch(CakeRequest, CakeResponse, array) 
>- CORE/Cake/Controller/Component/RequestHandlerComponent.php line 243 
>→ Object->requestAction(string, array) 
>- [internal function] → 
>RequestHandlerComponent->beforeRedirect(ApplesController, string, null, 
>boolean) 
>- CORE/Cake/Utility/ObjectCollection.php line 130 → 
>call_user_func_array(array, array) 
>- [internal function] → ObjectCollection->trigger(CakeEvent) 
>- CORE/Cake/Event/CakeEventManager.php line 245 → 
>call_user_func(array, CakeEvent) 
>- CORE/Cake/Controller/Controller.php line 737 → 
>CakeEventManager->dispatch(CakeEvent) 
>- APP/Controller/ContractsController.php line 129 → 
>Controller->redirect(string) 
>- [internal function] → ContractsController->edit(string) 
>- CORE/Cake/Controller/Controller.php line 484 → 
>ReflectionMethod->invokeArgs(ContractsController, array) 
>- CORE/Cake/Routing/Dispatcher.php line 104 → 
>Controller->invokeAction(CakeRequest) 
>- CORE/Cake/Routing/Dispatcher.php line 86 → 
>Dispatcher->_invoke(ContractsController, CakeRequest, CakeResponse) 
>- APP/webroot/index.php line 97 → Dispatcher->dispatch(CakeRequest, 
>CakeResponse) 
>
> 

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake PHP (Bug even still exists in cake php2)

2012-03-08 Thread Miles J
I don't quite understand OP.

On Thursday, March 8, 2012 6:40:15 AM UTC-8, Phil wrote:
>
> Bad programming by cake php here.  This bug still exists in version 
> 2.  Why does it rely on a css file existing?  A lot of people will 
> alter the default template first (removing the default cake stuff), 
> then when they revisit the home page, this error shows incorrectly. 
> There should be a php conditional around this rather than assuming a 
> css file has been included which may or may not be there.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How to set up Debug Kit

2012-03-06 Thread Miles J
It seems like you should understand basic web development and PHP first.

On Tuesday, March 6, 2012 12:01:59 PM UTC-8, kalai wrote:
>
> Hi when i am Setting up Debugkit, 
>
> i came through this "set the debug mode to at least 1." 
>
> I DON"T no how to set up debug mode to at least 1 
>
>
> Can any one out there help me...

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Date out of the V2.1 Stable

2012-02-29 Thread Miles J
Release candidates for the most part wont change much from the stable 
release. The only differences would be bug fixes, so feel free to use it.

On Tuesday, February 28, 2012 8:33:55 AM UTC-8, fitoussi...@gmail.com wrote:
>
> Hi all, 
>
> I currently work in a web agency and we wonder, when the stable 
> version of 2.1 will come out. For now V2.1 R.C 
> We will work on big projects and big change apparently will be made. 
>
> Thank you in advance for your to answer.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Using char(36) as a uuid

2012-02-29 Thread Miles J
Whats the reason for disliking auto-incrementing numbers? Its probably the 
best thing about databases.

On Wednesday, February 29, 2012 6:53:38 AM UTC-8, Ighor Martins wrote:
>
> Hello,
>
> I was thinking about the use of integer as primary key of the table or use 
> a char(36) as UUID in the entire project,
> What I dont like about the integer, is the auto increment number, So I 
> decided to use char(36) 'cause cake automatically fill it with an UUID, but 
> I dont know if this can slow down the search in DB.
>
> So, anyone who used this before, please tell me about that.
> Is that right to use this in tables like: Users, Cars, Categories?
>
>
> Thanks.
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How to handle FILE input type when saving form information?

2012-02-24 Thread Miles J
Use one of the many file uploading plugins out there.

Or just use copy() or move_uploaded_file().

On Feb 24, 7:57 am, "reynie...@gmail.com"  wrote:
> Hi:
> I'm having some problems handling file uploads and database saving. I have
> a table where I need to store the route where uploaded files are saved but
> not know how to achieve this. I found 
> thishttp://cakebaker.42dh.com/2006/04/15/file-upload-with-cakephp/ and I'm
> trying to adjust my code to fit the requirements. Now my code is this one:
>
> public function add() {
> if ($this->request->is('post') &&
> is_uploaded_file($this->request->data['Information']['picture']['tmp_name']))
> {
>  // Handling file uploads
> $fileData =
> fread(fopen($this->request->data['Information']['picture']['tmp_name'],
> "r", $this->request->data['Information']['picture']['size']));
>  $this->data['Information']['name'] =
> $this->request->data['Information']['picture']['name'];
>  $this->Information->create();
> if ($this->Information->saveAll($this->request->data)) {
>  $this->Session->setFlash(__('The information has been saved'),
> 'flash_success');
> $this->redirect(array('action' => 'index'));
>  } else {
> $this->Session->setFlash(__('The information could not be saved. Please,
> try again.'), 'flash_error');
>  }}
>
> $countries = $this->Information->Country->find('list');
>  $this->set(compact('countries'));
>
> }
>
> and have two questions around it: how to setup where uploaded files goes?
> how to add this route to query? I mean for save the route in my DB
> Any advice or help?
> Cheers
> Ing. Reynier Pérez Mirahttp://reynierpm.site90.com/

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: HtmlHelper::div close tag?

2012-02-21 Thread Miles J
The only real use for generating HTML with the helper is when you are
packaging markup from within a helper. Just manually write it in the
view.

On Feb 21, 7:20 am, Jeremy Burns | Class Outfit
 wrote:
> I went down the whole Html->tag route once and then methodically went through 
> and unpicked it; it just didn't make sense in 99.9% of all instances.
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 21 Feb 2012, at 15:16:09, jeremyharris wrote:
>
>
>
>
>
>
>
> > The reason is because $text is empty. HtmlHelper::div uses HtmlHelper::tag 
> > which documents that it will only print the starting tag if no text is 
> > within the tag. I personally don't like this behavior. That's why you'll 
> > see things like this in baked code
>
> > echo $this->Html->tag('div', $post['Post']['name'].' ');
>
> > A   is appended just in case the value is empty, so to make sure it 
> > includes a closing tag. So at the very least you'll need something in there.
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Different frontend and backend controllers

2012-02-03 Thread Miles J
If I recall correctly, controllers within folders support was removed
in 2.x to encourage the use of plugins.

Someone correct me if I am wrong.

On Feb 3, 7:45 am, Stephen  wrote:
> Sounds like a good set up, I don't suppose you have an open source copy of
> the admin system you use for 1.x? I wouldn't mind trying to implement it
> into 2.x (but 1.3 may work)
>
> Cheers :)
>
> On 3 February 2012 12:11, Thaissa Mendes  wrote:
>
>
>
>
>
>
>
>
>
> > Yes, using an AdminController can prevent duplicate code. My backend
> > controllers would almost always have at least "index", "add", "edit"
> > and "delete" methods. Those methods, created on AdminController, let
> > me have on my backend controllers only any extra methods I would need.
> > Creating add/edit/delete/index methods over and over seems to me a
> > waste of time.
>
> > Currently, using my 1.x modification, when I'm creating a backend
> > module, I just create the table, create an almost empty backend
> > controller, and that's it. Of course there are cases which I need some
> > extra methods (such as "activate" or "show"), but the default actions
> > are already working.
>
> > I also created "beforeDelete", "afterSave" and some other methods to
> > be able to set anything before the AdminController saves/deletes
> > something, or after saving/deleting.
>
> > Anyway, after some years using that way, I really prefer to change
> > Cake's core again, or keep using 1.x, than stop using that way.
>
> > On Fri, Feb 3, 2012 at 5:03 AM, Stephen 
> > wrote:
> > > I always assumed it was much better to use a prefix than to separate your
> > > controllers or possibly duplicate code?
>
> > > Using the AdminController extension (which I assume extends
> > AppController?),
> > > can this prevent duplicate code and what are the benefits if you don't
> > mind
> > > me asking?
>
> > > Kind Regards
> > >  Stephen
>
> > > --
> > > Our newest site for the community: CakePHP Video Tutorials
> > >http://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > > others with their CakePHP related questions.
>
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this
> > group at
> > >http://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php
>
> --
> Kind Regards
>  Stephen
>
>  http://www.ninjacodermonkey.co.uk

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Different frontend and backend controllers

2012-02-02 Thread Miles J
Use plugins. In my projects I have an "admin" plugin, which works
wonderfully and I don't have to deal with prefixes, which I also
dislike.

On Feb 2, 10:05 am, Thaissa Mendes  wrote:
> Depends on how the app is built. I make backend and frontend
> separately, so backend would have list/add/edit/delete methods, and
> frontend only "show" and stuff like that. I have been working like
> that for a few years and never had to duplicate any code.
>
>
>
>
>
>
>
> On Thu, Feb 2, 2012 at 6:59 PM, euromark  wrote:
> > most would argue that it helps to keep it DRY to have all prefixed
> > ones in the same controller
> > in many cases the action is pretty identical, anyway
> > or the views - or both
>
> > On 2 Feb., 18:49, Thaissa Mendes  wrote:
> >> It isn't a solution, but it's a start! Thanks!
>
> >> On Thu, Feb 2, 2012 at 6:07 PM, Tilen Majerle  
> >> wrote:
> >> > just simply extend pathy for controllers with App::build()
> >> > --
> >> > Lep pozdrav, Tilen Majerle
> >> >http://majerle.eu
>
> >> > 2012/2/2 Thaissa Mendes 
>
> >> >> Hi all,
>
> >> >> I've been using CakePHP for 3-4 years, and I just downloaded and
> >> >> started to check the 2.0 version.
>
> >> >> One thing that I didn't like about 1.x version, and apparently didn't
> >> >> change on 2.0, is the prefix routing. IMO, backend and frontend
> >> >> methods on the same controller isn't a good idea. So, on 1.x, I made
> >> >> some changes on the core, allowing me to have a different folder
> >> >> inside controllers directory, called "admin", containing the backend
> >> >> controllers. And all of them extending an "AdminController", where I
> >> >> created a lot of default methods (index, add, edit, etc), which made
> >> >> my life easier.
>
> >> >> Now, the question: is there any way I can keep using two different
> >> >> controllers, with the same name, but different folders, for frontend
> >> >> and backend, on 2.0, without changing Cake's core again?
>
> >> >> Thanks,
>
> >> >> Thaissa.
>
> >> >> --
> >> >> Our newest site for the community: CakePHP Video Tutorials
> >> >>http://tv.cakephp.org
> >> >> Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> >> >> others with their CakePHP related questions.
>
> >> >> To unsubscribe from this group, send email to
> >> >> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> >> >> athttp://groups.google.com/group/cake-php
>
> >> > --
> >> > Our newest site for the community: CakePHP Video Tutorials
> >> >http://tv.cakephp.org
> >> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> >> > others with their CakePHP related questions.
>
> >> > To unsubscribe from this group, send email to
> >> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >> > at
> >> >http://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: creating your custom translate function

2012-01-25 Thread Miles J
Just create a different one, ___() or _(), if it's really that much of
a problem.

On Jan 25, 3:19 pm, AD7six  wrote:
> On Jan 25, 10:55 pm, Tilen Majerle  wrote:
>
> > this is just, like request for new feature, maybe it's cool, maybe not,
> > this will developers say :)
>
> Why would you want to define your own version of that function
>
> AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: redirect doesn't work when controller function is called from JS-function

2012-01-22 Thread Miles J
Well if it is an AJAX call, just do a redirect in the JS within the
response.

location.href = newUrl;

Or

location.reload(true);

To refresh the current page.

On Jan 22, 10:10 am, Tilen Majerle  wrote:
> you are calling POST call via AJAX request, so, you can't use
> $this->redirect() in controller
> from controller method check if was ajax call, if it was, print code below
> in controller:
>
> 
>
> and after print this, use exit or die;
>
> what will this do:
> this will print this meta tag which will redirect with browser to your new
> url, you have to modify your javascript post method, that will handle
> result and display it in browser :)
>
> 
>
> --
> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> 2012/1/22 Tomfox Wiranata 
>
>
>
>
>
>
>
> > Hi everyone,
>
> > I have used redirect a thousand times successfully. but this one is
> > weird.
> > This is my process. User wants to save his data and the system checks
> > if all necessary field are filled out. if so, save the data. if not,
> > give an JS-alert.
>
> > the whole thing works. the alert when data is missing
> > and
> > the saving when the form is complete. cake just wont redirect after
> > saving. here is my code:
>
> > the trigger in my view (the button)
> > 
>
> > echo ' > style="float:left;cursor:pointer;">'."Save".'';
>
> > javascript function in my view:
> > 
>
> > function save()
> > {
> >        var title_content = $('#TitlePopup').val();
>
> >        if (!title_content)
> >                $.pnotify({     pnotify_title: 'Missing Fields.',
> > pnotify_text: 'Please
> > fill out all fields.'});
> >        else
> >                $.post(installFolder + 'books/save', {});
>
> > }
>
> > books_controller:
> > 
>
> > function save()
> > {
>
> > ...some code here for saving the data
>
> > $this->Session->setFlash('saving successful');
> > $this->redirect(array('controller' => 'books', 'action' => 'view',
> > $id));
>
> > }
>
> > the redirect works(!) when i call the controllers save() function
> > directly like:
> > echo $html->link('Save', '/books/save',
> > array('class'=>'small_button'));
>
> > is this some technology thing with no workaround possible? like JS and
> > cakePHP wont work together in this case? or am i missing some
> > fundamentals here?
>
> > appreciate your help :)
>
> > thanks!!
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: java script detection at the time of site load

2012-01-20 Thread Miles J
Always gotta be a smart ass.

Its *not* possible to detect JS with PHP outright. Detecting if a
cookie exists isn't really detecting it, it's a workaround.

On Jan 20, 12:52 am, AD7six  wrote:
> On Jan 19, 7:51 pm, Miles J  wrote:
>
> > Right but I would rather just set a cookie via JS and check it on the
> > PHP side. Same effect.
>
> As you stated previously: Clearly that's impossible

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: java script detection at the time of site load

2012-01-19 Thread Miles J
Right but I would rather just set a cookie via JS and check it on the
PHP side. Same effect.

But now a days, you shouldn't have to worry about the user not having
JS enabled.

On Jan 19, 12:57 am, AD7six  wrote:
> On Jan 18, 10:04 pm, Miles J  wrote:
>
> > You can't detect if JS is enabled via PHP.
>
> You can, however, do something ball-achingly simple like this:
>
> 
>  (function() {
>   var img = document.createElement("img");
>   img.setAttribute("src", "/I/haz/js.gif");
>   document.body.appendChild(img);
>  }());
> 
> 
>  
> 
>
> Route each of those 2 permutations to a controller which e.g. logs the
> result to the session and then returns a 1px gif image; and if you
> really need to know - you know.
>
> AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: java script detection at the time of site load

2012-01-18 Thread Miles J
You can't detect if JS is enabled via PHP.

On Jan 18, 7:28 am, bujanga  wrote:
> https://www.google.com/search?q=javascript+version+check
>
> On Wed, Jan 18, 2012 at 6:52 AM, vaibhav pathak
>
>
>
>
>
>
>
>  wrote:
> > Please any one can tell me how i can detect that java script of
> > browser is on or not in cake cake php?
>
> > Thanks
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How can I run some code only once per day?

2012-01-11 Thread Miles J
@jeremy - Now that is sick. Was trying for so long to cache SQL data
via a behavior but never thought to use a datasource as well. Will
give this a try.

On Jan 11, 1:23 pm, jeremyharris  wrote:
> Cool, hope it works out for you!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem with Security

2012-01-11 Thread Miles J
Just place it in bootstrap so all pages inherit it.

On Jan 11, 2:54 am, euromark  wrote:
> as miles said
> best at the very top of your file
>
>  HERE
>
> On 11 Jan., 03:32, jmail  wrote:
>
>
>
>
>
>
>
> > H. That is strange. Why is that working on other controller for
> > admin?
>
> > Where should I put this App::uses? Can I put this somwhere in
> > AppController?
>
> > I have added that into the login function and now that is working.
>
> > jmail
>
> > On 11 Sty, 03:28, Miles J  wrote:
>
> > > Add this to the top:
>
> > > App::uses('Security', 'Utility');
>
> > > On Jan 10, 6:25 pm, jmail  wrote:
>
> > > > Hi all!
>
> > > > I am preparing some login action in my app. I have made view
>
> > > > <%=$this->Form->create('User', array('action' =>
> > > > 'login','inputDefaults' => array('label' => false,'div' => false)));%>
> > > >                 <%=$this->Form->input('mail', array('type' => 'text', 
> > > > 'label' =>
> > > > 'Email:'));%>
> > > >                 <%=$this->Form->input('pass', array('type' => 
> > > > 'password', 'label' =>
> > > > 'Pass:'));%>
> > > >                 <%=$this->Form->end(array('value' => 'Login', 'label' 
> > > > => 'Login',
> > > > 'class' => 'searchsubmit',  'div' => array('class' => 'floatRight')));
> > > > %>
>
> > > > I have build function in UsersController
>
> > > > class UsersController extends AppController{
>
> > > >         public function login(){
> > > >                 if ($this->request->is('post')) {
> > > >             $user = 
> > > > $this->User->findByMailAndPass($this->request->data["User"]["mail"], 
> > > > Security::hash($this->request->data["User"]
>
> > > > ["pass"], null, true));
> > > >             if ($user === false) {
> > > >                 $this->Session->setFlash('Nieprawid³owe dane
> > > > logowania.');
> > > >                 $this->request->data["User"]["mail"] = '';
> > > >                 $this->request->data["User"]["pass"] = '';
> > > >             } else {
> > > >                 CakeSession::write('user.id', $user["User"]["id"]);
> > > >                 CakeSession::write('user.mail', $user["User"]
> > > > ["mail"]);
> > > >                 $this->redirect(array('controller' => 'users',
> > > > 'action' => 'profile'));
> > > >             }
> > > >         }
> > > >         }
>
> > > >         public function logout(){
> > > >         CakeSession::delete("user");
> > > >         $this->redirect('/');
> > > >         }
>
> > > > }
>
> > > > So. When I go to the HOST/users/login everything is ok, but when I try
> > > > to submit login form I get an error
>
> > > > Fatal error: Class 'Security' not found in
>
> > > > and of course I've got
>
> > > > var $helpers = array('Form', 'Html', 'Session', 'Cycle');
>
> > > > in AppController
>
> > > > Can anyone please help me what should I do?
>
> > > > Please do not tell me to change my login to the Cake model - I need
> > > > that this way done.
>
> > > > For end I will add info tha the same action is working good for admin
> > > > login :(
>
> > > > thank's for tips
>
> > > > regards
>
> > > > jmail- Ukryj cytowany tekst -
>
> > > - Poka¿ cytowany tekst -

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problem with Security

2012-01-10 Thread Miles J
Add this to the top:

App::uses('Security', 'Utility');

On Jan 10, 6:25 pm, jmail  wrote:
> Hi all!
>
> I am preparing some login action in my app. I have made view
>
> <%=$this->Form->create('User', array('action' =>
> 'login','inputDefaults' => array('label' => false,'div' => false)));%>
>                 <%=$this->Form->input('mail', array('type' => 'text', 'label' 
> =>
> 'Email:'));%>
>                 <%=$this->Form->input('pass', array('type' => 'password', 
> 'label' =>
> 'Pass:'));%>
>                 <%=$this->Form->end(array('value' => 'Login', 'label' => 
> 'Login',
> 'class' => 'searchsubmit',  'div' => array('class' => 'floatRight')));
> %>
>
> I have build function in UsersController
>
> class UsersController extends AppController{
>
>         public function login(){
>                 if ($this->request->is('post')) {
>             $user = 
> $this->User->findByMailAndPass($this->request->data["User"]["mail"], 
> Security::hash($this->request->data["User"]
>
> ["pass"], null, true));
>             if ($user === false) {
>                 $this->Session->setFlash('Nieprawidłowe dane
> logowania.');
>                 $this->request->data["User"]["mail"] = '';
>                 $this->request->data["User"]["pass"] = '';
>             } else {
>                 CakeSession::write('user.id', $user["User"]["id"]);
>                 CakeSession::write('user.mail', $user["User"]
> ["mail"]);
>                 $this->redirect(array('controller' => 'users',
> 'action' => 'profile'));
>             }
>         }
>         }
>
>         public function logout(){
>         CakeSession::delete("user");
>         $this->redirect('/');
>         }
>
> }
>
> So. When I go to the HOST/users/login everything is ok, but when I try
> to submit login form I get an error
>
> Fatal error: Class 'Security' not found in
>
> and of course I've got
>
> var $helpers = array('Form', 'Html', 'Session', 'Cycle');
>
> in AppController
>
> Can anyone please help me what should I do?
>
> Please do not tell me to change my login to the Cake model - I need
> that this way done.
>
> For end I will add info tha the same action is working good for admin
> login :(
>
> thank's for tips
>
> regards
>
> jmail

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Fatal error: Class 'security' not found... in cake 2

2012-01-09 Thread Miles J
It should be needed, it defines the package to import from.

On Jan 9, 12:12 pm, Daniel  wrote:
> Thanks.  I'm guessing Utility is not neccessarily needed?
>
> On Jan 9, 6:15 pm, Miles J  wrote:
>
>
>
>
>
>
>
> > First off, security should be capitalized. Secondly, import it:
>
> > App::uses('Security', 'Utility');
>
> > On Jan 9, 10:09 am, Daniel  wrote:
>
> > > I imported some code from a cake 1.3 application to cake 2, now I get
> > > an error on the following line:
> > > $this->data['User']['password'] = security::hash($this->data['User']
> > > ['password'], NULL, TRUE);
>
> > > Fatal error: Class 'security' not found in C:\xampp\htdocs\xx\Model
> > > \User.php on line 112- Hide quoted text -
>
> > - Show quoted text -

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Fatal error: Class 'security' not found... in cake 2

2012-01-09 Thread Miles J
First off, security should be capitalized. Secondly, import it:

App::uses('Security', 'Utility');

On Jan 9, 10:09 am, Daniel  wrote:
> I imported some code from a cake 1.3 application to cake 2, now I get
> an error on the following line:
> $this->data['User']['password'] = security::hash($this->data['User']
> ['password'], NULL, TRUE);
>
> Fatal error: Class 'security' not found in C:\xampp\htdocs\xx\Model
> \User.php on line 112

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Starting with 1.13 or 2.0

2012-01-08 Thread Miles J
Start with 2.0!

On Jan 8, 2:11 pm, Jerome Heuze - HEUZE Production
 wrote:
> Hello Everyone!
> Here is my new year resolution - start using CakePHP for my web apps
> projects...
>
> So for me to start should i be using/learning 1.x or 2.x version of
> CakePHP?
>
> You might want to know more about what i do - i am a front end
> developer so i do deal more about html/css/js but outside of my daily
> job i would like to be involve with both ends (backend and front end).
>
> Thank you all. And Happy New year!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: how to use the formatFileName option of the Uploader plugin of Miles Johnson?

2012-01-08 Thread Miles J
I noticed my docs are a bit out of date, updated them.

On Jan 7, 12:02 pm, franck  wrote:
> Hi guys,
>
> I am a real newbie in cakephp, I used to play with Symfony.
>
> I am trying to use the Uploader plugin of Miles Johnson to upload some
> pictures and attach them to a table, it sounds very good.
> I have test it on a simple table named Photos, which has two varchar
> fields : 'title' and 'uploadPath'.
>
> Everything is ok (after one day), ie I can upload pictures in a
> specific folders and attach it to the table. But I still can't make
> the formatFileName option work.
> As described in his tutorial, my Model/Photo.php looks like :
> public $actsAs = array(
>     'Uploader.Attachment' => array(
>         'fileName' => array(
>           'name'                => 'formatFilename',  // it doesn't
> work
>           'baseDir'             => '',
>           'uploadDir'           => 'upload',   // it works
>           'dbColumn'            => 'uploadPath',  // it works
> .);
>
> and I created the function formatFileName in the same file (Model/
> Photo.php):
> public function formatFilename($name, $field, $file) {
>      return md5($name);
>
> }
>
> And in my PhotosController, I have the function to add the pictures :
> public function add() {
>                 if($this->request->is('post')) {
>                         $this->Uploader = new Uploader();
>                         if ($this->Photo->save($this->request->data)) {
>                                 // Upload successful
>                                 $this->Session->setFlash('Upload photo 
> succeded');
>                         } else {
>                                 $this->Session->setFlash('Unable to upload');
>                         }
>                 }
>   }
>
> But it doesn't work, all my uploaded files are called
> formatFileName.jpg
>
> Do you have any idea of what I am doing wrong?
> Regards,

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: how to use the formatFileName option of the Uploader plugin of Miles Johnson?

2012-01-08 Thread Miles J
The function needs to be global, so take it out of the model.

On Jan 7, 12:02 pm, franck  wrote:
> Hi guys,
>
> I am a real newbie in cakephp, I used to play with Symfony.
>
> I am trying to use the Uploader plugin of Miles Johnson to upload some
> pictures and attach them to a table, it sounds very good.
> I have test it on a simple table named Photos, which has two varchar
> fields : 'title' and 'uploadPath'.
>
> Everything is ok (after one day), ie I can upload pictures in a
> specific folders and attach it to the table. But I still can't make
> the formatFileName option work.
> As described in his tutorial, my Model/Photo.php looks like :
> public $actsAs = array(
>     'Uploader.Attachment' => array(
>         'fileName' => array(
>           'name'                => 'formatFilename',  // it doesn't
> work
>           'baseDir'             => '',
>           'uploadDir'           => 'upload',   // it works
>           'dbColumn'            => 'uploadPath',  // it works
> .);
>
> and I created the function formatFileName in the same file (Model/
> Photo.php):
> public function formatFilename($name, $field, $file) {
>      return md5($name);
>
> }
>
> And in my PhotosController, I have the function to add the pictures :
> public function add() {
>                 if($this->request->is('post')) {
>                         $this->Uploader = new Uploader();
>                         if ($this->Photo->save($this->request->data)) {
>                                 // Upload successful
>                                 $this->Session->setFlash('Upload photo 
> succeded');
>                         } else {
>                                 $this->Session->setFlash('Unable to upload');
>                         }
>                 }
>   }
>
> But it doesn't work, all my uploaded files are called
> formatFileName.jpg
>
> Do you have any idea of what I am doing wrong?
> Regards,

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Different localization phrase

2012-01-04 Thread Miles J
Believe its not possible to show them all on one page. Someone correct
me if I am wrong.

On Jan 4, 6:57 am, "Constantin.FF"  wrote:
> I need to translate several phrases into different from the current
> language.
> If I write __('Title') I get it in the current language set in the
> session. How to get it in the other languages?
> For example I need to get 'Title' translated into French, Italian,
> German ... on one page

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Cake optimization

2012-01-02 Thread Miles J
http://milesj.me/blog/read/caching-queries

On Jan 2, 10:09 pm, AD7six  wrote:
> On Jan 3, 6:55 am, Dee Johnson  wrote:
>
>
>
>
>
>
>
>
>
> > I would like to have somewhere ~1 sec load time
>
> > I actually figured out the problem though.  When using persistModel = true
> > it actually caused ALOT of unexpected speed results.  I removed it and all
> > calls are around 1 - 3 seconds.
>
> > Also, automagic form elements wont load with it for some reason.
>
> > see this 
> > articlehttp://stackoverflow.com/questions/2148416/cakephp-controllerpersistm...
>
> > Thanks for the javascript caching suggestion.  I will try that as well.  I
> > am maintaining a tool that I created where the sole purpose is modifying /
> > inputting data primarily which is why containable worked or me alot.  Any
> > other suggestions similar to containable?
>
> > What modifications would you recommend on the OS layer?
>
> You are wasting your time unless you can identify something that is
> the cause for some/all of the delay you are seeing.
>
> E.g. let's say your db queries are taking 0.1s. if you implement a
> better caching mechanism you might be able to bring that down to 0.01s
> - which means your pages still take 7.99s.
>
> Therefore: look for and identify something that is actually slow
>
> * you can do that on a high level using debug kit
> * xdebug profiling would be 'best' it'll give you a lot of information
> and allow you to drill down to specific problems or let you see you're
> calling fast functions 1000s of times adding up to delays
> * you can do it yourself quite easily simply using $line = time() . '
> ' . __FILE__ . ':' . __LINE__; `echo "$line" >> my.log`; or something
> very similar (note complete absence of anything cakephp-specific in
> that).
>
> Also check your application and webserver logs - if they are full of
> errors (a common cause for slow apps in 1.3 and before is an
> unwritable tmp dir) sort that out first.
>
> AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Using Model constants all over app

2011-12-23 Thread Miles J
Thats the only good way of mimicking enums in PHP. Since constants are
static by nature, just call them whereever you need them. If the order
class is not in scope within the page, either load the model, or
include it with App. Really your only options.

On Dec 23, 5:50 am, func0der  wrote:
> i found that one, too.
>
> Just wondered if there is any better solution to it or to the whole
> thing.
>
> On Dec 23, 12:54 pm, euromark  wrote:
>
>
>
>
>
>
>
> > that's exactly how I do 
> > it:http://www.dereuromark.de/2010/06/24/static-enums-or-semihardcoded-at...
>
> > On 23 Dez., 11:23, func0der  wrote:
>
> > > Hey guys,
>
> > > i worked a lit with Magento in the last months.
> > > They used, in my opinion, a really good way to configurate and/or
> > > access for example status fields.
>
> > > They had a table field for example for the status of an order.
> > > 0 meant cancelled
> > > 1 meant payed
> > > 2 meant completed
>
> > > In the Model they used constants for identifying these statuses (if
> > > this is the plural of it)
>
> > > class Order{
> > >    const ORDER_STATUS_CANCELLED = 0;
> > >    const ORDER_STATUS_PAYED = 1;
> > >    const ORDER_STATUS_COMPLETED = 2;
>
> > > }
>
> > > So they could access these constants from as good as anyway with
> > > Order::ORDER_STATUS_CANCELLED.
>
> > > Is there a way to do so in cakephp?
> > > I mean without requiring the class, using "new" and so on?
>
> > > I need to access it from helpers, views, models, controllers and
> > > everywhere.
>
> > > Any idea?
>
> > > Greetings
> > > func0der

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Organizing Controllers into subfolders in CakePHP 2

2011-12-21 Thread Miles J
Yeah but that doesn't correlate to a 1-to-1 relationship to
controllers. I've had apps with 60+ models but maybe only 20-30
controllers.

But again it depends on the app.

On Dec 21, 12:05 pm, Brad Koch  wrote:
> So, in summary:
> * Don't use subfolders anymore.
> * If you want to start making partitions between files, use a plugin.
>
> @Miles, just an example.  Lots of models would equal lots of
> controllers.  I've had schemas that had over 60 tables before, so it
> wouldn't be unreasonable at all to see up to 100.  I promise there's
> no hideous case of abuse going on =)
>
> On Dec 20, 9:55 pm, José Lorenzo  wrote:
>
>
>
>
>
>
>
> > I would use plugins, it is a very natural way of organizing related code
> > into logical and reusable chunks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Organizing Controllers into subfolders in CakePHP 2

2011-12-20 Thread Miles J
Well my question is, why do you have so many controllers?

Secondly, use plugins. Its basically a more advanced replacement for
what you need.

On Dec 20, 12:41 pm, Brad Koch  wrote:
> Alright, that makes sense.  Point of clarification, what's the
> preferred convention on this now then?  Should you abstain from
> organizing your files into subdirectories, even if it means you end up
> with 100 controllers in the same directory?  Or is there some other
> recommended way of organizing them?
>
> On Dec 20, 3:14 pm, "Larry E. Masters"  wrote:
>
>
>
>
>
>
>
> > As we are moving CakePHP closer to a version of PHP the supports namespaces
> > the decision was made now to remove this "feature". We also started
> > following the PSR-0 for CakePHP 2.0 and above, to comply with it we would
> > have needed to remove them anyway.
>
> > --
> > Larry E. Masters
>
> > On Tue, Dec 20, 2011 at 1:53 PM, Brad Koch  wrote:
> > > That works, but I'm still curious as to what exactly happened to this
> > > feature, as it seemed to be widely promoted:
> > > *
> > >http://groups.google.com/group/cake-php/browse_thread/thread/95da5e67...
> > > *http://cakebaker.42dh.com/2007/11/22/organizing-your-code-with-folders/
> > > *
> > >http://holisticnetworking.net/cake/2010/06/organizing-your-cakephp-fi...
>
> > > On Dec 20, 2:14 pm, Thiago Belem  wrote:
> > > > Maybe this can help:
>
> > > >http://book.cakephp.org/2.0/en/development/configuration.html#bootstr...
>
> > > > This file is ideal for a number of common bootstrapping tasks:
>
> > > >    - Defining convenience functions.
> > > >    - Registering global constants.
> > > >    - Defining additional model, view, and controller paths.
> > > >    - Creating cache configurations.
> > > >    - Configuring inflections.
> > > >    - Loading configuration files.
>
> > > > --
> > > > ***Thiago Belem*
> > > > Desenvolvedor
> > > > Rio de Janeiro - RJ - Brasil
>
> > > > +55 (21) 8865.9250
> > > > thiagobelem.net
> > > > cont...@thiagobelem.net
>
> > > > *Skype / gTalk **»* thiago.belem.web
> > > > *LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt*
> > > > Assando Sites*, curso de CakePHP *»* assando-sites.com.br
>
> > > > 2011/12/20 Brad Koch 
>
> > > > > In previous versions of CakePHP, you could organize Controllers into
> > > > > subfolders.  In CakePHP 2, when I try this I encounter missing
> > > > > controller errors.
>
> > > > > Anyone know the reason for this?  How can you enable storing
> > > > > controllers in subfolders in CakePHP 2?
>
> > > > > --
> > > > > Our newest site for the community: CakePHP Video Tutorials
> > > > >http://tv.cakephp.org
> > > > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> > > > > others with their CakePHP related questions.
>
> > > > > To unsubscribe from this group, send email to
> > > > > cake-php+unsubscr...@googlegroups.com For more options, visit this
> > > group
> > > > > athttp://groups.google.com/group/cake-php
>
> > > --
> > > Our newest site for the community: CakePHP Video Tutorials
> > >http://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> > > others with their CakePHP related questions.
>
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: i18n extract in plugins cakephp 2.0

2011-12-19 Thread Miles J
app/Plugin//Locale/eng/LC_MESSAGES/.po

On Dec 19, 10:20 am, Cayetano Soriano  wrote:
> Hi i used  the console, for extract .po, from plugin, the problem, is
> that I create a directory in my app/Plugins// called
> Locale, and copy my .po, but it doesn't work, in app/Locale , it works
> perfectly, how i can put that in my plugin/ directory
>
> Thank's a lot

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: best use of var $uses in a controller

2011-12-19 Thread Miles J
What euromark said. If the model is the primary usage within the
controller, I use the $uses and any associations off of the user. If I
really need an external model, I would use loadModel().

For example in a users controller, only user would be in $uses.

On Dec 19, 4:31 pm, euromark  wrote:
> I use var $uses for the primary model of the controller
> e.g.
> Posts => uses Post
> Contact => uses Tools.Contact (Plugin model)
> MembersController => uses User
> Account => uses User
> etc
>
> I also think this is the normal use case for this property and would
> never put more than one model into it.
> The main reason you got that is that there are controllers (see
> Account) that need to use a custom model (inflections won't work
> here).
> that's why you can override it manually.
> it most cases, of course, you don't even have to touch this property.
>
> On 20 Dez., 01:11, roundrightfarm  wrote:
>
>
>
>
>
>
>
> > Is there ever a time when it is considered best practices to use var
> > $uses for access to a model from a controller.  The cakephp manual
> > seems to say to use $this->Model->AssociatedModel when there is an
> > association and $this->loadModel('UnassociatedModel') when there
> > isn't.  Does var $uses not appear in well written code?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Black hole 404 error with radio buttons

2011-12-14 Thread Miles J
Add this to your before filter.

$this->Security->disabledFields = array('selected');

http://milesj.me/blog/read/security-protection

On Dec 14, 12:16 pm, eugenefphillips 
wrote:
> I am using CakePHP 1.3, and I keep getting a black hole error.  The
> error is happening in the _validatePost function where it returns the
> $token === $check, because they do not equal each other.
>
> I have two forms on one page.  I am using the form helper to generate
> the forms, closing the forms, and generating the inputs.
>
> The first form allows for the user to filter the data, and this form
> is working when I submit it.
>
> The second is where the black hole error happens.  The form contains
> radios button that I am generating the value for when it is created.
>
> Here is my attributes array
> $radioAttributes = array(
> 'legend' => false,
>         'label' => false,
>         'name' => "data[ModelName][main Id for the group][selected]"
>         'hiddenField' => false);
>
> Here is my option array
> $radioOptions = array($array[$i][' ModelName l']['id'] => '');
>
> Here is the code for the radio buttons.
>
> Radio button $this->Form->radio("ModelName.an ID.selected",
> $radioOptions, $radioAttributes);
>
> The form could easily have anywhere between and 1 and 800 buttons.
>
> I have a JavaScript that manipulates a span at the bottom of the page.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Testing image upload

2011-12-12 Thread Miles J
That doesn't actually test if files are uploaded and image
transformations worked.

On Dec 12, 7:12 am, Matteo Landi  wrote:
> On Mon, Dec 12, 2011 at 4:46 AM, leigh  wrote:
> > Hi Matteo,
>
> > Wrap move_uploaded_file and is_uploaded_file inside the controller
>
> > function moveUploadedFIle($filename, $destination) {
> >  return move_uploaded_file($filename, $destination);
> > }
>
> > function moveUploadedFIle($filename, $destination) {
> >  return is_uploaded_file($filename, $destination);
> > }
>
> > Then inside your testController override them.
>
> > class TestPostsController extends postsController {
>
> >  protected function isUploadedFile($filename) {
> >   return true;
> >  }
> >  protected function moveUploadedFile($filename, $destination) {
> >   return true;
> >  }
>
> You are assuming that my controllers tests extend controllers and not,
> as usual, CakeControllerTest. However, do I really need to do
> something similar to test image uploading? Is this supported or not?
>
> Matteo
>
> --http://www.matteolandi.net/

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How to Redirect from a Behavior?

2011-12-09 Thread Miles J
Why do you need to go to this page?

You could always just use regular PHP:

header('Location: /url/');
exit();

On Dec 9, 6:22 pm, zuha  wrote:
> Ha, I know you'll all say... ah, you're breaking MVC so let me explain
> the situation in case anyone cares to have it.  But if you don't, I'm just
> looking for the best way to force a redirect from a behavior.  Preferably
> without having to edit any other file.
>
> ie. maybe something like ...  myFunction () {
> Controller::redirect('somewhere');     }
>
> If you just can't stand someone breaking MVC, here's the story, so that
> maybe you can tell me the MVC way to do it.
>
> I have this behavior which is used by many different plugins.   In
> beforeFind() it filters results.  If no results are found, I want to all of
> the plugins that use this behavior to be redirected to a single specific
> page.  Its not something I would return to the controller, because then I
> would have to edit a the multiple controllers, in multiple plugins for any
> plugin that actsAs this behavior.  And I wouldn't just do a beforeFilter
> catch in AppController, because that would break plugin architecture - as
> in they should be stand alone and separate from the App.   So as simple as
> it sounds, it seems its just not possible to do...
>
> public function afterFind(&$Model, $results) {
>      if (empty($results)) :
>         $this->redirect('to somewhere else');
>      endif;
>
>
>
>
>
>
>
> }

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: FileUploader component

2011-12-09 Thread Miles J
David Perssons Media plugin is good for more advanced uploading/
validating.

My uploader is great for very simply uploading and image
transformations.

Use whatever fits best!

On Dec 9, 10:36 am, Jeremy Burns | Class Outfit
 wrote:
> I use David Persson's Media plugin; it took a little while for me to work out 
> what to do but it contains a good tutorial and is working really well.
>
> What have you tried and what isn't working?
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 9 Dec 2011, at 17:01:05, j_pablo_gn wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > I have seen a few upload components:
>
> > 1.http://www.meiocodigo.com/projects/meioupload/
> > 2.http://bakery.cakephp.org/articles/webtechnick/2009/02/10/file-upload...
> > 3.http://milesj.me/code/cakephp/uploader
>
> > But, as far as I am using cake 1.3 and I am a very new in this... I am
> > not able to make run anyone of them.
>
> > Any recomendation?
>
> > Thanks.
> > J. Pablo.
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: request says put instead of post

2011-12-08 Thread Miles J
What are your HTTP headers?

On Dec 8, 1:44 pm, euromark  wrote:
> thats really weird.
> happening on windows/wamp - php5.3.8
> maybe some bug?
>
> the firefox firebug debug data for POST reads:
>
> Parameter application/x-www-form-urlencoded
> _method PUT
> data[UserInfo][country_id...    1
> data[UserInfo][gender]  1
> data[User][id]  4ed23d7c-dcc8-4d3b-8e7b-0fe01810f9bf
> data[User][username]    test
>
> so it seems to put everything by default.
> As far as I know, POST is more generic and PUT mainly used for upload
> etc
>
> On 8 Dez., 21:04, Tilen Majerle  wrote:
>
>
>
>
>
>
>
> > i was checking this what you said that didn't work and results
> > checking: $this->request->is('post')
>
> > in Google Chrome (latest): true
> > Firefox (latest): true
> > IE 8: true
>
> > i'm on xampp 1.7.3 with php 5.3.5
> > and Cake version: 2.0.4
>
> > so problem is somewhere in your project or maybe server configuration
> > --
> > Lep pozdrav, Tilen Majerlehttp://majerle.eu
>
> > 2011/12/8 euromark 
>
> > > For 2.0 I just changed all
> > > if (!empty($this->data))
> > > to
> > > if ($this->request->is('post'))
>
> > > But now it haunts be.
> > > In FF8 Cakephp $this->request does say "false" after a normal post
> > > (whereas firebug itself says it is a post)
> > > but is('put') returns true
> > > Same with every other browser it seems.
>
> > > so it never saves...
> > > whats going on?
>
> > > --
> > > Our newest site for the community: CakePHP Video Tutorials
> > >http://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> > > others with their CakePHP related questions.
>
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Problems with ajax and security component.

2011-12-08 Thread Miles J
Yeah I ran into this as well, Jose has the correct answer.

https://github.com/milesj/cake-ajax_handler/blob/master/Controller/Component/AjaxHandlerComponent.php#L84

On Dec 8, 12:54 pm, José Lorenzo  wrote:
> set 'validatePost' => false for the security component in that action

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Shared code for Models but not in AppModel

2011-12-07 Thread Miles J
Cake just doesn't have a true autoloader so you need to include the
file yourself or use the App class.

On Dec 7, 12:38 pm, RhythmicDevil  wrote:
> Well the basic idea is that the application uses two datasources. One
> is the MySQL one the other is a custom one I wrote for our API. The
> Models that use the custom datasource require some methods and
> properties, I posted those in the initial question on this thread.
> Normally I would just put those in AppModel and be done with it. But,
> they break the models that use MySQL so AppModel is not the
> appropriate place.
>
> So what I wanted to do was have AppModel at the top of the chain
> containing all common Model code. Then extend that to GtiApi, User,
> and Group. GtiApi would contain the methods and properties I
> mentioned. Then API driven Models like Solidcore would extend GtiApi.
> This now works.
>
> In reality though I actually dont "need" the Solidcore models, I could
> really just use GtiApi model and then do something fancy so that Model
> data was under the right index, say  "Solidcore". That way the
> controller and views would work properly as well. Currently the Models
> that extend GtiApi are empty. There may be a case for doing some extra
> Model work in some of them, but I dont have all the requirements yet.
>
> On Dec 7, 11:19 am, Geoff Douglas  wrote:
>
>
>
>
>
>
>
> > Where are you trying to use the Solidcore Model?
>
> > I have done what you are explaining several times. Generally to apply
> > different relationships to the same models, for better performance, and
> > cleaner code.
>
> > It is possible. And it is not breaking "the Cake way" to do it either. Cake
> > is very versatile, especially with how models work.
>
> > Let me know.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Trying to reduce arrays

2011-12-06 Thread Miles J
What euromark said, just do your own forloop and append them to a new
array.

On Dec 6, 1:58 pm, euromark  wrote:
> you can always use foreach() ;)
> the set:: methods wont use anything else, either (internally)
>
> so its also the quickest way of doing it.
>
> On 6 Dez., 22:41, McScreech  wrote:
>
>
>
>
>
>
>
> > I am completely stumped. I have tried combinations of Set::extract,
> > Set::classicExtract, Set::combine, and Set::flatten to get the results
> > I show below. Perhaps this is a straight php question rather than
> > cakePHP?
>
> > 1) How do I obtain the results demonstrated?
> > 2) How do I extract the key _names_ from the third level? ('mother',
> > 'father', 'child', 'date')
>
> > $array = array(
> >         0 => array(
> >                 c1 => array(mother => '05-064'),
> >                 c2 => array(father => '05-740'),
> >                 p1 => array(child => 'WP-315'),
> >                 t1 => array(date => '1956-00-00')
> >         ),
> >         1 => array(
> >                 c1 => array(mother => '05-066'),
> >                 c2 => array(father => '05-745'),
> >                 p1 => array(child => 'WP-316'),
> >                 t1 => array(date => '1958-00-00')
> >         )
> > );
>
> > Many TIA, McS
>
> > I have an array like this:
> > Array
> > (
> >     [0] => Array
> >         (
> >             [c1] => Array
> >                 (
> >                     [mother] => 05-064
> >                 )
> >             [c2] => Array
> >                 (
> >                     [father] => 05-740
> >                 )
> >             [p1] => Array
> >                 (
> >                     [child] => WP-315
> >                 )
> >             [t1] => Array
> >                 (
> >                     [date] => 1956-00-00
> >                 )
> >         )
> >     [1] => Array
> >         (
> >             [c1] => Array
> >                 (
> >                     [mother] => 05-066
> >                 )
> >             [c2] => Array
> >                 (
> >                     [father] => 05-745
> >                 )
> >             [p1] => Array
> >                 (
> >                     [child] => WP-316
> >                 )
> >             [t1] => Array
> >                 (
> >                     [date] => 1958-00-00
> >                 )
> >         )
> > )
>
> > I would like to have an array like this:
> > Array
> > (
> >     [0] => Array
> >         (
> >             [mother] => 05-064
> >             [father] => 05-740
> >             [child] => WP-315
> >             [date] => 1956-00-00
> >         )
> >     [1] => Array
> >         (
> >             [mother] => 05-066
> >             [father] => 05-745
> >             [child] => WP-316
> >             [date] => 1958-00-00
> >         )
>
> > )

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Shared code for Models but not in AppModel

2011-12-05 Thread Miles J
Cake simply has trouble when trying to merge properties in one class
with the AppClass. This should only be a problem with the
AppController since you aren't defining many properties in AppModel.

On Dec 5, 12:34 pm, RhythmicDevil  wrote:
> Yeah I had thought, and now have to go and check, that you could never
> extend passed one sub class from AppModel or AppController for that
> matter. I always thought that was odd but had something to do with
> cake's auto loaders. Thanks for the clue, I will check this out.
>
> On Dec 5, 3:11 pm, Miles J  wrote:
>
>
>
>
>
>
>
> > Are you referring to where the files go?
>
> > You can do anything in Cake that PHP allows, so extend as many times
> > as you please.
>
> > On Dec 5, 11:54 am, RhythmicDevil  wrote:
>
> > > Hi Miles,
> > > thanks for the response. Yeah I think that would be the number 3
> > > option I Iisted.
>
> > > The thing is how would I do the following:
>
> > > AppModel
> > >     DbBaseModel
> > >          SomeModel
> > >     ApiBaseModel
> > >          AnotheModel
>
> > > To the best of my knowledge you can actually build that kind of
> > > heirarchy in Cake right?
>
> > > On Dec 5, 2:49 pm, Miles J  wrote:
>
> > > > You could always just create 2 base models?
>
> > > > class ApiBaseModel extends AppModel {}
> > > > class DbBaseModel extends AppModel {}
>
> > > > They both would extend AppModel to gain shared functionality and then
> > > > both would have their own functionality. Cake IS PHP, so you can do
> > > > whatever you want with classes.
>
> > > > class User extends DbBaseModel {}
> > > > class News extends ApiBaseModel {}
>
> > > > -Miles
>
> > > > On Dec 5, 11:29 am, RhythmicDevil  wrote:
>
> > > > > My application has two datasources. I use one to talk to MySQL for
> > > > > ACL. The other is a custom datasource that talks an API my company is
> > > > > developing. There are about 15 models that use the custom datasource
> > > > > and will probably be more. For each of those models I need to share
> > > > > methods and  properties but DO NOT want the ACL models to have them so
> > > > > they cannot go into AppModel.
>
> > > > > The reason I have many models for the API is that I want the data
> > > > > structures returned by the Model to have the correct naming. I suppose
> > > > > I could set the name on the fly but for now I am curious how to solve
> > > > > this other problem.
>
> > > > > Do behaviors solve this problem? I did not think that was really their
> > > > > function. These are the properties and methods I need shared and it
> > > > > has to do with how the datasource works.
>
> > > > >     public $useDbConfig = 'gti';
> > > > >     public $useTable = false;
>
> > > > >     public function __construct()
> > > > >     {
> > > > >         parent::__construct();
> > > > >     }
>
> > > > >     /**
> > > > >      * Overridden paginate method - group by week, away_team_id and
> > > > > home_team_id
> > > > >      */
> > > > >     function paginate($conditions, $fields, $order, $limit, $page = 1,
> > > > > $recursive = null, $extra = array())
> > > > >     {
> > > > >         //var_dump($conditions, $fields, $order, $limit, $page,
> > > > > $recursive, $extra);
> > > > >         $recursive = -1;
> > > > >         //$group = $fields = array('week', 'away_team_id',
> > > > > 'home_team_id');
> > > > >         return $this->find('all', compact('conditions', 'fields',
> > > > > 'order', 'limit', 'page', 'recursive'));
> > > > >     }
>
> > > > >     /**
> > > > >      * Overridden paginateCount method
> > > > >      */
> > > > >     function paginateCount($conditions = null, $recursive = 0, $extra
> > > > > = array())
> > > > >     {
> > > > >         //var_dump($conditions, $recursive, $extra);
> > > > >         return 1000;
> > > > >         $sql = "SELECT DISTINCT ON(week, home_team_id, away_team_id)
> > > > > week, home_team_id, away_team_id FROM games";
> > > > >         $this->recursive = $recursive;
> > > > >         $results = $this->query($sql);
> > > > >         return count($results);
> > > > >     }
>
> > > > > I see the following options:
>
> > > > > 1. Place the code in the AppModel file and then do some work every
> > > > > time those methods and properties are needed to decide whether I use
> > > > > these or the other. That seems like a lot of work.
>
> > > > > 2. Duplicate the code in each model
>
> > > > > 3. Use one model for the API and then just set it's name so that my
> > > > > data structures are named correctly.
>
> > > > > And again, behavior? Probably not, but figured I'd ask one more time.
>
> > > > > Thanks for any advice.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Shared code for Models but not in AppModel

2011-12-05 Thread Miles J
Are you referring to where the files go?

You can do anything in Cake that PHP allows, so extend as many times
as you please.

On Dec 5, 11:54 am, RhythmicDevil  wrote:
> Hi Miles,
> thanks for the response. Yeah I think that would be the number 3
> option I Iisted.
>
> The thing is how would I do the following:
>
> AppModel
>     DbBaseModel
>          SomeModel
>     ApiBaseModel
>          AnotheModel
>
> To the best of my knowledge you can actually build that kind of
> heirarchy in Cake right?
>
> On Dec 5, 2:49 pm, Miles J  wrote:
>
>
>
>
>
>
>
> > You could always just create 2 base models?
>
> > class ApiBaseModel extends AppModel {}
> > class DbBaseModel extends AppModel {}
>
> > They both would extend AppModel to gain shared functionality and then
> > both would have their own functionality. Cake IS PHP, so you can do
> > whatever you want with classes.
>
> > class User extends DbBaseModel {}
> > class News extends ApiBaseModel {}
>
> > -Miles
>
> > On Dec 5, 11:29 am, RhythmicDevil  wrote:
>
> > > My application has two datasources. I use one to talk to MySQL for
> > > ACL. The other is a custom datasource that talks an API my company is
> > > developing. There are about 15 models that use the custom datasource
> > > and will probably be more. For each of those models I need to share
> > > methods and  properties but DO NOT want the ACL models to have them so
> > > they cannot go into AppModel.
>
> > > The reason I have many models for the API is that I want the data
> > > structures returned by the Model to have the correct naming. I suppose
> > > I could set the name on the fly but for now I am curious how to solve
> > > this other problem.
>
> > > Do behaviors solve this problem? I did not think that was really their
> > > function. These are the properties and methods I need shared and it
> > > has to do with how the datasource works.
>
> > >     public $useDbConfig = 'gti';
> > >     public $useTable = false;
>
> > >     public function __construct()
> > >     {
> > >         parent::__construct();
> > >     }
>
> > >     /**
> > >      * Overridden paginate method - group by week, away_team_id and
> > > home_team_id
> > >      */
> > >     function paginate($conditions, $fields, $order, $limit, $page = 1,
> > > $recursive = null, $extra = array())
> > >     {
> > >         //var_dump($conditions, $fields, $order, $limit, $page,
> > > $recursive, $extra);
> > >         $recursive = -1;
> > >         //$group = $fields = array('week', 'away_team_id',
> > > 'home_team_id');
> > >         return $this->find('all', compact('conditions', 'fields',
> > > 'order', 'limit', 'page', 'recursive'));
> > >     }
>
> > >     /**
> > >      * Overridden paginateCount method
> > >      */
> > >     function paginateCount($conditions = null, $recursive = 0, $extra
> > > = array())
> > >     {
> > >         //var_dump($conditions, $recursive, $extra);
> > >         return 1000;
> > >         $sql = "SELECT DISTINCT ON(week, home_team_id, away_team_id)
> > > week, home_team_id, away_team_id FROM games";
> > >         $this->recursive = $recursive;
> > >         $results = $this->query($sql);
> > >         return count($results);
> > >     }
>
> > > I see the following options:
>
> > > 1. Place the code in the AppModel file and then do some work every
> > > time those methods and properties are needed to decide whether I use
> > > these or the other. That seems like a lot of work.
>
> > > 2. Duplicate the code in each model
>
> > > 3. Use one model for the API and then just set it's name so that my
> > > data structures are named correctly.
>
> > > And again, behavior? Probably not, but figured I'd ask one more time.
>
> > > Thanks for any advice.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Shared code for Models but not in AppModel

2011-12-05 Thread Miles J
You could always just create 2 base models?

class ApiBaseModel extends AppModel {}
class DbBaseModel extends AppModel {}

They both would extend AppModel to gain shared functionality and then
both would have their own functionality. Cake IS PHP, so you can do
whatever you want with classes.

class User extends DbBaseModel {}
class News extends ApiBaseModel {}

-Miles

On Dec 5, 11:29 am, RhythmicDevil  wrote:
> My application has two datasources. I use one to talk to MySQL for
> ACL. The other is a custom datasource that talks an API my company is
> developing. There are about 15 models that use the custom datasource
> and will probably be more. For each of those models I need to share
> methods and  properties but DO NOT want the ACL models to have them so
> they cannot go into AppModel.
>
> The reason I have many models for the API is that I want the data
> structures returned by the Model to have the correct naming. I suppose
> I could set the name on the fly but for now I am curious how to solve
> this other problem.
>
> Do behaviors solve this problem? I did not think that was really their
> function. These are the properties and methods I need shared and it
> has to do with how the datasource works.
>
>     public $useDbConfig = 'gti';
>     public $useTable = false;
>
>     public function __construct()
>     {
>         parent::__construct();
>     }
>
>     /**
>      * Overridden paginate method - group by week, away_team_id and
> home_team_id
>      */
>     function paginate($conditions, $fields, $order, $limit, $page = 1,
> $recursive = null, $extra = array())
>     {
>         //var_dump($conditions, $fields, $order, $limit, $page,
> $recursive, $extra);
>         $recursive = -1;
>         //$group = $fields = array('week', 'away_team_id',
> 'home_team_id');
>         return $this->find('all', compact('conditions', 'fields',
> 'order', 'limit', 'page', 'recursive'));
>     }
>
>     /**
>      * Overridden paginateCount method
>      */
>     function paginateCount($conditions = null, $recursive = 0, $extra
> = array())
>     {
>         //var_dump($conditions, $recursive, $extra);
>         return 1000;
>         $sql = "SELECT DISTINCT ON(week, home_team_id, away_team_id)
> week, home_team_id, away_team_id FROM games";
>         $this->recursive = $recursive;
>         $results = $this->query($sql);
>         return count($results);
>     }
>
> I see the following options:
>
> 1. Place the code in the AppModel file and then do some work every
> time those methods and properties are needed to decide whether I use
> these or the other. That seems like a lot of work.
>
> 2. Duplicate the code in each model
>
> 3. Use one model for the API and then just set it's name so that my
> data structures are named correctly.
>
> And again, behavior? Probably not, but figured I'd ask one more time.
>
> Thanks for any advice.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Best image resize and crop helper

2011-12-01 Thread Miles J
This should be done when the image is uploaded.

On Dec 1, 8:08 am, phpMagpie  wrote:
> I'm using SLIR2:http://code.google.com/p/smart-lencioni-image-resizer/
>
> HTH, Paul.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: js/css compression helpers for cakephp 2.0

2011-11-30 Thread Miles J
You could easily convert this to Cake 2: https://github.com/mcurry/asset

On Nov 29, 10:52 pm, mikeottinger  wrote:
> Hi All, I've been looking at cakephp 2.0 and wondered if any of the
> existing plugins written previously for js/css compression worked with
> cakephp 2.0. Does anyone have any plugins or techniques in general they can
> share on this?
>
> Thanks!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Vendor files from Plugin folder

2011-11-28 Thread Miles J
I still just use import.

App::import('Vendor', 'PluginName.ClassName');

Also, shouldn't the uses be:

App::uses('ClassName', 'Plugin/PluginName/Vendor'); ?

On Nov 28, 12:55 am, p r  wrote:
> have you tried this? In this case the classfile will not be found from
> a subfolder. You can see that with App::objects('PluginName.Vendor').
> Is there a way to extend the plugin vendor pathes with App::build? So
> i add all my subfolders and your way should be fine. Currently i go
> this way...
>
>                 App::build(array('Vendor' => array(APP . 'Plugin' . DS .
> 'PluginName' . DS . 'Vendor' . DS . 'SubFolder'. DS)));
>                 App::uses('ClassNameFromSubFolder', 'Vendor');
>
> On 27 Nov., 20:41, Sam Sherlock  wrote:
>
>
>
>
>
>
>
> > App::uses('ClassName', 'PluginName.Vendor');
>
> > App::build will let you add additional paths for plugins etc.
>
> > You don't need to use app build to be able to use classes from plugins.
>
> > - S
> > On 27 Nov 2011 17:55, "p r"  wrote:
>
> > > Hello,
>
> > > it would be a pleasure if somebody could help me. I try to load files
> > > from Plugin subfolder. How should i use App::build? One solution is to
> > > add the plugins vendor subfolder to the vendors paths. Now the classes
> > > are available per App::uses.
> > > But so i have to include every external library folder i want to use
> > > in the plugin. Is there a way to work with plugins vendor folder in
> > > App::uses, or is it possible to specify this on App:build?
>
> > > greetings
> > > pr
>
> > > --
> > > Our newest site for the community: CakePHP Video Tutorials
> > >http://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
> > > others with their CakePHP related questions.
>
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Remember Me with Cookie and Auth Component

2011-11-22 Thread Miles J
Here you are: https://github.com/milesj/cake-auto_login

On Nov 22, 10:23 am, Jordy van Kuijk  wrote:
> Hi all,
>
> I'm trying to add a "remember me" checkbox into my login form.
> When users check the box, they log in and a cookie ('Auth.User') is
> stored, with 'email' and 'password' fields (this works).
> Now in my AppController, I want to see if users can log back in using
> their cookie.
>
> I have the following code:
>
> //inside AppController.php
> public function beforeFilter(){
>
>   $cookie = $this->Cookie->read('Auth.User');
>
>   if (is_array($cookie) && !$this->Auth->user())
>         {
>                 $this->Auth->login($cookie);
>                 debug($this->Auth->user());
>         }
>
> }
>
> The debug shows me that the user object in Auth contains the email
> address and password.
> Is there a way to load all of the additional data into the user object
> (like firstname, lastname, etc...)?
> My UsersController contains the following login function:
>
> public function login(){
>
>                 $this->autoRender = false;
>                 if($this->request->is('post')){
>                         if($this->Auth->login()){
>
>                                 //see if the remember me cookie has to be set
>                                 if(!empty($this->request->data) && 
> $this->request->data['User']
> ['remember_me']){
>                                         $cookie = array();
>                         $cookie['email'] = $this->data['User']['email'];
>                         $cookie['password'] = $this->data['User']['password'];
>                         $this->Cookie->write('Auth.User', $cookie, true, '+2
> weeks');
>                         return $this->redirect('../index');
>                                 }
>                                 else{
>                                         //we logged in, but the user does not 
> want to have a cookie.
>                                         return $this->redirect('../index');
>                                 }
>                         }
>                         else {
>                                 //we tried to log in the user but it failed
>                                 
> $this->Session->setFlash($this->Auth->authError);
>                                 return $this->redirect('../index');
>                         }
>                 }
>                 if(empty($this->request->data)){
>                         $cookie = $this->Cookie->read('Auth.User');
>                         if(!is_null($cookie)){
>
>                                 echo('we found cookie, now trying to log you 
> in with it');
>
>                                 if($this->Auth->login($cookie)){
>
>                                         
> $this->Session->delete('Message.auth');
>
>                                         //return $this->redirect('../feed');
>                                 } else{
>                                         //invalid cookie
>                                   $this->Cookie->del('Auth.User');
>                                 }
>                         }
>                         else{
>                                 //users accesses this page without a cookie
>                                 return $this->redirect('../index');
>                         }
>                 }
>         }
>
> Please note that I am very new to CakePHP.
> Thanks in advance,
>
> Jordy

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How to download multiples files with cake?

2011-11-20 Thread Miles J
Correct, downloading multiple files at once isn't possible without
multiple HTTP requests. Best bet is to zip it up.

On Nov 19, 4:04 pm, euromark  wrote:
> yes, zipping/packing them is one of the only changes you got.
> you could open tons of popups/new windows which then each trigger a
> download
> or you could probably do sth similar with ajax
> but thats sure not very user friendly
>
> On 19 Nov., 23:04, dtemes  wrote:
>
>
>
>
>
>
>
> > Is that possible at all? maybe you can zip all selected files together
> > and let the user download just the zip file.
>
> > On 18 nov, 12:23, Lucas Simon Rodrigues Magalhaes
>
> >  wrote:
> > > Hii,
>
> > > I have a doubt, how to download multiples files with cake. I have in
> > > my directory webroot/files, four files.
> > > form1.pdf,form2.pdf,form3.pdf,form4.pdf
>
> > > In my view i have this code:
> > > Formulários
> > > Form-
>
> > > >create('Formulario',array('target'=>'_blank'));?>
>
> > > 
> > >         echo $this->Form->input('Formulario.selecionarFormulario', array(
> > >                 'div' => false,
> > >         'label' => true,
> > >         'type' => 'radio',
> > >                 'class' => 'iu02radio',
> > >         'options' => array(
> > >                         1       => 'Form1',
> > >                         2       => 'Form2',
> > >                         3       => 'Form3',
> > >                         4       => 'Form4',
> > >                         5       => ' ',
> > >                         6       => '',
> > >                         7       => '',
> > >                         8       => '',
> > >                         9       => '',
> > >                         10      => 'l',
> > >                         11      => '',
> > >                         12      => ' ',
> > >                         13      => '',
> > >                         14      => '',
> > >                         15      => 'All forms',
> > >                 )
> > >         ));
>
> > >         echo $this->Form->end(__('Gerar Formulario', true));
> > > ?>
>
> > > And, in my controller i have two actions:
>
> > >  function gerarFormularios() {
>
> > >         /**
> > >          *
> > >          * Recebe os valores vindos do formulario, no array 
> > > $this->data['Formulario']['selecionarFormulario']
>
> > >          * @var {Int} $opcoes
> > >          */
> > >         $opcoes = $this->data['Formulario']['selecionarFormulario'];
>
> > >         /**
> > >          *  Verifica se a opcao esta vazia. caso esteja exibe uma
> > > mensagem: Selecione um formulario.
> > >          */
> > >         if (isset($opcoes) && empty($opcoes)){
> > >                 $this->Session->setFlash(__('Selecione um formulario', 
> > > true));
> > >         }
> > >         else {
>
> > >                 /**
> > >                  * Caso a opcao seja igual a um valor chama o metodo 
> > > $this->_download, para gerar o formulario em pdf
>
> > >                  */
> > >                 switch ($opcoes) {
> > >                         case 1:
> > >                                 $this->_download($opcoes);
> > >                         break;
>
> > >                         case 15:
>
> > >                         break;
>
> > >                 }
> > >         }
>
> > >     }
>
> > >     /**
> > >      *
> > >      * Metodo privado da classe para realizar o download dos
> > > formularios quando solicitados
> > >      * pela função function gerarFormularios()
> > >      */
> > >     function _download($opcoes) {
>
> > >         /**
> > >          * Configura o debug do cakePHP para 0 (zero)
> > >          */
> > >         Configure::write('debug',0);
>
> > >         /**
> > >          *
> > >          * Coloca a view da função para Media
> > >          * @examplehttp://book.cakephp.org/pt/view/1094/Media-Views
> > >          * @var {String} $this->view
> > >          */
> > >         $this->view = 'Media';
>
> > >         $params = array(
> > >                 'id' => 'form'.$opcoes.'.pdf',
> > >             'name' => 'formulario'.$opcoes,
> > >             'download' => true,
> > >             'extension' => 'pdf',
> > >                 'target' => '_blank',
> > >             'path' => 'files' . DS . 'ged' . DS
> > >        );
>
> > >            /**
> > >             * Seta os dados para visao
> > >             */
> > >        $this->set($params);
>
> > >        /**
> > >         *
> > >         * Nao renderiza em nenhum layout
> > >         * @var {boolean} $this->autoLayout
> > >         */
> > >        $this->autoLayout = false;
>
> > >         }
>
> > > How to configure, media view to download multiple files, in  option
> > > 15("all forms"). I am totally lost. =(

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this g

Re: how getting upload file array only element.array_file to table.db

2011-11-19 Thread Miles J
Because you are not actually uploading a file. Sure you are presenting
an upload form, but it looks like you aren't doing anything with that
upload after the form submission. You should really do the following:

1 - After form submission, validate the file upload and error out if
something is wrong
2 - If valid, upload the file to some location and save the path
3 - Set the path to the data being inserted into the database, not the
filename
4 - Remove the files array from the data as it is no longer needed

I would suggest using an uploader system if you are not already.

http://milesj.me/code/cakephp/uploader

On Nov 19, 6:35 am, Ogalav  wrote:
> hi, the situation is following
> the add.ctp will save one file of type ".doc"
> all right with description and code type..etc according cakephp`s
> manual 2.0
>
> but when get to save..it said me that fiel [doc] of table ordenes cant
> be "array", en then i make debug in the controller
>
> (
>     [Orden] => Array
>         (
>             [n_orden] => 1
>             [n_admin] => 2
>             [cliente] => dadad
>             [obs_orden] => dadada
>             [obs_estado] => adada
>             [estado] => cerrado
>             [user_id] => 1
>             [fecha_entrega] => Array
>                 (
>                     [month] => 11
>                     [day] => 19
>                     [year] => 2011
>                 )
>
>             [doc] => Array
>                 (
>                     [name] => 5_gsm_web.pdf
>                     [type] => application/pdf
>                     [tmp_name] => /tmp/php0QWesp
>                     [error] => 0
>                     [size] => 700784
>                 )
>
>         )
>
> )
>
>  how i do it.. the controller only take the "[name]" of array
> "doc", because "[name]" will be save into fiel of table
>
> i place also this code for checking according documentation
>
> function isUploadedFile($params){
>     $val = array_shift($params);
>     if ((isset($val['error']) && $val['error'] == 0) ||
>         (!empty( $val['tmp_name']) && $val['tmp_name'] != 'none')
>     ) {
>         return is_uploaded_file($val['tmp_name']);
>     }
>     return false;
>
> }
>
> * how i do the "check flash" for is to be " .doc" and not other
> type file???
>
> thanks
>
> regards

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: cakphp 2.0.3 - whats this for an error message?

2011-11-16 Thread Miles J
Cake 2.0 doesn't show error pages, if I remember correctly, it throws
exceptions now.

Someone correct me if I am wrong :P

On Nov 16, 6:02 pm, Davor Ilic  wrote:
> thats wrong the debuger shows wrong message to me:
>
> *Fatal error*: Call to a member function flash() on a non-object in *
> /srv/www/htdocs/web843/html/schaetzmal/lib/Cake/View/Layouts/default.ctp* on
> line *44*
> *
> *
> it should show me that i don´t have any controller or view but it shows me
> this one.
>
> do any of you had this issue too?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Multilingual Projects and Jquery

2011-11-12 Thread Miles J
Meant "designers".

It was built for people who are mainly designers are not developers.

On Nov 10, 1:22 pm, Thiago Belem  wrote:
> I've nothing against MooTools, but why jQuery is a design framework?
>
> --
> ***Thiago Belem*
> Desenvolvedor
> Rio de Janeiro - RJ - Brasil
>
> +55 (21) 8865.9250
> thiagobelem.net
> cont...@thiagobelem.net
>
> *Skype / gTalk **»* thiago.belem.web
> *LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt*
> Assando Sites*, curso de CakePHP *»* assando-sites.com.br
>
> 2011/11/10 Miles J 
>
>
>
>
>
>
>
> > If you were using MooTools, you could also just use the Locale
> > library.
>
> >http://mootools.net/docs/more/Locale/Locale
>
> > Really wish people would use Moo more over jQuery. jQuery is a designs
> > framework.
>
> > On Nov 10, 1:40 am, AD7six  wrote:
> > > On Nov 9, 7:32 pm, Miles J  wrote:
>
> > > > No there isn't really. This is also a problem for any language, and
> > > > unless you have back-end parsed JS files it's not possible. The only
> > > > solution is so place a JS literal object in your page source
> > > > containing the message strings:
>
> > > > 
> > > > var Msg = {
> > > >         username: '<?php echo __('username'); ?>',
> > > >         someKey: '<?php echo __('moreKeys'); ?>'};
>
> > > > 
>
> > > > And then reference it in your JS:
>
> > > > alert(Msg.username);
>
> > > OR, the other only solution is, to only don't embed things in your
> > > page source. And instead:
>
> > > 1) use __() in your js files
> > > 2) load a js file with that function defined, like this:
> >https://github.com/AD7six/mi_js/blob/master/i18n.js
> > > 3) Define a js object (i18n in the above js file) with your message
> > > definitions in it any way you can/like.
>
> > > That's basically it, and you'll see the same not-only technique used
> > > with, for example, the jquery date picker - see how it works if you
> > > don't understand the above explanation.
>
> > > The simplest cakephp way to generate those i18n js objects is similar
> > > to what Miles suggested: create a controller and route /js/i18n.xx.js
> > > to it. and define a view which returns valid js like this:
>
> > > i18n = {
> > >   'foo' => '',
> > >  ..
>
> > > };
>
> > > Then you don't need to do anything special to be able to generate your
> > > po files and use translations in your js files. You only need to
> > > request /js/i18n.xx.js to change the language of things that come out
> > > of your js files. If you want to parse out the __() calls from your js
> > > files - that's not hard either, some reference (but if you don't
> > > understand - just do the above):
>
> >https://github.com/AD7six/mi_development/blob/master/vendors/shells/t...
>
> > > AD
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Multilingual Projects and Jquery

2011-11-10 Thread Miles J
If you were using MooTools, you could also just use the Locale
library.

http://mootools.net/docs/more/Locale/Locale

Really wish people would use Moo more over jQuery. jQuery is a designs
framework.

On Nov 10, 1:40 am, AD7six  wrote:
> On Nov 9, 7:32 pm, Miles J  wrote:
>
> > No there isn't really. This is also a problem for any language, and
> > unless you have back-end parsed JS files it's not possible. The only
> > solution is so place a JS literal object in your page source
> > containing the message strings:
>
> > 
> > var Msg = {
> >         username: '<?php echo __('username'); ?>',
> >         someKey: '<?php echo __('moreKeys'); ?>'};
>
> > 
>
> > And then reference it in your JS:
>
> > alert(Msg.username);
>
> OR, the other only solution is, to only don't embed things in your
> page source. And instead:
>
> 1) use __() in your js files
> 2) load a js file with that function defined, like 
> this:https://github.com/AD7six/mi_js/blob/master/i18n.js
> 3) Define a js object (i18n in the above js file) with your message
> definitions in it any way you can/like.
>
> That's basically it, and you'll see the same not-only technique used
> with, for example, the jquery date picker - see how it works if you
> don't understand the above explanation.
>
> The simplest cakephp way to generate those i18n js objects is similar
> to what Miles suggested: create a controller and route /js/i18n.xx.js
> to it. and define a view which returns valid js like this:
>
> i18n = {
>   'foo' => '',
>  ..
>
> };
>
> Then you don't need to do anything special to be able to generate your
> po files and use translations in your js files. You only need to
> request /js/i18n.xx.js to change the language of things that come out
> of your js files. If you want to parse out the __() calls from your js
> files - that's not hard either, some reference (but if you don't
> understand - just do the above):
>
> https://github.com/AD7six/mi_development/blob/master/vendors/shells/t...https://github.com/AD7six/mi_js/blob/master/i18n.lang.js
>
> AD

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Multilingual Projects and Jquery

2011-11-09 Thread Miles J
No there isn't really. This is also a problem for any language, and
unless you have back-end parsed JS files it's not possible. The only
solution is so place a JS literal object in your page source
containing the message strings:


var Msg = {
username: '',
someKey: ''
};


And then reference it in your JS:

alert(Msg.username);

On Nov 9, 12:26 am, heohni 
wrote:
> Hi,
>
> I have a multilingual project and I am using the P28n and   __('text'); ?> methods.
>  But I am also doing a lot of Ajax stuff and from time to time I have
>  the need to output text via my javascript files.
>
> Is there anyhow a way / a trick ( how to use the cakephp translation
>  () in my js files?
>
> Thanks! I look forward to your appreciated answers!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Why are file names now CamelCased?

2011-11-03 Thread Miles J
Camel cased file names for PHP classes are the best approach and helps
for simple 1 to 1 autoloading. It's based off of Javas packaging and
naming architecture.

However, camel cased folders are evil.

On Nov 3, 1:16 pm, Thiago Belem  wrote:
> http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html
>
> File and Folder
> naming
>
> In CakePHP 2.0 we rethought the way we are structuring our files and
> folders. Given that PHP 5.3 is supporting namespaces we decided to prepare
> our code base for adopting in a near future this PHP version, so we adopted
> thehttp://groups.google.com/group/php-standards/web/psr-0-final-proposal.
> At first we glanced at the internal structure of CakePHP 1.3 and realized
> that after all these years there was no clear organization in the files,
> nor did the directory structure really hint where each file should be
> located. With this change we would be allowed to experiment a little with
> (almost) automatic class loading for increasing the overall framework
> performance.
>
> Biggest roadblock for achieving this was maintaining some sort of backwards
> compatibility in the way the classes are loaded right now, and we
> definitely did not want to become a framework of huge class prefixes,
> having classnames like My_Huge_Class_Name_In_Package. We decided adopting a
> strategy of keeping simple class names while offering a very intuitive way
> of declaring class locations and clear migration path for future PHP 5.3
> version of CakePHP
> --
> ***Thiago Belem*
> Desenvolvedor
> Rio de Janeiro - RJ - Brasil
>
> +55 (21) 8865.9250
> thiagobelem.net
> cont...@thiagobelem.net
>
> *Skype / gTalk **»* thiago.belem.web
> *LinkedIn* *»* br.linkedin.com/in/thiagobelem/pt*
> Assando Sites*, curso de CakePHP *»* assando-sites.com.br
>
> 2011/11/3 Martin Bean 
>
>
>
>
>
>
>
> > Having been a long-time user of CakePHP 1.3, I was wondering why file and
> > folder names are now CamelCased rather than just being lowercase and
> > underscored?
>
> > Personally, I'm a fan of using lowercase and underscores in filenames
> > (then CamelCase in my actual class declarations) so this change is pretty
> > jarring to me.
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How about using real HTML templates for Form input fields?

2011-11-03 Thread Miles J
Ive always wanted this. Cakes defaults are pretty handy but once you
want to break out of the norm it gets tedious.

I would also change the HTML structure but thats just me :P

@Sherlock - There's not much overhead in doing a basic PHP include.

On Nov 3, 6:21 pm, 100rk  wrote:
> > Those templates could be "theme" specific (like Twitter Bootstrap) and
>
> IMHO only not-so-easy solvable problem with Twitter Bootstrap and cake
> forms is - label wrapped around checkboxes, for both single-ones and
> 'multiple' (wrapped in unordered lists). Rest of it is easy, thanks to
> 'className' key in $helpers and custom aliased YourFormHelper (and
> probably also YourHtmlHelper with either customized $_tags property or
> using 'configFile' configuration setting and proper config file with
> customized and/or added tags in it) where you can inject/set classes/
> divs etc before call of parent class (FormHelper) methods.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: how can i protect my code from the duplicaters

2011-11-03 Thread Miles J
What.

On Nov 3, 10:22 am, ecsyle  wrote:
> Give me the code and I will keep it safe
>
> On Nov 2, 9:56 pm, rizki novian  wrote:
>
>
>
>
>
>
>
> > please help me,,
> > i want to protect my code with key or something like that..
> > can anyone solve my problem??
>
> > thanks
> > regards

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Installer CMS like on CakePHP??

2011-10-28 Thread Miles J
I wrote many installers for Cake and I would highly suggest doing a
shell script.

https://github.com/milesj/cake-forum/blob/master/vendors/shells/install.php

On Oct 28, 7:31 am, Andras Kende  wrote:
> http://cakebaker.42dh.com/2007/04/16/writing-an-installer-for-your-ca...
>
> Andras Kende
>
> On Oct 28, 2011, at 8:59 AM, thom wrote:
>
>
>
>
>
>
>
> > On Fri, Oct 28, 2011 at 5:39 PM, Simon Males  wrote:
> > Croogo has an installer, and its an open source CMS.
>
> >http://croogo.org/
>
> > Haven't only looked at it briefly the installer seems to be a plugin.
>
> > Hmm.. looks like complex enough in croogo. Are there any 'easy' (simple) 
> > way to do it? I mean without YAML (Croogo has it) ..
>
> > --
> > Regards,,,
> > thom
> >http://mynameisthom.blogspot.com
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP 2.0 upgrade - benefit vs pain scale

2011-10-27 Thread Miles J
I would love to see some benchmarks on this. I have a pretty traffic
heavy site that does just fine on 1.3.

And if anything, the speed improvements in 2.0 may be negligible to
notice, especially if caching is on.

On Oct 27, 9:14 am, zuha  wrote:
> It took me 7, 15 hour days to get my app mostly back to normal after the
> upgrade.   Its pretty painful, but the performance upgrade is worth it in
> my opinion.  (1.3 is so slow, its close to unusable for larger
> applications, so far 2.0 has been a substantial upgrade in performance)

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Why use .po files (was: Re: Discussion Question)

2011-10-26 Thread Miles J
POT files are used by the gettext module, which is pretty much the
primary globalization system in PHP.

On Oct 26, 4:31 pm, Ryan Schmidt  wrote:
> On Oct 26, 2011, at 09:02, zuha wrote:
>
> > Okay just have a question I've been curious about for awhile.  What is the 
> > benefit of .pot files instead of say using Google Translate?    I'm also 
> > curious as to whether removing the 1000's of __() functions would have any 
> > performance upgrade in that case.
>
> Are you talking abouthttp://translate.google.com/? Where users can go to view 
> automatic translations of web sites? Surely that's not what you're 
> advocating. Developers should provide web sites with translations that have 
> been vetted by someone who understands the language, and should not rely on 
> users to seek out automatic translation services.
>
> Or do you mean some other Google service for web site developers to translate 
> their sites? If so I'm not familiar with it. But one answer for why one would 
> use .po files instead of such a service is that .po files were around long 
> before web services (and long before the web itself). If you think using a 
> web service would work better for you, then by all means use it.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How can I override the method __d() ?

2011-10-23 Thread Miles J
Bootstrap would be the best location.

On Oct 23, 11:05 am, santos  wrote:
>  in bootstrap file? Or the correct is in the View Helper?
>
> Thanks.
>
> --
> View this message in 
> context:http://cakephp.1045679.n5.nabble.com/How-can-I-override-the-method-d-...
> Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: 2.0 view folders naming convention

2011-10-23 Thread Miles J
The problem I have is that the "app" folder uses the capitalized
folder scheme. I could care less how the Cake core does it, but now
there is another standard/convention for dev implementation. Why are
folders that have nothing to do with PHP classes being capitalized?
Doesn't look like you have a real reason for that. And on that point,
why are some lowercase and not capitalized? Looks like another
consistency problem.

@Jeremy - I don't develop in Cake anymore so I will never use 2.0. I
merely was gonna upgrade a few old apps but now have 0 interest in
doing so.

@Larry - None of what you said has any explanation as to why the app
uses this standard. Furthermore, the PHP standards says nothing about
folder capitalization, that was your choice.

@majna - I'm speaking more from Java's packaging/namespacing schema,
which is far cleaner and easier to me.

It all boils down to someone or some project that started
capitalizing, like Zend, and everyone jumped on the band wagon because
they see some very popular project do it.

On Oct 22, 2:43 am, majna  wrote:
> I'm building on 2.0 for 10 months now and I like new folder convention. I
> don't wanna ever go back :)
>
> Only upgrade issue I had was SVN on Windows (case insensitive) but git-svn
> and upgrade shell is a way to go.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: 2.0 view folders naming convention

2011-10-21 Thread Miles J
Oh you mean the PHP standards group? CakePHP is far from following
that.

I think capitalized folder names are the worst kinds of implementation
and now making every folder work that way? Stupid. Yet still having
some folders not capitalized? Stupid and inconsistent. For one thing,
it requires me to hit shift multitudes more than I have to, which I
already hate doing for $this->Model and every other library. Secondly,
folders are nothing more than transparent packing of shared classes,
they are not first-class and SHOULD not be getting first class
treatment. Its logical to have class file names uppercase and
normalized as to match the class name itself, for easy lookup... you
know, like actual programming languages like Java. Its mind-blowing
that the "app" folder should require this.

I am going to assume that the reason they used uppercase folders is to
match the file loading system they implemented in 2.0, to make it
easier to match locations. Thats another problem, why are you using
uppercase arguments as well? Constants people or a better autoloader.
This was the perfect chance for CakePHP to use PHP 5.3 and ditch all
the auto-magic bullshit they built into the core to mimic namespaces
and organized packaging... but for some reason they didnt, chance
lost. Now Zend 2 and Symfony 2 will be ahead of the game.

I could keep going but I am sure you get the jist. I was going to
upgrade to 2.0 for fun but no longer have the interest and its not
like I build new apps from scratch anyways. Take it or leave it.

On Oct 21, 12:26 am, Matt Kaufman  wrote:
> Great; Ditch PHP 5 Standards too
>
> Sent from my iPhone
>
> On Oct 21, 2011, at 12:08 AM, Miles J  wrote:
>
>
>
>
>
>
>
> > Oh my that is a god awful format. Looks like I am not upgrading.
>
> > On Oct 20, 11:28 pm, Andras Kende  wrote:
> >> Directories Capitalized, files lowercase :)
>
> >> Andras Kende
>
> >> On Oct 21, 2011, at 1:18 AM, Miles J wrote:
>
> >>> Wait, so is uppercase folder names for views standard now?
>
> >>> :/
>
> >>> Not upgrading if so.
>
> >>> On Oct 20, 11:13 pm, Jeremy Burns | Class Outfit
> >>>  wrote:
> >>>> How bad was my English/typing there? Poor form...let me redo that one.
>
> >>>> This is an upgraded application that I am working on that still has 
> >>>> remnants of old code. The users controller still contains var $name = 
> >>>> 'User', which was causing the error. Worth pointing out for others who 
> >>>> are doing an upgrade as the upgrade shell didn't remove it.
>
> >>>> There, that's better.
>
> >>>> Jeremy Burns
> >>>> Class Outfit
>
> >>>> Tel: +44 (0) 208 123 3822
> >>>> Mob: +44 (0) 7973 481949
> >>>> Skype: jeremy_burnshttp://www.classoutfit.com
>
> >>>> Jeremy Burns
> >>>> Class Outfit
>
> >>>>http://www.classoutfit.com
>
> >>>> On 21 Oct 2011, at 07:03, Jeremy Burns | Class Outfit wrote:
>
> >>>>> No caching enabled, but I worked it out.
>
> >>>>> This is an upgraded application that I working that still lots of 
> >>>>> remnants of old code. The users controller still var $name = 'User', 
> >>>>> which was causing the error. Worth pointing out for others who are 
> >>>>> doing an upgrade as the upgrade shell didn't remove it.
>
> >>>>> Jeremy Burns
> >>>>> Class Outfit
>
> >>>>>http://www.classoutfit.com
>
> >>>>> On 21 Oct 2011, at 06:54, Andras Kende wrote:
>
> >>>>>> app/View/Users/add.ctp is correct.
>
> >>>>>> Maybe cache is mixed up, try with debug=2  ..
>
> >>>>>> Andras
>
> >>>>>> On Oct 21, 2011, at 12:43 AM, Jeremy Burns wrote:
>
> >>>>>>> In the tutorial, the add user form is called  (in other words, in a Users folder). When you run it the
> >>>>>>> code complains that it can't find app/View/User/add.ctp (in other
> >>>>>>> words, its looking in the User folder). The documentation around
> >>>>>>> naming convention is not clear on this subject. Which is correct?
>
> >>>>>>> --
> >>>>>>> Our newest site for the community: CakePHP Video 
> >>>>>>> Tutorialshttp://tv.cakephp.org
> >>>>>>> Check out the new CakePHP Questions 
> >>>>>>> sitehttp://ask.cakephp.organ

Re: 2.0 view folders naming convention

2011-10-21 Thread Miles J
Oh my that is a god awful format. Looks like I am not upgrading.

On Oct 20, 11:28 pm, Andras Kende  wrote:
> Directories Capitalized, files lowercase :)
>
> Andras Kende
>
> On Oct 21, 2011, at 1:18 AM, Miles J wrote:
>
>
>
>
>
>
>
> > Wait, so is uppercase folder names for views standard now?
>
> > :/
>
> > Not upgrading if so.
>
> > On Oct 20, 11:13 pm, Jeremy Burns | Class Outfit
> >  wrote:
> >> How bad was my English/typing there? Poor form...let me redo that one.
>
> >> This is an upgraded application that I am working on that still has 
> >> remnants of old code. The users controller still contains var $name = 
> >> 'User', which was causing the error. Worth pointing out for others who are 
> >> doing an upgrade as the upgrade shell didn't remove it.
>
> >> There, that's better.
>
> >> Jeremy Burns
> >> Class Outfit
>
> >> Tel: +44 (0) 208 123 3822
> >> Mob: +44 (0) 7973 481949
> >> Skype: jeremy_burnshttp://www.classoutfit.com
>
> >> Jeremy Burns
> >> Class Outfit
>
> >>http://www.classoutfit.com
>
> >> On 21 Oct 2011, at 07:03, Jeremy Burns | Class Outfit wrote:
>
> >>> No caching enabled, but I worked it out.
>
> >>> This is an upgraded application that I working that still lots of 
> >>> remnants of old code. The users controller still var $name = 'User', 
> >>> which was causing the error. Worth pointing out for others who are doing 
> >>> an upgrade as the upgrade shell didn't remove it.
>
> >>> Jeremy Burns
> >>> Class Outfit
>
> >>>http://www.classoutfit.com
>
> >>> On 21 Oct 2011, at 06:54, Andras Kende wrote:
>
> >>>> app/View/Users/add.ctp is correct.
>
> >>>> Maybe cache is mixed up, try with debug=2  ..
>
> >>>> Andras
>
> >>>> On Oct 21, 2011, at 12:43 AM, Jeremy Burns wrote:
>
> >>>>> In the tutorial, the add user form is called  (in other words, in a Users folder). When you run it the
> >>>>> code complains that it can't find app/View/User/add.ctp (in other
> >>>>> words, its looking in the User folder). The documentation around
> >>>>> naming convention is not clear on this subject. Which is correct?
>
> >>>>> --
> >>>>> Our newest site for the community: CakePHP Video 
> >>>>> Tutorialshttp://tv.cakephp.org
> >>>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
> >>>>> others with their CakePHP related questions.
>
> >>>>> To unsubscribe from this group, send email to
> >>>>> cake-php+unsubscr...@googlegroups.com For more options, visit this 
> >>>>> group athttp://groups.google.com/group/cake-php
>
> >>>> --
> >>>> Our newest site for the community: CakePHP Video 
> >>>> Tutorialshttp://tv.cakephp.org
> >>>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
> >>>> others with their CakePHP related questions.
>
> >>>> To unsubscribe from this group, send email to
> >>>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >>>> athttp://groups.google.com/group/cake-php
>
> >>> --
> >>> Our newest site for the community: CakePHP Video 
> >>> Tutorialshttp://tv.cakephp.org
> >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
> >>> others with their CakePHP related questions.
>
> >>> To unsubscribe from this group, send email to
> >>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >>> athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: 2.0 view folders naming convention

2011-10-20 Thread Miles J
Wait, so is uppercase folder names for views standard now?

:/

Not upgrading if so.

On Oct 20, 11:13 pm, Jeremy Burns | Class Outfit
 wrote:
> How bad was my English/typing there? Poor form...let me redo that one.
>
> This is an upgraded application that I am working on that still has remnants 
> of old code. The users controller still contains var $name = 'User', which 
> was causing the error. Worth pointing out for others who are doing an upgrade 
> as the upgrade shell didn't remove it.
>
> There, that's better.
>
> Jeremy Burns
> Class Outfit
>
> Tel: +44 (0) 208 123 3822
> Mob: +44 (0) 7973 481949
> Skype: jeremy_burnshttp://www.classoutfit.com
>
> Jeremy Burns
> Class Outfit
>
> http://www.classoutfit.com
>
> On 21 Oct 2011, at 07:03, Jeremy Burns | Class Outfit wrote:
>
>
>
>
>
>
>
> > No caching enabled, but I worked it out.
>
> > This is an upgraded application that I working that still lots of remnants 
> > of old code. The users controller still var $name = 'User', which was 
> > causing the error. Worth pointing out for others who are doing an upgrade 
> > as the upgrade shell didn't remove it.
>
> > Jeremy Burns
> > Class Outfit
>
> >http://www.classoutfit.com
>
> > On 21 Oct 2011, at 06:54, Andras Kende wrote:
>
> >> app/View/Users/add.ctp is correct.
>
> >> Maybe cache is mixed up, try with debug=2  ..
>
> >> Andras
>
> >> On Oct 21, 2011, at 12:43 AM, Jeremy Burns wrote:
>
> >>> In the tutorial, the add user form is called  (in other words, in a Users folder). When you run it the
> >>> code complains that it can't find app/View/User/add.ctp (in other
> >>> words, its looking in the User folder). The documentation around
> >>> naming convention is not clear on this subject. Which is correct?
>
> >>> --
> >>> Our newest site for the community: CakePHP Video 
> >>> Tutorialshttp://tv.cakephp.org
> >>> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> >>> others with their CakePHP related questions.
>
> >>> To unsubscribe from this group, send email to
> >>> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >>> athttp://groups.google.com/group/cake-php
>
> >> --
> >> Our newest site for the community: CakePHP Video 
> >> Tutorialshttp://tv.cakephp.org
> >> Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> >> others with their CakePHP related questions.
>
> >> To unsubscribe from this group, send email to
> >> cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> >> athttp://groups.google.com/group/cake-php
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Constant mysqli warnings

2011-10-19 Thread Miles J
So my error.log is littered with all these warnings. I spent some time
going through all my code and could not locate anything wrong on my
end. Is anyone else getting these? (Before I start digging into the
Cake core). I am using 1.3.8.

2011-10-19 21:19:03 Warning: Warning (2): mysqli_get_server_info()
expects parameter 1 to be mysqli, boolean given in [/var/www/cake/cake/
libs/model/datasources/dbo/dbo_mysqli.php, line 69]
2011-10-19 21:19:03 Warning: Warning (2): mysqli_real_escape_string()
expects parameter 1 to be mysqli, boolean given in [/var/www/cake/cake/
libs/model/datasources/dbo/dbo_mysqli.php, line 195]
2011-10-19 21:19:03 Warning: Warning (2): mysqli_query() expects
parameter 1 to be mysqli, boolean given in [/var/www/cake/cake/libs/
model/datasources/dbo/dbo_mysqli.php, line 109]
2011-10-19 21:19:03 Warning: Warning (2): mysqli_errno() expects
parameter 1 to be mysqli, boolean given in [/var/www/cake/cake/libs/
model/datasources/dbo/dbo_mysqli.php, line 208]
2011-10-19 21:19:03 Warning: Warning (2): mysqli_real_escape_string()
expects parameter 1 to be mysqli, boolean given in [/var/www/cake/cake/
libs/model/datasources/dbo/dbo_mysqli.php, line 195]
2011-10-19 21:19:03 Warning: Warning (2): mysqli_real_escape_string()
expects parameter 1 to be mysqli, boolean given in [/var/www/cake/cake/
libs/model/datasources/dbo/dbo_mysqli.php, line 195]
2011-10-19 21:19:03 Warning: Warning (2): mysqli_query() expects
parameter 1 to be mysqli, boolean given in [/var/www/cake/cake/libs/
model/datasources/dbo/dbo_mysqli.php, line 109]
2011-10-19 21:19:03 Warning: Warning (2): mysqli_errno() expects
parameter 1 to be mysqli, boolean given in [/var/www/cake/cake/libs/
model/datasources/dbo/dbo_mysqli.php, line 208]
2011-10-19 21:19:03 Warning: Warning (2): mysqli_query() expects
parameter 1 to be mysqli, boolean given in [/var/www/cake/cake/libs/
model/datasources/dbo/dbo_mysqli.php, line 109]
2011-10-19 21:19:03 Warning: Warning (2): mysqli_errno() expects
parameter 1 to be mysqli, boolean given in [/var/www/cake/cake/libs/
model/datasources/dbo/dbo_mysqli.php, line 208]
2011-10-19 21:19:03 Warning: Warning (2): mysqli_query() expects
parameter 1 to be mysqli, boolean given in [/var/www/cake/cake/libs/
model/datasources/dbo/dbo_mysqli.php, line 109]
2011-10-19 21:19:03 Warning: Warning (2): mysqli_errno() expects
parameter 1 to be mysqli, boolean given in [/var/www/cake/cake/libs/
model/datasources/dbo/dbo_mysqli.php, line 208]

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How can I override the method __d() ?

2011-10-19 Thread Miles J
You shouldnt override it.

Cant you just do: $var = array(__d());

Or make your own function?

function ___d() { }

On Oct 19, 10:19 am, santos  wrote:
> How can I override the method __d() ?
>
> I need to put the msg of  __d() in array to use in the botton of the page.
>
> Where can I override this methos? in appcontroller?
>
> Thanks
>
> --
> View this message in 
> context:http://cakephp.1045679.n5.nabble.com/How-can-I-override-the-method-d-...
> Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Handling Timezones in cakephp

2011-10-17 Thread Miles J
I dont agree with #2. Time should always be saved to the database as
UTC, and then on the front-end converted to the timezone.

The TimeHelper supports passing a timezone (e.g., -8) as a param and
formats accordingly.

On Oct 17, 6:13 am, David Kullmann  wrote:
> Sorry for emailing you directly - I meant to reply on this forum but
> hit the wrong button.
>
> You should follow these rules:
>
> 1. All times in the database should always be UTC
>
> 2. beforeSave and afterFind you should always convert the times to the
> users time zone
>
> 3. You should never have a time which is not accompanied by it's time
> zone. This is a little unrealistic to do unless you have a class that
> is available everywhere and stores the current time zone for you
>
> All of these things are built into the very light-weight 
> plugin:https://github.com/jamiemill/cakephp_localize_timewhich is what I use
> for my application.
>
> -DK
>
> On Oct 16, 5:11 pm, jovial  wrote:
>
>
>
>
>
>
>
> > I have added a timezone field on user sign up page.Now when a tutor
> > logins then he will fill his timezone and will also fill his
> > availability(timinings he will be available in a week)
> > Now there is a functionality of FINDING A TUTOR .Any 1 ho wishes to
> > search a tutor will enter start date start time end date end time.Now
> > how should I handle this task???what conditions am I supposed to
> > give...Any responses will be appreciated.Thanks In advance.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: CakePHP 2.0 Released

2011-10-17 Thread Miles J
Welp, time to convert all my scripts, haha.

On Oct 17, 9:55 am, mark_story  wrote:
> Hey Derek,
>
> My current plan is to continue releasing bugfix/maintenance releases
> at least until 3.0 comes out.  The frequency of releases will depend
> on the flow of tickets though.  Security issues will be addressed in
> 1.2 and 1.3 forever, despite any other maintenance release plans.
>
> -Mark
>
> On Oct 17, 1:40 am, DerekGardiner  wrote:
>
>
>
>
>
>
>
> > How long with cake 1.3* be supported? We've just spent a significant
> > amount of time writing an application in 1.3* and would be gutted to
> > find out if we have to port to 2.0 already.
>
> > On Oct 16, 11:40 pm, "O.J. Tibi"  wrote:
>
> > > Yeah! Rave party everywhere for CakePHP 2.0! Wuzah!

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


  1   2   3   4   5   6   7   8   9   10   >