Re: ini_set

2012-06-28 Thread Dr. Tarique Sani
bootstrap.php

T

On Fri, Jun 29, 2012 at 10:53 AM, Milina Udara  wrote:
> where  we can put
> ini_set("upload_max_filesize", "4M");
> ini_set("post_max_size","10M");
>
>  in cakephp?
> is it working for configure the ini file
>
> --
> 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



-- 
=
PHP for E-Biz: http://sanisoft.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


ini_set

2012-06-28 Thread Milina Udara
where  we can put 
ini_set("upload_max_filesize", "4M"); 
ini_set("post_max_size","10M");  

 in cakephp? 
is it working for configure the ini file

-- 
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


Routes with slugs, pagination problem

2012-06-28 Thread Ovidiu Marinoiu
Hello,

I have created a route which looks like this Router::connect('/:slug', 
array('controller' => 'categories', 'action' => 'view'), array('pass' => 
array('slug')));

Until here, everything works okey, visiting the 
link http://example.com/animals-and-pets, works perfect.

On this page I have a pagination and this gives me e big problem, the links 
for the pages, are generating wrong, like 
this: http://example.com/categories/view/animals-and-pets/page:2.

The result that I want to obtain is http://example.com/animals-and-pets/2.

Thanks for your help 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


Undefined index after web host install.

2012-06-28 Thread Guti Grewal
Hi I've uploaded my website on a free hosting site called 000webhost, it 
works fine on localhost but however when I try to upload a file to the 
server using a form I get thrown this error.

*Notice* (8): Undefined index:  Upload [*APP/Controller/UploadsController.php*, 
line *32*]
Code

UploadsController::add() - APP/Controller/UploadsController.php, line 32
ReflectionMethod::invokeArgs() - [internal], line ??
Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 485
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 103
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 85
[main] - APP/webroot/index.php, line 96


I can't for the life of me figure out what is going wrong?

I've set the permissions for the webroot/files/uploads folder to 777, so it 
can't possibly be that. 

Anyone have 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: Captcha

2012-06-28 Thread Super Idea
I am using Math captcha in cakephp1.3 and cakephp2.1.3 and it meets all my
requirement.
May be you can have a look
http://bakery.cakephp.org/articles/jnay/2010/01/20/simple-math-question-captcha-component

On Thu, Jun 28, 2012 at 11:02 AM, Mr. Manager  wrote:

> Dear All,
>
> I have problem with using captcha to validate form data and so I hope that
> someone will has solution.
>
> I am thanks a lot in advance!
>
> Yours Sincerely,
> 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
>

-- 
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: images, styles all break when installing in web server root

2012-06-28 Thread Super Idea
Is this a case of virtual hosting on this server and if yes, what is the
document root. Because if your site in /test was working so I assume it was
document root was good. Also what is the logs of apache complains about ?

On Thu, Jun 28, 2012 at 10:23 PM, Bob Bowen  wrote:

> Correction. It's not just the images that don't work. It's the whole web.
> Navigation, styles, you name it. Now when I click on News, it brings me to
> mywebb.com/news, and says it doesn't exist.
>
> I'm going a bit nuts here. As I said, this all works fine when it's in a
> sub-directory. Why is putting it in the root directory so different?
>
> It's not clear to me if I *need* to use mod_rewrite / .htaccess or if
> it's simply *recommended*. Because I don't think my provider is going to
> let me change this.
>
> Any help on this much much appreciated.
>
> Bob
>
>
> On Thursday, June 28, 2012 10:15:37 PM UTC+2, Bob Bowen wrote:
>>
>> I've had a cake 2.0 install running for some time on my hosted web
>> server. I installed it in /test/cakephp. All was well. I didn't have to use
>> .htaccess or anything. And I haven't messed with APP_DIR, ROOT or
>> WEBROOT_DIR.
>>
>> When using an Html->Image tage my images would have the path:
>>
>> /test/cakephp/img/logo.png
>>
>> Internally Cake did the "magic" that transforms "img" to
>> "/test/cakephp/app/webroot/**img", where it is physically located.
>>
>> Now I've put my Cake install in the root of my webserver (/html) and my
>> images and styles are all broken.
>>
>> I am using all of the default Cake directory names - app, lib, plugins
>> and vendors, and they are all in the web server root dir.
>>
>> The page itself loads, so it seems the index.php in the root is working,
>> it finds Cake, etc. But my images now have the path:
>>
>> /img/logo.png
>>
>> ... and the "magic" has died. My server now seems to be looking for the
>> images *physically* in /img, but of course they are actually in
>> /app/webroot/img.
>>
>> How can I fix this? I tried copying the default .htaccess, the one that
>> comes with the Cake download, but my server chokes on it. Apparently I
>> can't use .htaccess. I don't see any reference to mod_rewrite in phpinfo()
>> so I gues my provider doesn't support it.
>>
>> Ideally I would like to get this to work *without* using .htaccess or
>> changing the DocumentRoot in my apache config. What I don't get is, in the
>> index.php it says:
>>
>> This file collects requests if: - no mod_rewrite is available or
>> .htaccess files are not supported
>>
>> Well, this seems to be my case. Is there anything special I need to do to
>> get this working?
>>
>> Any help?
>>
>> Thanks!
>>
>
> On Thursday, June 28, 2012 10:15:37 PM UTC+2, Bob Bowen wrote:
>>
>> I've had a cake 2.0 install running for some time on my hosted web
>> server. I installed it in /test/cakephp. All was well. I didn't have to use
>> .htaccess or anything. And I haven't messed with APP_DIR, ROOT or
>> WEBROOT_DIR.
>>
>> When using an Html->Image tage my images would have the path:
>>
>> /test/cakephp/img/logo.png
>>
>> Internally Cake did the "magic" that transforms "img" to
>> "/test/cakephp/app/webroot/**img", where it is physically located.
>>
>> Now I've put my Cake install in the root of my webserver (/html) and my
>> images and styles are all broken.
>>
>> I am using all of the default Cake directory names - app, lib, plugins
>> and vendors, and they are all in the web server root dir.
>>
>> The page itself loads, so it seems the index.php in the root is working,
>> it finds Cake, etc. But my images now have the path:
>>
>> /img/logo.png
>>
>> ... and the "magic" has died. My server now seems to be looking for the
>> images *physically* in /img, but of course they are actually in
>> /app/webroot/img.
>>
>> How can I fix this? I tried copying the default .htaccess, the one that
>> comes with the Cake download, but my server chokes on it. Apparently I
>> can't use .htaccess. I don't see any reference to mod_rewrite in phpinfo()
>> so I gues my provider doesn't support it.
>>
>> Ideally I would like to get this to work *without* using .htaccess or
>> changing the DocumentRoot in my apache config. What I don't get is, in the
>> index.php it says:
>>
>> This file collects requests if: - no mod_rewrite is available or
>> .htaccess files are not supported
>>
>> Well, this seems to be my case. Is there anything special I need to do to
>> get this working?
>>
>> Any help?
>>
>> 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
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org a

Re: Routes vs Type checking for Action Parameters, best practice?

2012-06-28 Thread Kamisama
"Why do that in two places?"

Because it does not do the same thing.

You always have to validate the $id in the controller, since as already 
said, the $id can be a perfect integer, but does not exist in the database.

I assume your example in the router file will be like that :

Router::connect('/books/view/:id', array('controller'=>'books', 
'action'=>'view'), array('pass' => array('id'), 'id' => '[0-9]+?'));

There's no benefits of enforcing a numeric validation on the ID in this 
case. But if you have routes like that :

Router::connect('/books/:id', array('controller'=>'books', 
'action'=>'view'), array('pass' => array('id'), 'id' => '[0-9]+?'));
Router::connect('/books/:action', array('controller'=>'books', 
'action'=>'add'));

making sure the id is numeric is necessary, else the second route will 
never be read, and all your url like "books/add", or whatever will be 
redirect to the view action.

Type validation in the routes are to redirect the flow to the right action 
in the right controller, for the routes that can be ambiguous. 

-- 
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


CakePhp 2.1.3 Training

2012-06-28 Thread regai Kanongota
hi,

I am looking for training on cakePhp and i have at least 6 developers I
want to get trained but i am not coming across any trainers for this
framework in my country-Zimbabwe. would you please help me with contacts of
reputable trainers or training centres for cakephp as i dont want to take
chances lest the project i am working on will fail. We accept freelance
trainers as long as they can deliver.

Thanks in advance.

-- 
Que Dieu vous bénisse,

Regai Kanongota
00263772105204

-- 
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


CakePHP home page after Bake is Blank

2012-06-28 Thread Miles G
Hi, I'm working with cakephp version 2.1.3. I can make a project and make 
my model/controller/view and it all connects to database and works fine. As 
soon as I bake a project and try to access the home page it's a blank page.

I've tried deleting my cache files (not directories), and it didn't help.

I don't think the bake is working correctly - Screenshot

You can see in the picture it is asking me if I want to overwrite a file, 
but the folder "Items" didn't exist until I did "cake bake Items", so I 
don't see how it has anything to overwrite?

Blank screen  - This should be cake's default home 
page where it tells you your php version, that you are connected to the 
database, etc.

It seems to me like there is some sort of bug with cake bake?


-- 
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: images, styles all break when installing in web server root

2012-06-28 Thread Bob Bowen
Correction. It's not just the images that don't work. It's the whole web. 
Navigation, styles, you name it. Now when I click on News, it brings me to 
mywebb.com/news, and says it doesn't exist.

I'm going a bit nuts here. As I said, this all works fine when it's in a 
sub-directory. Why is putting it in the root directory so different?

It's not clear to me if I *need* to use mod_rewrite / .htaccess or if it's 
simply *recommended*. Because I don't think my provider is going to let me 
change this.

Any help on this much much appreciated.

Bob

On Thursday, June 28, 2012 10:15:37 PM UTC+2, Bob Bowen wrote:
>
> I've had a cake 2.0 install running for some time on my hosted web server. 
> I installed it in /test/cakephp. All was well. I didn't have to use 
> .htaccess or anything. And I haven't messed with APP_DIR, ROOT or 
> WEBROOT_DIR.
>
> When using an Html->Image tage my images would have the path:
>
> /test/cakephp/img/logo.png
>
> Internally Cake did the "magic" that transforms "img" to 
> "/test/cakephp/app/webroot/img", where it is physically located.
>
> Now I've put my Cake install in the root of my webserver (/html) and my 
> images and styles are all broken.
>
> I am using all of the default Cake directory names - app, lib, plugins and 
> vendors, and they are all in the web server root dir.
>
> The page itself loads, so it seems the index.php in the root is working, 
> it finds Cake, etc. But my images now have the path:
>
> /img/logo.png
>
> ... and the "magic" has died. My server now seems to be looking for the 
> images *physically* in /img, but of course they are actually in 
> /app/webroot/img.
>
> How can I fix this? I tried copying the default .htaccess, the one that 
> comes with the Cake download, but my server chokes on it. Apparently I 
> can't use .htaccess. I don't see any reference to mod_rewrite in phpinfo() 
> so I gues my provider doesn't support it.
>
> Ideally I would like to get this to work *without* using .htaccess or 
> changing the DocumentRoot in my apache config. What I don't get is, in the 
> index.php it says:
>
> This file collects requests if: - no mod_rewrite is available or .htaccess 
> files are not supported
>
> Well, this seems to be my case. Is there anything special I need to do to 
> get this working?
>
> Any help?
>
> Thanks!
>

On Thursday, June 28, 2012 10:15:37 PM UTC+2, Bob Bowen wrote:
>
> I've had a cake 2.0 install running for some time on my hosted web server. 
> I installed it in /test/cakephp. All was well. I didn't have to use 
> .htaccess or anything. And I haven't messed with APP_DIR, ROOT or 
> WEBROOT_DIR.
>
> When using an Html->Image tage my images would have the path:
>
> /test/cakephp/img/logo.png
>
> Internally Cake did the "magic" that transforms "img" to 
> "/test/cakephp/app/webroot/img", where it is physically located.
>
> Now I've put my Cake install in the root of my webserver (/html) and my 
> images and styles are all broken.
>
> I am using all of the default Cake directory names - app, lib, plugins and 
> vendors, and they are all in the web server root dir.
>
> The page itself loads, so it seems the index.php in the root is working, 
> it finds Cake, etc. But my images now have the path:
>
> /img/logo.png
>
> ... and the "magic" has died. My server now seems to be looking for the 
> images *physically* in /img, but of course they are actually in 
> /app/webroot/img.
>
> How can I fix this? I tried copying the default .htaccess, the one that 
> comes with the Cake download, but my server chokes on it. Apparently I 
> can't use .htaccess. I don't see any reference to mod_rewrite in phpinfo() 
> so I gues my provider doesn't support it.
>
> Ideally I would like to get this to work *without* using .htaccess or 
> changing the DocumentRoot in my apache config. What I don't get is, in the 
> index.php it says:
>
> This file collects requests if: - no mod_rewrite is available or .htaccess 
> files are not supported
>
> Well, this seems to be my case. Is there anything special I need to do to 
> get this working?
>
> Any help?
>
> 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


CakePhp 2.0: images, styles all break when installing in web server root

2012-06-28 Thread Bob Bowen


I've had a cake 2.0 install running for some time on my hosted web server. 
I installed it in /test/cakephp. All was well. I didn't have to use 
.htaccess or anything. And I haven't messed with APP_DIR, ROOT or 
WEBROOT_DIR.

When using an Html->Image tage my images would have the path:

/test/cakephp/img/logo.png

Internally Cake did the "magic" that transforms "img" to 
"/test/cakephp/app/webroot/img", where it is physically located.

Now I've put my Cake install in the root of my webserver (/html) and my 
images and styles are all broken.

I am using all of the default Cake directory names - app, lib, plugins and 
vendors, and they are all in the web server root dir.

The page itself loads, so it seems the index.php in the root is working, it 
finds Cake, etc. But my images now have the path:

/img/logo.png

... and the "magic" has died. My server now seems to be looking for the 
images *physically* in /img, but of course they are actually in 
/app/webroot/img.

How can I fix this? I tried copying the default .htaccess, the one that 
comes with the Cake download, but my server chokes on it. Apparently I 
can't use .htaccess. I don't see any reference to mod_rewrite in phpinfo() 
so I gues my provider doesn't support it.

Ideally I would like to get this to work *without* using .htaccess or 
changing the DocumentRoot in my apache config. What I don't get is, in the 
index.php it says:

This file collects requests if: - no mod_rewrite is available or .htaccess 
files are not supported

Well, this seems to be my case. Is there anything special I need to do to 
get this working?

Any help?

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: Is there a lighter weight alternative to requestAction?

2012-06-28 Thread Mark Wratten
That's the dilemma we are facing. The traditional MVC paradigm where a URL 
maps to a controller and action is fine for simple sites, but for more 
complex sites the model falls apart. Our site started as a straightforward 
MVC design, but then the users wanted to add their own landing pages and 
control what appears on each page. It is not practical to create a new 
controller/action/view for each new landing page so the site became a 
hybrid of traditional MVC and a CMS with the ability to embed active 
content.

@Florian, that's essentially what we are doing. For the updated design, we 
are routing all requests to a single controller/action/view and using a 
Helper to embed modules in the content. The module positions are 
represented by tokens in the content, so we don't know which modules to 
load until rendering the view. As most of the modules are active content we 
need to use requestAction to assemble the module content from data in the 
database and render in the view. Because requestAction loads a new 
environment it adds a significant overhead especially when loading a lot of 
modules. And it also involves a bit of a kludge to change the routing on 
the fly. It is working, but I feel it could be done in a cleaner, simpler, 
more efficient way, but I am struggling how to figure out how to do that 
and stay within the Cake paradigm.

Mark

-- 
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: Routes vs Type checking for Action Parameters, best practice?

2012-06-28 Thread Poyan Nabati
"I think you're not using routes in their purest form (to route stuff in 
the right way - rather than error trapping". 

Thing is, if you haven't supplied an integer, then there's really no 
matching action for the URL you've requested. I think that's completely in 
line with the purpose of routes. 

That is, if you supply a non-integer, then you haven't really matched any 
existing action, so you're redirected to an error or a default page.

Since PHP doesn't really have strict typing, maybe I could settle for "if 
you haven't passed the right number of parameters, there's no matching 
action".

"Why do that in two places?"

I think it could result in cleaner code since you can be sure of the type 
and amount of input you receive in each action.

Don't you agree?

-- 
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: Can't Connect to Database (CakePHP 1.3 -> 2.1.3 Migration)

2012-06-28 Thread Miles G
I figured out how to get it connected. I had to download some drivers (
http://www.php.net/manual/en/ref.pdo-sqlsrv.php)  for my php directory for 
it to connect.


-- 
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: Can't Connect to Database (CakePHP 1.3 -> 2.1.3 Migration)

2012-06-28 Thread Miles G
Sorry about that, I mixed that up the OS is Windows 2003 and I thought the 
Microsoft SQL server was 2003, but I just looked and it's 2005. 

On Thursday, June 28, 2012 9:16:51 AM UTC-5, PaulW wrote:
>
> Okay, just you said earlier "The database is on a separate computer using 
> Microsoft SQL Server 2003 (on Windows 2003)"
>
>
> On 28 Jun 2012, at 15:08, Miles G wrote:
>
> My Microsoft SQL server is currently the 2005 version, but then again I 
> wouldn't be surprised if that's too old as well?
>
> On Thursday, June 28, 2012 4:35:01 AM UTC-5, PaulW wrote:
>>
>> Hi
>>
>> I would suggest that your version of Microsoft SQL Server is too 
>> old. From the database.php default files...
>>
>>
>> 1.3.15
>>  * mssql - Microsoft SQL Server 2000 and higher,
>>
>> 2.1.3
>>  * Database/Sqlserver - Microsoft SQL Server 2005 and higher
>>
>>
>> Cheers
>>
>> Paul
>>
>> On 27 Jun 2012, at 19:26, Miles G wrote:
>>
>> Thanks for pointing that out cricket; however, I am still getting the 
>> same error message after fixing that.
>>
>> On Wednesday, June 27, 2012 11:15:16 AM UTC-5, cricket wrote:
>>>
>>> You have the port value as a string. Try removing the quotes. 
>>>
>>> On Wed, Jun 27, 2012 at 10:23 AM, Miles G  wrote: 
>>> > Hi, I'm trying to figure out what possible problem could be causing me 
>>> not 
>>> > to connect to my db on the 2.1.3 version. I connect just fine on the 
>>> 1.3 
>>> > version and the only big changes I notice in the database.php file is 
>>> the 
>>> > difference of 'host' => 'mssql' in the 1.3 version compared to 
>>> 'datasource' 
>>> > => in the 2.1.3 version. Here is a pastie.org link to get more info 
>>> and see 
>>> > what happens for me as well as my database.php file for the different 
>>> > versions. 
>>> > 
>>> > http://pastie.org/4154510 
>>> > 
>>> > Just to clarify, the new version was a fresh download where the only 
>>> changes 
>>> > I made were the hashing security part in the core file and then 
>>> modifying 
>>> > database.php. The database is on a separate computer using Microsoft 
>>> SQL 
>>> > Server 2003 (on Windows 2003) and the OS where the project is stored 
>>> is also 
>>> > on another computer with Windows 2003. There are 0 problems with 
>>> connecting 
>>> > to the database on the 1.3 version just to say one more time! 
>>> > 
>>> > Let me know if you see something that could be causing this or if you 
>>> need 
>>> > more information ! 
>>> > 
>>> > Thanks, 
>>> > 
>>> > Miles 
>>> > 
>>> > -- 
>>> > 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 
>>>
>>
>> -- 
>> 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
>>
>>
>>
> -- 
> 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
>
>
>

-- 
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: Can't Connect to Database (CakePHP 1.3 -> 2.1.3 Migration)

2012-06-28 Thread Paul Willis
Okay, just you said earlier "The database is on a separate computer using 
Microsoft SQL Server 2003 (on Windows 2003)"


On 28 Jun 2012, at 15:08, Miles G wrote:

> My Microsoft SQL server is currently the 2005 version, but then again I 
> wouldn't be surprised if that's too old as well?
> 
> On Thursday, June 28, 2012 4:35:01 AM UTC-5, PaulW wrote:
> Hi
> 
> I would suggest that your version of Microsoft SQL Server is too old. From 
> the database.php default files...
> 
> 
> 1.3.15
>  *mssql   - Microsoft SQL Server 2000 and higher,
> 
> 2.1.3
>  *Database/Sqlserver  - Microsoft SQL Server 2005 and higher
> 
> 
> Cheers
> 
> Paul
> 
> On 27 Jun 2012, at 19:26, Miles G wrote:
> 
>> Thanks for pointing that out cricket; however, I am still getting the same 
>> error message after fixing that.
>> 
>> On Wednesday, June 27, 2012 11:15:16 AM UTC-5, cricket wrote:
>> You have the port value as a string. Try removing the quotes. 
>> 
>> On Wed, Jun 27, 2012 at 10:23 AM, Miles G  wrote: 
>> > Hi, I'm trying to figure out what possible problem could be causing me not 
>> > to connect to my db on the 2.1.3 version. I connect just fine on the 1.3 
>> > version and the only big changes I notice in the database.php file is the 
>> > difference of 'host' => 'mssql' in the 1.3 version compared to 
>> > 'datasource' 
>> > => in the 2.1.3 version. Here is a pastie.org link to get more info and 
>> > see 
>> > what happens for me as well as my database.php file for the different 
>> > versions. 
>> > 
>> > http://pastie.org/4154510 
>> > 
>> > Just to clarify, the new version was a fresh download where the only 
>> > changes 
>> > I made were the hashing security part in the core file and then modifying 
>> > database.php. The database is on a separate computer using Microsoft SQL 
>> > Server 2003 (on Windows 2003) and the OS where the project is stored is 
>> > also 
>> > on another computer with Windows 2003. There are 0 problems with 
>> > connecting 
>> > to the database on the 1.3 version just to say one more time! 
>> > 
>> > Let me know if you see something that could be causing this or if you need 
>> > more information ! 
>> > 
>> > Thanks, 
>> > 
>> > Miles 
>> > 
>> > -- 
>> > 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 
>> 
>> -- 
>> 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
> 
> 
> -- 
> 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

-- 
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: Can't Connect to Database (CakePHP 1.3 -> 2.1.3 Migration)

2012-06-28 Thread Miles G
My Microsoft SQL server is currently the 2005 version, but then again I 
wouldn't be surprised if that's too old as well?

On Thursday, June 28, 2012 4:35:01 AM UTC-5, PaulW wrote:
>
> Hi
>
> I would suggest that your version of Microsoft SQL Server is too old. From 
> the database.php default files...
>
>
> 1.3.15
>  * mssql - Microsoft SQL Server 2000 and higher,
>
> 2.1.3
>  * Database/Sqlserver - Microsoft SQL Server 2005 and higher
>
>
> Cheers
>
> Paul
>
> On 27 Jun 2012, at 19:26, Miles G wrote:
>
> Thanks for pointing that out cricket; however, I am still getting the same 
> error message after fixing that.
>
> On Wednesday, June 27, 2012 11:15:16 AM UTC-5, cricket wrote:
>>
>> You have the port value as a string. Try removing the quotes. 
>>
>> On Wed, Jun 27, 2012 at 10:23 AM, Miles G  wrote: 
>> > Hi, I'm trying to figure out what possible problem could be causing me 
>> not 
>> > to connect to my db on the 2.1.3 version. I connect just fine on the 
>> 1.3 
>> > version and the only big changes I notice in the database.php file is 
>> the 
>> > difference of 'host' => 'mssql' in the 1.3 version compared to 
>> 'datasource' 
>> > => in the 2.1.3 version. Here is a pastie.org link to get more info 
>> and see 
>> > what happens for me as well as my database.php file for the different 
>> > versions. 
>> > 
>> > http://pastie.org/4154510 
>> > 
>> > Just to clarify, the new version was a fresh download where the only 
>> changes 
>> > I made were the hashing security part in the core file and then 
>> modifying 
>> > database.php. The database is on a separate computer using Microsoft 
>> SQL 
>> > Server 2003 (on Windows 2003) and the OS where the project is stored is 
>> also 
>> > on another computer with Windows 2003. There are 0 problems with 
>> connecting 
>> > to the database on the 1.3 version just to say one more time! 
>> > 
>> > Let me know if you see something that could be causing this or if you 
>> need 
>> > more information ! 
>> > 
>> > Thanks, 
>> > 
>> > Miles 
>> > 
>> > -- 
>> > 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 
>>
>
> -- 
> 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
>
>
>

-- 
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: PHPUnit & ACL - Pulling hair out...

2012-06-28 Thread SpazzyV
Here is my UsersControllerTest 
(UsersControllerTest.php
)

Thanks,
Vinnie

On Wednesday, June 27, 2012 9:48:59 PM UTC-4, José Lorenzo wrote:
>
> How are you loading your fixtures? can you past your test case?
>
> On Wednesday, June 27, 2012 7:50:37 PM UTC-4:30, SpazzyV wrote:
>>
>> So, I have recently forayed into using CakePHP after a long departure due 
>> to the problems I encountered with 1.3. I have gotten into 2.1.3, and am 
>> really enjoying developing with it. However, I am pulling my hair out 
>> trying to be a good developer and write good unit tests for my controllers 
>> and models. I have worked through a lot of the issues, one at a time but 
>> can't seem to get past this ACL issue. I have a fully developed suite of 
>> tests, but the edit tests seem to be failing with this error:
>>
>> AclNode::node() - Couldn't find Aro node identified by "Array ( 
>> [Aro0.model] => User [Aro0.foreign_key] => 1 ) "
>>
>> I have included a link to a pastebin of the fixtures I created for Nodes. 
>> I know that ACL is being testing by the core components, so I am wondering 
>> how to either disable ACL (probably not the best idea) for my tests or set 
>> my tests so they work correctly. Any help that you all may provide would be 
>> greatly appreciated!
>>
>> Thanks,
>> Vinnie
>>
>> ARO, ACO, and ACO_ARO Fixtures
>>
>>
>>

-- 
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


cant access multiple textboxes values

2012-06-28 Thread Ditshwanelo
Im using multiple textboxes with the same name want to get values from the 
form i knw in PHP we use get bt i tried cake is not working,please help
This is my textbox:
  
   
,how do i access this in my controller using $this->data[Mymodel][Name] and 
get each textbox vale according its index

-- 
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: Error viewing ID 0

2012-06-28 Thread Oldskool


> The requested address '//types/view/0' was not found on this server.


Please note the // in the front, shouldn't be a huge problem, but there 
should just be one.
 

> Does anyone have any ideas how to get around this? One way would be to 
> change it to a non 0 id, but that would be a ton of records to edit.
>
 
Please be aware that 0 is a very tricky integer in PHP. Many checks see 0 
as "invalid" value. E.g. the empty() function treats 0 as "empty". And it 
also evaluates to false if non-strict checking (== instead of ===) is used.
Most likely the problem is somewhere down that path. If possible, 
converting the 0-id records to something else would be your best bet as 
it's really a pain to work around.

-- 
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: Routes vs Type checking for Action Parameters, best practice?

2012-06-28 Thread Dr. Tarique Sani
Apart from what Jeremy said you should also remember that routes are
expensive. Use them wisely

Tarique

On Thu, Jun 28, 2012 at 5:36 PM, Jeremy Burns | Class Outfit
 wrote:
> I disagree. I think you're not using routes in their purest form (to route



-- 
=
PHP for E-Biz: http://sanisoft.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: Routes vs Type checking for Action Parameters, best practice?

2012-06-28 Thread Jeremy Burns | Class Outfit
I disagree. I think you're not using routes in their purest form (to route 
stuff in the right way - rather than error trapping) and even if it passes you 
still need to check the validity in the controller and redirect if necessary. 
Why do that in two places? And what happens in the router if a non-integer is 
passed?

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 28 Jun 2012, at 12:58:36, Poyan Nabati wrote:

> That's another type of error though. It's something have to handle in your 
> application but I don't see the relation to my OP. 
> 
> -- 
> 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

-- 
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: Routes vs Type checking for Action Parameters, best practice?

2012-06-28 Thread Poyan Nabati
That's another type of error though. It's something have to handle in your 
application but I don't see the relation to my OP. 

-- 
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 to Different Action in If Statement

2012-06-28 Thread Tilen Majerle
in your controller

$this->redirect(array('action' => 'view'));
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2012/6/28 kwixson 

> How do I redirect a user from the index action to the view action if the
> user has a particular role (i.e., member, as opposed to admin?
>
> Note: I do NOT want to hear about routes. That might be the right way to
> go generally, but in this case it's not. I just want to know how to do an
> IF statement in the index action that will redirect the user to the view
> action.
>
> 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
>

-- 
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


CakePHP 2.0 HttpSocket and HttpResponse empty

2012-06-28 Thread Bui Minh Truong
Hi all,

Sorry if there was any thread about my problem (I did search that problem 
but I was unlucky).

I used instruction of HttpSocket on this page: 

http://book.cakephp.org/2.0/en/core-utility-libraries/httpsocket.html 

My request was created and it actually requested target host, but there was 
an empty response.
I debugged 2 classes of CakePHP : HttpSocket and HttpResponse, then I found 
that:

In HttpSocket : (\lib\Cake\Network\Http)  Line 397:
$this->response = new $responseClass($response); 
$response is not empty but $this->response is empty, though $responseClass 
is HttpResponse.

In HttpResponse: no constructor called.

Could anyone help us to understand this problem.

Thank you,
M.Truong.

-- 
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


Redirect to Different Action in If Statement

2012-06-28 Thread kwixson
 

How do I redirect a user from the index action to the view action if the 
user has a particular role (i.e., member, as opposed to admin?

Note: I do NOT want to hear about routes. That might be the right way to go 
generally, but in this case it's not. I just want to know how to do an IF 
statement in the index action that will redirect the user to the view 
action. 

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: Is there a lighter weight alternative to requestAction?

2012-06-28 Thread rchavik
On Thursday, June 28, 2012 3:45:40 PM UTC+7, Florian Krämer wrote:

>
> Congratulations for totally breaking a *MVC* framework...
>

Well, I'm no mvc purist, but a quick check in 
http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller gives:
  "A view requests from the model the information that it needs to generate 
an output representation."

So, depends on the use case/preferences I guess.

-- 
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: saveAssociated with hasOne creates new entries instead of updating

2012-06-28 Thread Mike Griffin
On Thu, Jun 28, 2012 at 11:43 AM, cronet  wrote:
> saveAssociated keeps generating new entries, rather than updating old ones:
>
> User hasOne UserProfile
> User hasOne UserSetting
>
> The resulting array looks like this:
>
> [User] => Array
>     (
>     [id] => 3
>     )
>
> [UserProfile] => Array
>     (
>     [firstname] => Test
>     [name] => Name
>     )
>
> [UserSetting] => Array
>     (
>     [some_setting] => Doh
>     )
>
>
> In my controller I simply call
>
> $this->User->saveAssociated($this->request->data);
>

In your controller before you call saveAssociated, set the values for
user_id in the UserProfile and UserSetting parts of the array.

$this->request->data['UserProfile']['user_id'] =
$this->request->data['User']['id'];
$this->request->data['UserSetting']['user_id'] =
$this->request->data['User']['id'];

Or if you want to use an interim array, assign the request data to an
array and then set the user_id. Then use that array to save the
associated data.

$request_data = $this->request->data;
$request_data['UserProfile']['user_id'] = $this->request->data['User']['id'];
$request_data['UserSetting']['user_id'] = $this->request->data['User']['id'];
$this->User->saveAssociated($request_data);

Mike.

-- 
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: saveAssociated with hasOne creates new entries instead of updating

2012-06-28 Thread Tilen Majerle
Form->input('UserProfile.id'); ?>

try add this line :)
--
Lep pozdrav, Tilen Majerle
http://majerle.eu



2012/6/28 cronet 

> Form->input('User.id'); ?>

-- 
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


saveAssociated with hasOne creates new entries instead of updating

2012-06-28 Thread cronet
Hello,

saveAssociated keeps generating new entries, rather than updating old ones:

User hasOne UserProfile
User hasOne UserSetting

My Form looks like this:



Form->create('User', array('type'=>'post')); ?>
Form->input('User.id'); ?>

Form->input('UserProfile.firstname'); ?>
Form->input('UserProfile.name'); ?>

Form->input('UserSetting.some_setting'); ?>

Form->end('save'); ?>


The resulting array looks like this:

[User] => Array
(
[id] => 3
)

[UserProfile] => Array
(
[firstname] => Test
[name] => Name
)

[UserSetting] => Array
(
[some_setting] => Doh
)


In my controller I simply call

$this->User->saveAssociated($this->request->data);


As I understand the book, cakephp should populate the UserProfile.user_id 
and UserSetting.user_id field automatically. But the result is, with every 
save, a new association entry is generated. The User field updates correct.

What is my problem here? Any clues?

Regards,
cronet

-- 
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: Routes vs Type checking for Action Parameters, best practice?

2012-06-28 Thread Jeremy Burns | Class Outfit
What happens if you pass an $id that is an integer but that $id doesn't exist 
in the books table?

Jeremy Burns
Class Outfit

http://www.classoutfit.com

On 28 Jun 2012, at 11:26:40, Poyan Nabati wrote:

> Lets say I have a controller Books with an action view() defined as follows: 
> 
> class BooksController extends AppController {
> public function view($id) {
> // something
> }
> }
> 
> Let's assume that $id is supposed to be of a numeric type. 
> 
> I see two options; 
> 
> 1) Setup the route so that it only connects for instance books/view/{integer} 
> to  Books->view($id)
> 2) Have general routing like the defaults in CakePHP and include code in 
> view() to make sure that $id is set and is numeric. 
> 
> Which is better practice? 
> 
> In my view I think the former is cleaner and less magicky. This is something 
> I enjoyed working with the Play Framwork, that you explicitly had to connect 
> a route to each action. 
> 
> What is your opinion?
> 
> -- 
> 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

-- 
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 there a lighter weight alternative to requestAction?

2012-06-28 Thread Dr. Tarique Sani
On Thu, Jun 28, 2012 at 2:15 PM, Florian Krämer  wrote:
>> Had a similar situation - as a last bummer resort we converted
>> everything to custom helpers and used models (with custom model
>> methods) and caching directly in the helpers
>
>
> Congratulations for totally breaking a MVC framework...

When your app has to serve 800,000+ page views a day you don't give a
damn if it started out as MVC and ended as MVVM ;-)

Tarique


-- 
=
PHP for E-Biz: http://sanisoft.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


Routes vs Type checking for Action Parameters, best practice?

2012-06-28 Thread Poyan Nabati
Lets say I have a controller Books with an action view() defined as 
follows: 

class BooksController extends AppController {

public function view($id) {

// something

}

}

Let's assume that $id is supposed to be of a numeric type. 

I see two options; 

1) Setup the route so that it only connects for instance 
books/view/{integer} to  Books->view($id)
2) Have general routing like the defaults in CakePHP and include code in 
view() to make sure that $id is set and is numeric. 

Which is better practice? 

In my view I think the former is cleaner and less magicky. This is 
something I enjoyed working with the Play Framwork, that you explicitly had 
to connect a route to each action. 

What is your opinion?

-- 
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: Can't Connect to Database (CakePHP 1.3 -> 2.1.3 Migration)

2012-06-28 Thread Paul Willis
Hi

I would suggest that your version of Microsoft SQL Server is too old. From the 
database.php default files...


1.3.15
 *  mssql   - Microsoft SQL Server 2000 and higher,

2.1.3
 *  Database/Sqlserver  - Microsoft SQL Server 2005 and higher


Cheers

Paul

On 27 Jun 2012, at 19:26, Miles G wrote:

> Thanks for pointing that out cricket; however, I am still getting the same 
> error message after fixing that.
> 
> On Wednesday, June 27, 2012 11:15:16 AM UTC-5, cricket wrote:
> You have the port value as a string. Try removing the quotes. 
> 
> On Wed, Jun 27, 2012 at 10:23 AM, Miles G  wrote: 
> > Hi, I'm trying to figure out what possible problem could be causing me not 
> > to connect to my db on the 2.1.3 version. I connect just fine on the 1.3 
> > version and the only big changes I notice in the database.php file is the 
> > difference of 'host' => 'mssql' in the 1.3 version compared to 'datasource' 
> > => in the 2.1.3 version. Here is a pastie.org link to get more info and see 
> > what happens for me as well as my database.php file for the different 
> > versions. 
> > 
> > http://pastie.org/4154510 
> > 
> > Just to clarify, the new version was a fresh download where the only 
> > changes 
> > I made were the hashing security part in the core file and then modifying 
> > database.php. The database is on a separate computer using Microsoft SQL 
> > Server 2003 (on Windows 2003) and the OS where the project is stored is 
> > also 
> > on another computer with Windows 2003. There are 0 problems with connecting 
> > to the database on the 1.3 version just to say one more time! 
> > 
> > Let me know if you see something that could be causing this or if you need 
> > more information ! 
> > 
> > Thanks, 
> > 
> > Miles 
> > 
> > -- 
> > 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 
> 
> -- 
> 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

-- 
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: Captcha

2012-06-28 Thread LITTO CHACKO
hello ,pls refer this blog
http://phpdudes.blogspot.in/2012/06/captcha-in-cakephp.html
iam sure that it will be the solution for ur problem

On Thu, Jun 28, 2012 at 2:32 PM, Mr. Manager  wrote:

> Dear All,
>
> I have problem with using captcha to validate form data and so I hope that
> someone will has solution.
>
> I am thanks a lot in advance!
>
> Yours Sincerely,
> 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
>



-- 
Litto Chacko
Axtec Softwares
http://phpdudes.blogspot.in/

-- 
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


Captcha

2012-06-28 Thread Mr. Manager
Dear All,

I have problem with using captcha to validate form data and so I hope that 
someone will has solution.

I am thanks a lot in advance!

Yours Sincerely,
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: Is there a lighter weight alternative to requestAction?

2012-06-28 Thread Florian Krämer
Change the way your app is designed.

When a page gets called you have some ways to identify that page through 
the url controller class + action that was called.

If your blocks know on what page they should render you could have a single 
method in a model that you can call in AppController::beforeRender() that 
will fetch all the required blocks and set them to the views.

On Thursday, June 28, 2012 5:17:04 AM UTC+2, Dr. Tarique Sani wrote:
>
> Had a similar situation - as a last bummer resort we converted 
> everything to custom helpers and used models (with custom model 
> methods) and caching directly in the helpers 
>

Congratulations for totally breaking a *MVC* framework...

-- 
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: Override behavior method?

2012-06-28 Thread Poyan Nabati
Excellent. 

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: Override behavior method?

2012-06-28 Thread Dr. Tarique Sani
It will run the Models fly()-method!

Once in a while it is nice to dig into the framework code to find out
how it works - having a good IDE helps with this

Cheers

Tarique

On Thu, Jun 28, 2012 at 12:39 PM, Poyan Nabati  wrote:
> From the manual:
>
> Behavior methods are automatically available on any model acting as the
> behavior. For example if you had:
>  class Duck extends AppModel {
>     public $name = 'Duck';
>     public $actsAs = array('Flying');
> }
> You would be able to call FlyingBehavior methods as if they were methods on
> your Duck model. When creating behavior methods you automatically get passed
> a reference of the calling model as the first parameter. All other supplied
> parameters are shifted one place to the right. For example:
>  $this->Duck->fly('toronto', 'montreal');
>
> What happens if Duck already has a method fly()?
>
> Do you
>
> get an error?
> run the Models fly()-method?
> run the Behaviors fly()-method?
>
> Or formulated differently;
> With an attached behavior, can I still override certain methods with local
> implementations?
>
> --
> 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



-- 
=
PHP for E-Biz: http://sanisoft.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


Override behavior method?

2012-06-28 Thread Poyan Nabati
>From the manual: 

Behavior methods are automatically available on any model acting as the 
behavior. For example if you had:
Duck->fly('toronto', 'montreal');

What happens if Duck already has a method fly()?  

Do you 

   - get an error?
   - run the Models fly()-method?
   - run the Behaviors fly()-method?

Or formulated differently; 
With an attached behavior, can I still override certain methods with local 
implementations?

-- 
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