Re: how to use transactions in cakephp

2011-01-11 Thread huoxito
great topic, just helped me alot here, thanks! so good cake got this group!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: setflash edit

2011-01-11 Thread Amit Badkas
Hi,

As I already mentioned "You don't need to delete flash message in session
explicitly, $this->Session->flash() does it automagically.", the message
doesn't appear after page refresh.

In the first message you mentioned "But when I go after the edit to the
details view and back to the index view it gives me the message 'your job
has been updated'." and now you are asking "How can I refresh the page to
remove the flash message from the page?". So, I am confused about what
exactly you need. Please be specific about your problem.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Tue, Jan 11, 2011 at 11:42 PM, lvdb  wrote:

> Hello Amit,
>
> Thank you for your answer. When I refresh the view page the message is
> gone.
> It is not done automatically. How can I refresh the page?
>
> Leo
>
> On 10 jan, 07:31, Amit Badkas  wrote:
> > Hi,
> >
> > Does the details page output flash message? You don't need to delete
> flash
> > message in session explicitly, $this->Session->flash() does it
> > automagically.
> >
> > Amit Badkas
> >
> > PHP Applications for E-Biz:http://www.sanisoft.com
> >
> >
> >
> > On Sat, Jan 8, 2011 at 1:13 AM, lvdb  wrote:
> > > Hello,
> >
> > > I have made a flash message "your job has been updated". When I edit a
> > > job and have been redirected to the index view the message appears
> > > (and after 3 seconds it hides). This is working fine. But when I go
> > > after the
> > > edit to the details view and back to the index view it gives me the
> > > message "your job has been updated".
> > > Must I delete the session and how do I do that?
> >
> > > Thank you in advance for your answer.
> >
> > > Leo van den Berg
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> others
> > > with their CakePHP related questions.
> >
> > > 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
> For more options, visit this
> group at
> > >http://groups.google.com/group/cake-php?hl=en- Tekst uit oorspronkelijk
> bericht niet weergeven -
> >
> > - Tekst uit oorspronkelijk bericht weergeven -
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


How to debug CakePHP, Xdebug in Netbeans IDE

2011-01-11 Thread Pious7982
Hi all,

I am a new PHP developer. I intend to use Xdebug for debugging in
Netbean IDE. I installed Xdebug and it was good for a normal PHP file.
However, i have checked on CakePHP project, Debug function can start a
debug session but breakpoint is only in index.php file on webroot or
webroot/app.
Anyone have experience on this problem, please help me.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CakePHP 1.3.6 - OSX Server - and Application in user subfolder issue

2011-01-11 Thread Andras Kende
If this loads:
http://server.local/~adrian/ToDo/index.php/tasks/index

then its probably a mod_rewrite issue..

Andras Kende
http://www.kende.com

On Jan 11, 2011, at 11:37 AM, Kilty wrote:

> Hi guys (and gals)
> 
> I've come back to Cake to try and solve a few problems and to get my
> head back into programming again... the problem is that I've hit a
> snag or two...
> I'm running back over the demo/quick intro tutorials with not much
> success.
> 
> I am running an OSX 10.6 Server with Apache/PHP/etc installed and
> running.
> Cake is being used from a folder ToDo in the user folder ~adrian.
> I've removed/renamed the .htaccess files and turned on Cake URL
> support in the core.php file.
> 
> When I use an URL such as: http://server.local/~adrian/ToDo/ the
> initial page comes up saying:
>  Your tmp directory is writable.
>  The FileEngine is being used for caching. To change the config edit
> APP/config/core.php
>  Your database configuration file is present.
>  Cake is able to connect to the database.
> 
> So you can see it runs ok to this point.
> 
> Now when I use http://server.local/~adrian/ToDo/tasks/index I get an
> error:
>  The requested URL /~adrian/ToDo/tasks/index was not found on this
> server.
> 
> Same occurs with no index on the end of the URL.
> 
> The same problems occur when I use .htaccess files.
> To add a level of confusion - I have successfully used htaccess files
> in subfolders before - when creating a wordpress development area.
> 
> Any ideas?
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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 For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Use CakePHP in NetBeans IDE 6.8

2011-01-11 Thread Sam Sherlock
I don't use netbeans there is this
https://github.com/evilbloodydemon/netbeans-cakephp-bundle

On 11/01/2011, clod  wrote:
>
> I use and suggest free portable PHP IDE -  http://www.codelobster.com
> Codelobster PHP Edition  with special CakePHP plug-in for auto-completion,
> context help and etc.
> --
> View this message in context:
> http://cakephp.1045679.n5.nabble.com/Use-CakePHP-in-NetBeans-IDE-6-8-tp3289370p3336106.html
> Sent from the CakePHP mailing list archive at Nabble.com.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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 For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>


-- 
 - S

+44 (0)7908 069 219

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Newbie - clueless about mod_rewrite and httpd.conf

2011-01-11 Thread estherM
Thanks!

On Jan 11, 2:14 pm, cricket  wrote:
> On Tue, Jan 11, 2011 at 1:01 PM, estherM  wrote:
>
> > I'm using XAMPP on linux. I've found my httpd.conf file in opt/lampp/
> > etc, but am not sure what I need to do with it. I've searched for
> > "rewrite", and there's only one line:
>
> > LoadModule rewrite_module modules/mod_rewrite.so
>
> > There's nothing about AddModule mod_rewrite.c.
>
> The documentation is outdated. AddModule is no longer used in Apache 2.x.
>
> > Do I just create a Directory section for the directory I've installed
> > Cake in and set AlllowOverride to All? (I created a separate
> > subdirectory of my wwwroot and installed in there, since I also have
> > installs of Joomla and CodeIgniter.) Is there anything else I need to
> > do? My download of Cake did come with two htaccess-type files
> > (._.htaccess and .htaccess) - do I need to do anything with them?
>
> If you have access to apache's conf, you can disable htaccess
> (AllowOverride None) for a little boost in speed by putting the
> rewrite config in there. If you have separate virtual host configs for
> your site(s) put this in the appropriate file instead.
>
> 
>         Options None
>         AllowOverride None
>         Order allow,deny
>         Allow from all
>
>         DirectoryIndex index.php index.html
>
>         
>                 RewriteEngine On
>                 RewriteCond %{REQUEST_FILENAME} !-d
>                 RewriteCond %{REQUEST_FILENAME} !-f
>                 RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
>         
> 
>
> With this config, all requests will be forwarded to webroot/index.php,
> unless it's for an existing file or directory inside webroot (eg. your
> css, js, or something else you include in there).

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Newbie - clueless about mod_rewrite and httpd.conf

2011-01-11 Thread cricket
On Tue, Jan 11, 2011 at 1:01 PM, estherM  wrote:
>
> I'm using XAMPP on linux. I've found my httpd.conf file in opt/lampp/
> etc, but am not sure what I need to do with it. I've searched for
> "rewrite", and there's only one line:
>
> LoadModule rewrite_module modules/mod_rewrite.so
>
> There's nothing about AddModule mod_rewrite.c.

The documentation is outdated. AddModule is no longer used in Apache 2.x.

> Do I just create a Directory section for the directory I've installed
> Cake in and set AlllowOverride to All? (I created a separate
> subdirectory of my wwwroot and installed in there, since I also have
> installs of Joomla and CodeIgniter.) Is there anything else I need to
> do? My download of Cake did come with two htaccess-type files
> (._.htaccess and .htaccess) - do I need to do anything with them?

If you have access to apache's conf, you can disable htaccess
(AllowOverride None) for a little boost in speed by putting the
rewrite config in there. If you have separate virtual host configs for
your site(s) put this in the appropriate file instead.


Options None
AllowOverride None
Order allow,deny
Allow from all

DirectoryIndex index.php index.html


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]



With this config, all requests will be forwarded to webroot/index.php,
unless it's for an existing file or directory inside webroot (eg. your
css, js, or something else you include in there).

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CakePHP 1.3.6 - OSX Server - and Application in user subfolder issue

2011-01-11 Thread Ryan Schmidt
On Jan 11, 2011, at 11:37, Kilty wrote:

> When I use an URL such as: http://server.local/~adrian/ToDo/ the
> initial page comes up saying:
>  Your tmp directory is writable.
>  The FileEngine is being used for caching. To change the config edit
> APP/config/core.php
>  Your database configuration file is present.
>  Cake is able to connect to the database.
> 
> So you can see it runs ok to this point.
> 
> Now when I use http://server.local/~adrian/ToDo/tasks/index I get an
> error:
>  The requested URL /~adrian/ToDo/tasks/index was not found on this
> server.

That's a pretty good indication that .htaccess files are not being processed. 
Check your Apache configuration. You will need to make sure that, in the 
 block for the directory in question, there is a statement like 
"AllowOverride All".



Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Fatal error: Call to undefined function __l()

2011-01-11 Thread cricket
On Tue, Jan 11, 2011 at 4:09 AM, osamo101  wrote:
> Hi Amit,
>
> This is very strange, the __l() is repeated in the code over 8000
> times with strings i.e. __l('Delete'), do you have any idea about how
> this can happen?

I don't believe it's a Cake function. Perhaps it was defined in the
old version's bootstrap.php and was overwritten.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Make required css class not appear on edit page

2011-01-11 Thread cricket
On Tue, Jan 11, 2011 at 1:25 PM, zzella  wrote:
> Hi,
>
> I have a model where a field is required on the Add (create) page but
> can be empty on the Modify (update) page.
>
> My model specifies the field should be not-empty on create only, but
> the "required" css class (red asterisk) still gets added on the modify
> page. How do I make this a non-required field on the modify page?

I'm not sure if Cake normally would not add "required" in this
situation (never looked into it) but you could always undo the CSS
rule in your stylesheet:

#IdOfForm .required { ... }

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: This notice

2011-01-11 Thread cricket
Can you post some code?

On Tue, Jan 11, 2011 at 1:04 PM, Filipe Estrela  wrote:
> Notice (8): Undefined property: UsuariosController::$data
> [CORE\cake\libs\view\view.php, line 312]
> Code | Context
>
> for ($j = 0; $j < $count; $j++) {
> $var = $this->__passedVars[$j];
> $this->{$var} = $controller->{$var};
>
> $controller   =   UsuariosController
> UsuariosController::$name = "Usuarios"
> UsuariosController::$layout = "collecao"
> UsuariosController::$helpers = array
> UsuariosController::$uses = array
> UsuariosController::$here = "/collecao/usuarios/incluir"
> UsuariosController::$webroot = "/collecao/"
> UsuariosController::$action = "incluir"
> UsuariosController::$params = array
> UsuariosController::$paginate = array
> UsuariosController::$viewPath = "usuarios"
> UsuariosController::$layoutPath = NULL
> UsuariosController::$viewVars = array
> UsuariosController::$modelNames = array
> UsuariosController::$base = "/collecao"
> UsuariosController::$autoRender = true
> UsuariosController::$autoLayout = true
> UsuariosController::$Component = Component object
> UsuariosController::$components = array
> UsuariosController::$view = "View"
> UsuariosController::$ext = ".ctp"
> UsuariosController::$output = NULL
> UsuariosController::$plugin = NULL
> UsuariosController::$cacheAction = false
> UsuariosController::$persistModel = false
> UsuariosController::$passedArgs = array
> UsuariosController::$scaffold = false
> UsuariosController::$methods = array
> UsuariosController::$modelClass = "Usuario"
> UsuariosController::$modelKey = "usuario"
> UsuariosController::$validationErrors = NULL
> UsuariosController::$__httpCodes = NULL
> UsuariosController::$Session = SessionComponent object
> UsuariosController::$Usuario = Usuario object
> UsuariosController::$Estado = Estado object
> $register =   true
> $count=   18
> $j=   14
> $var  =   "data"
> $this =   View
> View::$base = "/collecao"
> View::$here = "/collecao/usuarios/incluir"
> View::$plugin = NULL
> View::$name = "Usuarios"
> View::$action = "incluir"
> View::$params = array
> View::$passedArgs = array
> View::$data = array
> View::$helpers = array
> View::$viewPath = "usuarios"
> View::$viewVars = array
> View::$layout = "collecao"
> View::$layoutPath = NULL
> View::$autoRender = true
> View::$autoLayout = true
> View::$ext = ".ctp"
> View::$subDir = NULL
> View::$theme = NULL
> View::$cacheAction = false
> View::$validationErrors = array
> View::$hasRendered = false
> View::$loaded = array
> View::$modelScope = false
> View::$model = NULL
> View::$association = NULL
> View::$field = NULL
> View::$fieldSuffix = NULL
> View::$modelId = NULL
> View::$uuids = array
> View::$output = false
> View::$__passedVars = array
> View::$__scripts = array
> View::$__paths = array
> View::$webroot = "/collecao/"
>
> View::__construct() - CORE\cake\libs\view\view.php, line 312
> Controller::render() - CORE\cake\libs\controller\controller.php, line 883
>
> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 207
> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
> [main] - APP\webroot\index.php, line 83
>
>
> After submit a form, show this message. The datas are save, but this
> massage...
>
>
> I need help.
>
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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 For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: I am getting an error like this after i submit an action.

2011-01-11 Thread Hanif ""
Hi,
This problem occurs if you want to print/echo something before header
function. So remove all printing function before header function.

This problem also can occurs there have any white space in controller
after php closing tag( ?>)
So check it.

Hope it will works fine.

Thanks

On 1/11/11, Andi  wrote:
> The Problem is the redirecting a page over the php header() function.
> This just works, if there is absolutly NO output send. CakePHP uses
> the header-redirect for redirecting between the controller actions. So
> if you have an output e.g. with debug() you will get the information,
> that no redirecting is possible.
>
> More information about header() function:
> http://php.net/manual/en/function.header.php
>
> On 10 Jan., 12:39, Deepak  wrote:
>> Warning (2): Cannot modify header information - headers already sent
>> by (output started at C:\xampp\htdocs\todo\app\models\post.php:9) [CORE
>> \cake\libs\controller\controller.php, line 742]
>> Code | Context
>>
>> $status =       "Location:http://localhost/todo/posts";
>>
>> header - [internal], line ??
>> Controller::header() - CORE\cake\libs\controller\controller.php, line
>> 742
>> Controller::redirect() - CORE\cake\libs\controller\controller.php,
>> line 721
>> PostsController::delete() - APP\controllers\posts_controller.php, line
>> 64
>> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
>> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
>> [main] - APP\webroot\index.php, line 85
>>
>> please help me as i want to finish it of as early as possible.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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 For more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Newbie - clueless about mod_rewrite and httpd.conf

2011-01-11 Thread estherM
I'm a total newbie to Cake and not much better with apache; I've done
a lot of PHP but always with a server that's already been set up by
someone else. So I'm going through the basic blog tutorial, and it
says:

"A Note On mod_rewrite
Occasionally a new user will run in to mod_rewrite issues, so I'll
mention them marginally here. If the Cake welcome page looks a little
funny (no images or css styles), it probably means mod_rewrite isn't
functioning on your system. Here are some tips to help get you up and
running:

Make sure that an .htaccess override is allowed: in your httpd.conf,
you should have a section that defines a section for each Directory on
your server. Make sure the AllowOverride is set to All for the correct
Directory.

Make sure you are editing the system httpd.conf rather than a user- or
site-specific httpd.conf.

For some reason or another, you might have obtained a copy of CakePHP
without the needed .htaccess files. This sometimes happens because
some operating systems treat files that start with '.' as hidden, and
don't copy them. Make sure your copy of CakePHP is from the downloads
section of the site or our SVN repository.

Make sure you are loading up mod_rewrite correctly! You should see
something like LoadModule rewrite_module libexec/httpd/mod_rewrite.so
and AddModule mod_rewrite.c in your httpd.conf."

I'm using XAMPP on linux. I've found my httpd.conf file in opt/lampp/
etc, but am not sure what I need to do with it. I've searched for
"rewrite", and there's only one line:

LoadModule rewrite_module modules/mod_rewrite.so

There's nothing about AddModule mod_rewrite.c.

Do I just create a Directory section for the directory I've installed
Cake in and set AlllowOverride to All? (I created a separate
subdirectory of my wwwroot and installed in there, since I also have
installs of Joomla and CodeIgniter.) Is there anything else I need to
do? My download of Cake did come with two htaccess-type files
(._.htaccess and .htaccess) - do I need to do anything with them?

Thanks for any help you can provide to this non-server-admin.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Make required css class not appear on edit page

2011-01-11 Thread zzella
Hi,

I have a model where a field is required on the Add (create) page but
can be empty on the Modify (update) page.

My model specifies the field should be not-empty on create only, but
the "required" css class (red asterisk) still gets added on the modify
page. How do I make this a non-required field on the modify page?

MODEL:
class Diploma extends AppModel {
var $validate = array(
'specialite' => array(
'notempty' => array(
'rule' => array('notempty'),
'message' => 'Veuillez saisir la spécialité',
'required' => false,
'on' => 'create', // Limit validation to 
'create' or 'update'
operations
),
),
)
}

On both ADD and EDIT pages (although these are for a parent model):
echo $this->Form->input('Diploma.0.specialite',
array('label'=>__('Spécialité',true),'size'=>40));

The behaviour of the validation rule works correctly when I save but I
just can't get rid of that star!!!

Any help is much appreciated!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


This notice

2011-01-11 Thread Filipe Estrela
*Notice* (8): Undefined property: UsuariosController::$data
[*CORE\cake\libs\view\view.php*, line *312*]
Code | Context

for ($j = 0; $j < $count; $j++) {$var =
$this->__passedVars[$j];$this->{$var} =
$controller->{$var};

$controller =   UsuariosController
UsuariosController::$name = "Usuarios"
UsuariosController::$layout = "collecao"
UsuariosController::$helpers = array
UsuariosController::$uses = array
UsuariosController::$here = "/collecao/usuarios/incluir"
UsuariosController::$webroot = "/collecao/"
UsuariosController::$action = "incluir"
UsuariosController::$params = array
UsuariosController::$paginate = array
UsuariosController::$viewPath = "usuarios"
UsuariosController::$layoutPath = NULL
UsuariosController::$viewVars = array
UsuariosController::$modelNames = array
UsuariosController::$base = "/collecao"
UsuariosController::$autoRender = true
UsuariosController::$autoLayout = true
UsuariosController::$Component = Component object
UsuariosController::$components = array
UsuariosController::$view = "View"
UsuariosController::$ext = ".ctp"
UsuariosController::$output = NULL
UsuariosController::$plugin = NULL
UsuariosController::$cacheAction = false
UsuariosController::$persistModel = false
UsuariosController::$passedArgs = array
UsuariosController::$scaffold = false
UsuariosController::$methods = array
UsuariosController::$modelClass = "Usuario"
UsuariosController::$modelKey = "usuario"
UsuariosController::$validationErrors = NULL
UsuariosController::$__httpCodes = NULL
UsuariosController::$Session = SessionComponent object
UsuariosController::$Usuario = Usuario object
UsuariosController::$Estado = Estado object
$register   =   true
$count  =   18
$j  =   14
$var=   "data"
$this   =   View
View::$base = "/collecao"
View::$here = "/collecao/usuarios/incluir"
View::$plugin = NULL
View::$name = "Usuarios"
View::$action = "incluir"
View::$params = array
View::$passedArgs = array
View::$data = array
View::$helpers = array
View::$viewPath = "usuarios"
View::$viewVars = array
View::$layout = "collecao"
View::$layoutPath = NULL
View::$autoRender = true
View::$autoLayout = true
View::$ext = ".ctp"
View::$subDir = NULL
View::$theme = NULL
View::$cacheAction = false
View::$validationErrors = array
View::$hasRendered = false
View::$loaded = array
View::$modelScope = false
View::$model = NULL
View::$association = NULL
View::$field = NULL
View::$fieldSuffix = NULL
View::$modelId = NULL
View::$uuids = array
View::$output = false
View::$__passedVars = array
View::$__scripts = array
View::$__paths = array
View::$webroot = "/collecao/"

View::__construct() - CORE\cake\libs\view\view.php, line 312
Controller::render() - CORE\cake\libs\controller\controller.php, line 883
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 207
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
[main] - APP\webroot\index.php, line 83


After submit a form, show this message. The datas are save, but this massage...

I need help.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: different pagination across views (not controllers)

2011-01-11 Thread Brian Mckphee
I found my own answer.  To anyone who needs this see the following.

In your function in the controller that you would like to have the
custom order on do this

$this->paginate = array('order' => 'yourModel.yourColumn DESC');
$data = $this->paginate('YourModel', array('yourColumn' =>
'condition'));

On Jan 11, 11:07 am, Devario Johnson  wrote:
> Hi, im sure this is a simple question but i can't find any docs
> related to this...
>
> I have multiple views coming from one controller (as normal)
>
> I would like to paginate them differently in each view.
>
> say view a, b, and c, are paginated ASC and view d, and e, are
> paginated DESC
>
> I have in my controller at the top the var $paginate with order
> defined.
>
> this seems to effect ALL uses of the $this->paginate across any views
> associated with the controller.
>
> How do I get them to act independently?
>
> I already tried removing it from the top and adding it in each
> function but that didnt work.
> I also tried adding 'order' to the actual paginate (find) query and
> that does not work either...
>
> any ideas?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


CakePHP 1.3.6 - OSX Server - and Application in user subfolder issue

2011-01-11 Thread Kilty
Hi guys (and gals)

I've come back to Cake to try and solve a few problems and to get my
head back into programming again... the problem is that I've hit a
snag or two...
I'm running back over the demo/quick intro tutorials with not much
success.

I am running an OSX 10.6 Server with Apache/PHP/etc installed and
running.
Cake is being used from a folder ToDo in the user folder ~adrian.
I've removed/renamed the .htaccess files and turned on Cake URL
support in the core.php file.

When I use an URL such as: http://server.local/~adrian/ToDo/ the
initial page comes up saying:
  Your tmp directory is writable.
  The FileEngine is being used for caching. To change the config edit
APP/config/core.php
  Your database configuration file is present.
  Cake is able to connect to the database.

So you can see it runs ok to this point.

Now when I use http://server.local/~adrian/ToDo/tasks/index I get an
error:
  The requested URL /~adrian/ToDo/tasks/index was not found on this
server.

Same occurs with no index on the end of the URL.

The same problems occur when I use .htaccess files.
To add a level of confusion - I have successfully used htaccess files
in subfolders before - when creating a wordpress development area.

Any ideas?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Clueless...Help please

2011-01-11 Thread Brian Mckphee
I agree with the last few posters.  You may need to tell your client
to look at their code.  Are you merely a hosting provider or are you a
coder?

On Jan 10, 8:13 am, javier0051  wrote:
> Hi
>
> I am a completely newbie to cake php. A new customer has a site
> developed with cake php and we recently moved the site to one of our
> boxes but we haven't been able to show all the page's content. No
> errors, the news & articles and other stuff are actually in the
> database BUT no contents are displayed. (site's main page:www.acepweb.org.ar
> Undisplayed contents example url (http://www.acepweb.org.ar/c/noticias/
> ultimas-noticias)
>
> The problem comes when trying to access one of the interior sections.
> The contents are in the database, the routing.php file has this line
> "(Router::connect('/c/:categoria/:subcategoria', array('controller' =>
> 'categories', 'action' => 'view', 'categoria' => null, 'subcategoria'
> => null));)" directing to some /c/ folder or whatever it is but it is
> not physically present.
>
> The connection to the db is established propperly but at this point I
> am totally clueless on how to get that example page to display the
> contents it used to display when hosted on the other box, with same
> cPanel, same linux operating system.
>
> Thank you .Help will be totally appreciated

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


ModraCart the easy to use PHP Shopping Cart built on CakePHP is available

2011-01-11 Thread KMScreative
Build on CakePHP 1.3.4, ModraCart is a serious competitor to major
shopping cart platforms. Custom URL's for static pages you create,
category and manufacturer pages, product pages. Customize shipping
options. Accept credit cards and be PA-DSS compliant. Find out more at
http://www.modracart.com";>http://www.modracart.com.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: setflash edit

2011-01-11 Thread lvdb
Hello Amit,

Thank you for your answer. When I refresh the view page the message is
gone.
It is not done automatically. How can I refresh the page?

Leo

On 10 jan, 07:31, Amit Badkas  wrote:
> Hi,
>
> Does the details page output flash message? You don't need to delete flash
> message in session explicitly, $this->Session->flash() does it
> automagically.
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
>
>
> On Sat, Jan 8, 2011 at 1:13 AM, lvdb  wrote:
> > Hello,
>
> > I have made a flash message "your job has been updated". When I edit a
> > job and have been redirected to the index view the message appears
> > (and after 3 seconds it hides). This is working fine. But when I go
> > after the
> > edit to the details view and back to the index view it gives me the
> > message "your job has been updated".
> > Must I delete the session and how do I do that?
>
> > Thank you in advance for your answer.
>
> > Leo van den Berg
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en- Tekst uit oorspronkelijk 
> >bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cake source code optimization

2011-01-11 Thread Miles J
The 2.0 branch wont be anytime soon.

On Jan 11, 5:15 am, euromark  wrote:
> there is none :)
> i already asked myself the same question
> we got to be patient (but since dev is already released in can only be
> a matter of a few months)
>
> On 11 Jan., 10:04, Adrian Arnautu  wrote:
>
> > I'm not tracking the dev progress, could you tell me when the 2.0 release is
> > to be scheduled?
>
> > Thanks,
> > Adrian
>
> > On Tue, Jan 11, 2011 at 1:10 AM, euromark wrote:
>
> > > thats what i remarked at the end :)
> > > i suppose it does
>
> > > as for the other bottlenecks we will have to wait for 2.0 (and lazy
> > > loading for all kinds of stuff)
>
> > > On 10 Jan., 17:05, Jon Bennett  wrote:
> > > > > i would have liked that cake offered some kind of packed core (like CI
> > > > > - code igniter - does)
>
> > > > > all relevant core files that are required on every single request
> > > > > (30-40?) combined and minified
> > > > > directly included by the dispatcher or whatever
> > > > > although opcode cache should already minimize the include process
> > > > > delay
>
> > > > doesn't using an opcode cache like APC makes minifying php source
> > > > completely pointless?
>
> > > > j
>
> > > > --
> > > > jon bennett -www.jben.net-blog.jben.net
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others
> > > with their CakePHP related questions.
>
> > > 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 > >  om>For more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: different pagination across views (not controllers)

2011-01-11 Thread Devario Johnson
Hi all...found my own answer to this question and i hope this helps
someone .

in your function in the controller that you would like to have the
custom order on do this

$this->paginate = array('order' => 'yourModel.yourColumn DESC');
$data = $this->paginate('YourModel', array('yourColumn' =>
'condition'));

On Jan 11, 11:07 am, Devario Johnson  wrote:
> Hi, im sure this is a simple question but i can't find any docs
> related to this...
>
> I have multiple views coming from one controller (as normal)
>
> I would like to paginate them differently in each view.
>
> say view a, b, and c, are paginated ASC and view d, and e, are
> paginated DESC
>
> I have in my controller at the top the var $paginate with order
> defined.
>
> this seems to effect ALL uses of the $this->paginate across any views
> associated with the controller.
>
> How do I get them to act independently?
>
> I already tried removing it from the top and adding it in each
> function but that didnt work.
> I also tried adding 'order' to the actual paginate (find) query and
> that does not work either...
>
> any ideas?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Clueless...Help please

2011-01-11 Thread Devario Johnson
that error usually happens when a call to a find query (in this case a
paginate query) is written wrong.  That seems like an app error not
hosting.

On Jan 11, 9:07 am, AD7six  wrote:
> On Jan 11, 3:37 pm, Ryan Schmidt  wrote:
>
> > On Jan 11, 2011, at 07:10, javier0051 wrote:
> > > Code | Context
>
> > > $sql       =       "SELECT COUNT(*) AS `count` FROM `articles` AS 
> > > `Article` LEFT
> > > JOIN `categories` AS `Category` ON (`Article`.`category_id` =
> > > `Category`.`id`) LEFT JOIN `images` AS `Image` ON
> > > (`Image`.`foreign_id` = `Article`.`id` AND `Image`.`thumb` = 1 AND
> > > `Image`.`model` = 'Article') LEFT JOIN `galleries` AS `Gallery` ON
> > > (`Gallery`.`article_id` = `Article`.`id`)  WHERE conditions = ('43')
> > > "
> > > $error     =       "1054: Unknown column 'conditions' in 'where clause'"
>
> > At the risk of stating the obvious, it sounds like there is no column 
> > called "conditions".
>
> a missing field named conditions shouts app-code error to me. Given it
> comes from a paginate call, I guess this is in the code:
>
> ->paginate(array('conditions' => array(43)));
>
> which is simply wrong.
>
> javier I'd suggest doing the blog tutorial before continuing - it'll
> answer these sort of problems for you by example.
>
> AD
> ps. there's a spanish google group cakephp-esp

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


different pagination across views (not controllers)

2011-01-11 Thread Devario Johnson
Hi, im sure this is a simple question but i can't find any docs
related to this...

I have multiple views coming from one controller (as normal)

I would like to paginate them differently in each view.

say view a, b, and c, are paginated ASC and view d, and e, are
paginated DESC

I have in my controller at the top the var $paginate with order
defined.

this seems to effect ALL uses of the $this->paginate across any views
associated with the controller.

How do I get them to act independently?

I already tried removing it from the top and adding it in each
function but that didnt work.
I also tried adding 'order' to the actual paginate (find) query and
that does not work either...

any ideas?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Clueless...Help please

2011-01-11 Thread AD7six


On Jan 11, 3:37 pm, Ryan Schmidt  wrote:
> On Jan 11, 2011, at 07:10, javier0051 wrote:
> > Code | Context
>
> > $sql       =       "SELECT COUNT(*) AS `count` FROM `articles` AS `Article` 
> > LEFT
> > JOIN `categories` AS `Category` ON (`Article`.`category_id` =
> > `Category`.`id`) LEFT JOIN `images` AS `Image` ON
> > (`Image`.`foreign_id` = `Article`.`id` AND `Image`.`thumb` = 1 AND
> > `Image`.`model` = 'Article') LEFT JOIN `galleries` AS `Gallery` ON
> > (`Gallery`.`article_id` = `Article`.`id`)  WHERE conditions = ('43')
> > "
> > $error     =       "1054: Unknown column 'conditions' in 'where clause'"
>
> At the risk of stating the obvious, it sounds like there is no column called 
> "conditions".

a missing field named conditions shouts app-code error to me. Given it
comes from a paginate call, I guess this is in the code:

->paginate(array('conditions' => array(43)));

which is simply wrong.

javier I'd suggest doing the blog tutorial before continuing - it'll
answer these sort of problems for you by example.

AD
ps. there's a spanish google group cakephp-esp

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Clueless...Help please

2011-01-11 Thread Ryan Schmidt

On Jan 11, 2011, at 07:10, javier0051 wrote:

> Alright... I set the debug mode to 1 under config/core.php... There's
> indeed an error (thoug the site is setup just as in the old machine).
> This is what I'm getting:
> 
> ---
> Warning (512): SQL Error: 1054: Unknown column 'conditions' in 'where
> clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 525]
> 
> Code | Context
> 
> $sql  =   "SELECT COUNT(*) AS `count` FROM `articles` AS `Article` LEFT
> JOIN `categories` AS `Category` ON (`Article`.`category_id` =
> `Category`.`id`) LEFT JOIN `images` AS `Image` ON
> (`Image`.`foreign_id` = `Article`.`id` AND `Image`.`thumb` = 1 AND
> `Image`.`model` = 'Article') LEFT JOIN `galleries` AS `Gallery` ON
> (`Gallery`.`article_id` = `Article`.`id`)  WHERE conditions = ('43')
> "
> $error=   "1054: Unknown column 'conditions' in 'where clause'"

At the risk of stating the obvious, it sounds like there is no column called 
"conditions". Is there a column called "conditions" in any of the tables being 
used in this query? (Off hand, I'm not sure which table it wants that column to 
be in.)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: I am getting an error like this after i submit an action.

2011-01-11 Thread Andi
The Problem is the redirecting a page over the php header() function.
This just works, if there is absolutly NO output send. CakePHP uses
the header-redirect for redirecting between the controller actions. So
if you have an output e.g. with debug() you will get the information,
that no redirecting is possible.

More information about header() function: 
http://php.net/manual/en/function.header.php

On 10 Jan., 12:39, Deepak  wrote:
> Warning (2): Cannot modify header information - headers already sent
> by (output started at C:\xampp\htdocs\todo\app\models\post.php:9) [CORE
> \cake\libs\controller\controller.php, line 742]
> Code | Context
>
> $status =       "Location:http://localhost/todo/posts";
>
> header - [internal], line ??
> Controller::header() - CORE\cake\libs\controller\controller.php, line
> 742
> Controller::redirect() - CORE\cake\libs\controller\controller.php,
> line 721
> PostsController::delete() - APP\controllers\posts_controller.php, line
> 64
> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
> [main] - APP\webroot\index.php, line 85
>
> please help me as i want to finish it of as early as possible.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Use CakePHP in NetBeans IDE 6.8

2011-01-11 Thread clod

I use and suggest free portable PHP IDE -  http://www.codelobster.com
Codelobster PHP Edition  with special CakePHP plug-in for auto-completion,
context help and etc.
-- 
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Use-CakePHP-in-NetBeans-IDE-6-8-tp3289370p3336106.html
Sent from the CakePHP mailing list archive at Nabble.com.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to paginate HABTM relations

2011-01-11 Thread Andi
Hi,

I always have similar problems. With HABTM you have to join the tables
by yourself over the options-array.

Look here for the syntax:
http://book.cakephp.org/view/872/Joining-tables

This should also work with the pafinate method.

On 11 Jan., 02:29, Synue Cunioci  wrote:
> Hi everybody!
>
> Here is the thing: I have a table called tags and other six
> tables(informatives, courses, activities, events, documents and
> clippinngs) that has a a HABTM relation with the table tags.
>
> I have something that I call supertags. It´s a list of the 8 most
> tagged tag. This list contains a link to a method that receives the id
> of the tag and should return another list (an paginated one) with the
> entries of the other tables (informatives, courses, activities,
> events, documents and clippinngs) that have the relation with the tag.
>
> What I did at first was $this->Tag->find('first', array('conditions'
> => array('Tag.id' => '$id')), with recursive=1 and then manipulate the
> array.
>
> But then I discovered that the paginate() method needs the first
> params to be a model, and not an array.
>
> So I read a lot of posts about paginate and HABTM relations but since,
> I'm new at cake, I couldn't understand a bit. I think that the answer
> lies on something about afterFind and bind.
>
> So, can someone with a lot of patience explain to me how to join the
> tables and fetch the result paginated??
>
> Thanks in Advance!!
>
> PS: Cricket, if you see the post can you reply to me? You are the only
> one that replied my posts

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cake source code optimization

2011-01-11 Thread euromark
there is none :)
i already asked myself the same question
we got to be patient (but since dev is already released in can only be
a matter of a few months)

On 11 Jan., 10:04, Adrian Arnautu  wrote:
> I'm not tracking the dev progress, could you tell me when the 2.0 release is
> to be scheduled?
>
> Thanks,
> Adrian
>
> On Tue, Jan 11, 2011 at 1:10 AM, euromark wrote:
>
>
>
>
>
>
>
> > thats what i remarked at the end :)
> > i suppose it does
>
> > as for the other bottlenecks we will have to wait for 2.0 (and lazy
> > loading for all kinds of stuff)
>
> > On 10 Jan., 17:05, Jon Bennett  wrote:
> > > > i would have liked that cake offered some kind of packed core (like CI
> > > > - code igniter - does)
>
> > > > all relevant core files that are required on every single request
> > > > (30-40?) combined and minified
> > > > directly included by the dispatcher or whatever
> > > > although opcode cache should already minimize the include process
> > > > delay
>
> > > doesn't using an opcode cache like APC makes minifying php source
> > > completely pointless?
>
> > > j
>
> > > --
> > > jon bennett -www.jben.net-blog.jben.net
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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 > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Clueless...Help please

2011-01-11 Thread javier0051
Alright... I set the debug mode to 1 under config/core.php... There's
indeed an error (thoug the site is setup just as in the old machine).
This is what I'm getting:

---
Warning (512): SQL Error: 1054: Unknown column 'conditions' in 'where
clause' [CORE/cake/libs/model/datasources/dbo_source.php, line 525]

Code | Context

$sql=   "SELECT COUNT(*) AS `count` FROM `articles` AS `Article` LEFT
JOIN `categories` AS `Category` ON (`Article`.`category_id` =
`Category`.`id`) LEFT JOIN `images` AS `Image` ON
(`Image`.`foreign_id` = `Article`.`id` AND `Image`.`thumb` = 1 AND
`Image`.`model` = 'Article') LEFT JOIN `galleries` AS `Gallery` ON
(`Gallery`.`article_id` = `Article`.`id`)  WHERE conditions = ('43')
"
$error  =   "1054: Unknown column 'conditions' in 'where clause'"
$out=   null

$out = null;
if ($error) {
trigger_error("SQL Error: {$this->error}",
E_USER_WARNING);

DboSource::showQuery() - CORE/cake/libs/model/datasources/
dbo_source.php, line 525
DboSource::execute() - CORE/cake/libs/model/datasources/
dbo_source.php, line 201
DboSource::fetchAll() - CORE/cake/libs/model/datasources/
dbo_source.php, line 336
DboSource::read() - CORE/cake/libs/model/datasources/dbo_source.php,
line 653
Model::find() - CORE/cake/libs/model/model.php, line 1988
Controller::paginate() - CORE/cake/libs/controller/controller.php,
line 1070
CategoriesController::view() - APP/controllers/
categories_controller.php, line 39
Object::dispatchMethod() - CORE/cake/libs/object.php, line 116
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 227
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 194
[main] - APP/webroot/index.php, line 84

Query: SELECT COUNT(*) AS `count` FROM `articles` AS `Article` LEFT
JOIN `categories` AS `Category` ON (`Article`.`category_id` =
`Category`.`id`) LEFT JOIN `images` AS `Image` ON
(`Image`.`foreign_id` = `Article`.`id` AND `Image`.`thumb` = 1 AND
`Image`.`model` = 'Article') LEFT JOIN `galleries` AS `Gallery` ON
(`Gallery`.`article_id` = `Article`.`id`) WHERE conditions = ('43')

Query: SELECT `Article`.`id`, `Article`.`title`, `Article`.`preview`,
`Article`.`body`, `Article`.`category_id`, `Article`.`created`,
`Article`.`modified`, `Article`.`hot`, `Category`.`id`,
`Category`.`name`, `Category`.`description`, `Category`.`parent_id`,
`Category`.`url`, `Category`.`show_date`, `Category`.`order`,
`Image`.`id`, `Image`.`model`, `Image`.`foreign_id`,
`Image`.`filename`, `Image`.`dir`, `Image`.`mimetype`,
`Image`.`filesize`, `Image`.`height`, `Image`.`width`,
`Image`.`thumb`, `Image`.`description`, `Image`.`order`,
`Image`.`created`, `Image`.`modified`, `Gallery`.`id`,
`Gallery`.`name`, `Gallery`.`created`, `Gallery`.`article_id` FROM
`articles` AS `Article` LEFT JOIN `categories` AS `Category` ON
(`Article`.`category_id` = `Category`.`id`) LEFT JOIN `images` AS
`Image` ON (`Image`.`foreign_id` = `Article`.`id` AND `Image`.`thumb`
= 1 AND `Image`.`model` = 'Article') LEFT JOIN `galleries` AS
`Gallery` ON (`Gallery`.`article_id` = `Article`.`id`) WHERE
conditions = ('43') ORDER BY `Article`.`created` DESC LIMIT 10

ACEP: Asociación Civil Estudios Populares

* Home
* Sobre Nosotros
* Contacto

  Warning (512): SQL Error: 1064: You have an error in your SQL
syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near '__resetAssociations' at line 1 [CORE/
cake/libs/model/datasources/dbo_source.php, line 525]

  Code | Context

  $sql  =   "__resetAssociations"
  $error=   "1064: You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '__resetAssociations' at line 1"
  $out  =   null

  $out = null;
  if ($error) {
  trigger_error("SQL Error: {$this->error}",
E_USER_WARNING);

  DboSource::showQuery() - CORE/cake/libs/model/datasources/
dbo_source.php, line 525
  DboSource::execute() - CORE/cake/libs/model/datasources/
dbo_source.php, line 201
  DboSource::fetchAll() - CORE/cake/libs/model/datasources/
dbo_source.php, line 336
  DboSource::query() - CORE/cake/libs/model/datasources/
dbo_source.php, line 297
  Model::call__() - CORE/cake/libs/model/model.php, line 441
  Overloadable::__call() - CORE/cake/libs/overloadable_php5.php,
line 52
  Button::__resetAssociations() - [internal], line ??
  BindableBehavior::resetBindable() - APP/models/behaviors/
bindable.php, line 258
  BindableBehavior::afterFind() - APP/models/behaviors/
bindable.php, line 317
  ModelBehavior::dispatchMethod() - CORE/cake/libs/model/
behavior.php, line 162
  

Re: Clueless...Help please

2011-01-11 Thread javier0051
Thanks for replying Tarique.

Actually I don't get any errors, the app just doesn't seem to find the
contents that were actually visible on the site mounted on the old
server. The contents are actually stored in the db... The URL is
http://www.acepweb.org.ar  The main page is totally visible but when I
click a button to get to the secondary sections, eg. news, I get not
an error message but a message indicating that no  articles were found
on the category... I'm still totally clueless about this

On 11 ene, 00:06, "Dr. Tarique Sani"  wrote:
> Can't seem to reach the URL you have mentioned but have you tried
> setting the Debug on?
>
> Probably you are not seeing any errors because Debug is set to 0
>
> HTH
> Tarique
>
> On Mon, Jan 10, 2011 at 7:43 PM, javier0051  wrote:
> > Hi
>
> > I am a completely newbie to cake php. A new customer has a site
> > developed with cake php and we recently moved the site to one of our
> > boxes but we haven't been able to show all the page's content. No
> > errors, the news & articles and other stuff are actually in the
> > database BUT no contents are displayed. (site's main page:www.acepweb.org.ar
> > Undisplayed contents example url (http://www.acepweb.org.ar/c/noticias/
> > ultimas-noticias)
>
> > The problem comes when trying to access one of the interior sections.
> > The contents are in the database, the routing.php file has this line
> > "(Router::connect('/c/:categoria/:subcategoria', array('controller' =>
> > 'categories', 'action' => 'view', 'categoria' => null, 'subcategoria'
> > => null));)" directing to some /c/ folder or whatever it is but it is
> > not physically present.
>
> > The connection to the db is established propperly but at this point I
> > am totally clueless on how to get that example page to display the
> > contents it used to display when hosted on the other box, with same
> > cPanel, same linux operating system.
>
> > Thank you .Help will be totally appreciated
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> > with their CakePHP related questions.
>
> > 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 For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en
>
> --
> =
> Cheesecake-Photoblog:http://cheesecake-photoblog.org
> PHP for E-Biz:http://sanisoft.com
> =

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: is it possible to include the failed input string in the validation message?

2011-01-11 Thread Ryan Schmidt

On Dec 31, 2010, at 02:27, netusco wrote:

>> As for the second point about handling this in the controller. It's
>> the manual itself that says this should be handled with FormHelper.
>> From this page here: http://book.cakephp.org/view/1143/Data-Validation
>> , it says: "For more information about how to handle the displaying of
>> validation errors, check out the section covering FormHelper."

First of all, when it refers us to the FormHelper for information on how to 
display validation errors, I read that as saying that the view will be 
*displaying* the validation errors, yes, but that they will be *generated* 
elsewhere, e.g. by the model.

But the book is contradictory on this point. On the one hand, on the very page 
you link to above, it shows the validation error message being provided by the 
model; it's part of the $validate array. This is also how things get set up if 
you use "cake bake" to bake your model. This makes sense to me and is how I am 
doing it in my application. If I'm going to be defining validation rules in my 
model, then it makes sense that the error message for failure to validate that 
same rule should be defined right there as well.


On the other hand, the FormHelper page does show an example of how to "override 
the model error messages", and the example shows using the __() function to 
localize the message:

http://book.cakephp.org/view/1401/options-error

I cannot think of a case where I would want to do such a thing; in my opinion 
the validation error message is intimately tied to the model, so should be 
defined there.


The book also says "displaying localized content is done using the __() 
convenience function, or one of the other translation functions all of which 
are globally available, but probably be best utilized in your views":

http://book.cakephp.org/view/1230/Localization-in-CakePHP

I am at a loss to explain why the book would suggest that these localization 
functions are best used from views; in my opinion, they're best used wherever 
it is that I'm defining text that needs to be localized, and if that happens to 
be in my model, then that's the best place to use it. Certainly I will be using 
it in views, for labels and such, but there's no reason why I shouldn't use it 
any other place in my app that I'm defining localizable text.


> For those who use i28n, error messages need to be in our views,
> otherwise they cannot be translated from our models.

Sure they can. Certainly, if you take a validation rule baked by the default 
templates, for example:

var $validate = array(
'password' => array(
'rule' => array('minLength', '8'),
'message' => 'Your password must be at least 8 characters long.',
),
);

...and you try to localize that:

var $validate = array(
'password' => array(
'rule' => array('minLength', '8'),
'message' => __('Your password must be at least 8 characters 
long.', true),
),
);

...you will quickly discover that this is in fact a PHP syntax error:

Parse error: syntax error, unexpected '(', expecting ')'

You cannot call a PHP function while initializing a class variable like this. 
It's just how the PHP language works.

However, you can easily change the initialization of the validate array so that 
it occurs inside a constructor:

function __construct() {
parent::__construct();
$this->validate = array(
'password' => array(
'rule' => array('minLength', '8'),
'message' => __('Your password must be at least 8 characters 
long.', true),
),
);
}

This is what I am using in my app; I've also changed my baking templates to 
generate this code for me for new models. I can't think of a reason why I 
wouldn't want to do it this way. Can you?




Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: manipulation of fields before saving - how to get it to work for saveAll?

2011-01-11 Thread Zeu5
What if the saveAll is called from the parent model rather than from
the actual model itself?

nope, i am not passing anything other than $data.

On Jan 11, 7:56 pm, Amit Badkas  wrote:
> Hi,
>
> The saveAll() internally calls save(), that's why I suggested to use
> beforeSave(). Are you passing any option to saveAll() other than data?
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
>
>
>
>
>
>
> On Tue, Jan 11, 2011 at 5:11 PM, Zeu5  wrote:
> > Thank you Amit, but the same issue arises.
>
> > in a saveAll, the fields are not directly at ['model_alias']
> > ['field_name']
>
> > so changing it to beforeSave would not help.
>
> > I am not sure if i have made myself clear enough.
>
> > On Jan 11, 7:36 pm, Amit Badkas  wrote:
> > > Hi,
>
> > > I think you need to try beforeSave() instead of beforeValidate(), hope it
> > > may work.
>
> > > Amit Badkas
>
> > > PHP Applications for E-Biz:http://www.sanisoft.com
>
> > > On Tue, Jan 11, 2011 at 5:02 PM, Zeu5  wrote:
> > > > let say my model Link has 3 fields
> > > > route, model, action,
>
> > > > what I want is that route is the combination of model and action.
>
> > > > eg
> > > > model = '/orders/view/';
> > > > action = '3';
>
> > > > so route is '/orders/view/3';
>
> > > > i did this in my beforeValidate
>
> > > > if (isset($this->data['Link']['model']) && isset($this->data['Link']
> > > > ['action'])) {
> > > >                        $this->data['Link']['route'] =
> > > > $this->data['Link']['model'] . $this-
> > > > >data['Link']['action'];
> > > > }
>
> > > > now the problem is when i do a saveAll, this will not work.
>
> > > > because the data will be
>
> > > > Array(
> > > >        [Link] => Array(
> > > >               [0] => Array(
> > > >                     [id] => 3,
> > > >                     [model]=>'/orders/view/',
> > > >                     [action]=>'3'
> > > >               )
> > > >        )
> > > > )
>
> > > > Please advise.
>
> > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
> > others
> > > > with their CakePHP related questions.
>
> > > > 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 > > >  om>
> > For more options, visit this
> > group at
> > > >http://groups.google.com/group/cake-php?hl=en
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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 > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: manipulation of fields before saving - how to get it to work for saveAll?

2011-01-11 Thread Amit Badkas
Hi,

The saveAll() internally calls save(), that's why I suggested to use
beforeSave(). Are you passing any option to saveAll() other than data?

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Tue, Jan 11, 2011 at 5:11 PM, Zeu5  wrote:

> Thank you Amit, but the same issue arises.
>
> in a saveAll, the fields are not directly at ['model_alias']
> ['field_name']
>
> so changing it to beforeSave would not help.
>
> I am not sure if i have made myself clear enough.
>
> On Jan 11, 7:36 pm, Amit Badkas  wrote:
> > Hi,
> >
> > I think you need to try beforeSave() instead of beforeValidate(), hope it
> > may work.
> >
> > Amit Badkas
> >
> > PHP Applications for E-Biz:http://www.sanisoft.com
> >
> >
> >
> >
> >
> >
> >
> > On Tue, Jan 11, 2011 at 5:02 PM, Zeu5  wrote:
> > > let say my model Link has 3 fields
> > > route, model, action,
> >
> > > what I want is that route is the combination of model and action.
> >
> > > eg
> > > model = '/orders/view/';
> > > action = '3';
> >
> > > so route is '/orders/view/3';
> >
> > > i did this in my beforeValidate
> >
> > > if (isset($this->data['Link']['model']) && isset($this->data['Link']
> > > ['action'])) {
> > >$this->data['Link']['route'] =
> > > $this->data['Link']['model'] . $this-
> > > >data['Link']['action'];
> > > }
> >
> > > now the problem is when i do a saveAll, this will not work.
> >
> > > because the data will be
> >
> > > Array(
> > >[Link] => Array(
> > >   [0] => Array(
> > > [id] => 3,
> > > [model]=>'/orders/view/',
> > > [action]=>'3'
> > >   )
> > >)
> > > )
> >
> > > Please advise.
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> others
> > > with their CakePHP related questions.
> >
> > > 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
> For more options, visit this
> group at
> > >http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: manipulation of fields before saving - how to get it to work for saveAll?

2011-01-11 Thread Zeu5
Thank you Amit, but the same issue arises.

in a saveAll, the fields are not directly at ['model_alias']
['field_name']

so changing it to beforeSave would not help.

I am not sure if i have made myself clear enough.

On Jan 11, 7:36 pm, Amit Badkas  wrote:
> Hi,
>
> I think you need to try beforeSave() instead of beforeValidate(), hope it
> may work.
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
>
>
>
>
>
>
> On Tue, Jan 11, 2011 at 5:02 PM, Zeu5  wrote:
> > let say my model Link has 3 fields
> > route, model, action,
>
> > what I want is that route is the combination of model and action.
>
> > eg
> > model = '/orders/view/';
> > action = '3';
>
> > so route is '/orders/view/3';
>
> > i did this in my beforeValidate
>
> > if (isset($this->data['Link']['model']) && isset($this->data['Link']
> > ['action'])) {
> >                        $this->data['Link']['route'] =
> > $this->data['Link']['model'] . $this-
> > >data['Link']['action'];
> > }
>
> > now the problem is when i do a saveAll, this will not work.
>
> > because the data will be
>
> > Array(
> >        [Link] => Array(
> >               [0] => Array(
> >                     [id] => 3,
> >                     [model]=>'/orders/view/',
> >                     [action]=>'3'
> >               )
> >        )
> > )
>
> > Please advise.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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 > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: manipulation of fields before saving - how to get it to work for saveAll?

2011-01-11 Thread Amit Badkas
Hi,

I think you need to try beforeSave() instead of beforeValidate(), hope it
may work.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Tue, Jan 11, 2011 at 5:02 PM, Zeu5  wrote:

> let say my model Link has 3 fields
> route, model, action,
>
> what I want is that route is the combination of model and action.
>
> eg
> model = '/orders/view/';
> action = '3';
>
> so route is '/orders/view/3';
>
> i did this in my beforeValidate
>
> if (isset($this->data['Link']['model']) && isset($this->data['Link']
> ['action'])) {
>$this->data['Link']['route'] =
> $this->data['Link']['model'] . $this-
> >data['Link']['action'];
> }
>
> now the problem is when i do a saveAll, this will not work.
>
> because the data will be
>
> Array(
>[Link] => Array(
>   [0] => Array(
> [id] => 3,
> [model]=>'/orders/view/',
> [action]=>'3'
>   )
>)
> )
>
> Please advise.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


manipulation of fields before saving - how to get it to work for saveAll?

2011-01-11 Thread Zeu5
let say my model Link has 3 fields
route, model, action,

what I want is that route is the combination of model and action.

eg
model = '/orders/view/';
action = '3';

so route is '/orders/view/3';

i did this in my beforeValidate

if (isset($this->data['Link']['model']) && isset($this->data['Link']
['action'])) {
$this->data['Link']['route'] = 
$this->data['Link']['model'] . $this-
>data['Link']['action'];
}

now the problem is when i do a saveAll, this will not work.

because the data will be

Array(
[Link] => Array(
   [0] => Array(
 [id] => 3,
 [model]=>'/orders/view/',
 [action]=>'3'
   )
)
)

Please advise.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Best way to achieve my ACL goal?

2011-01-11 Thread Jens Dittrich
I have asked a similar question a few days ago. If I understood you
correctly, then you basically want people to be member of more than
one group. I have been told that I would leave the normal acl way
there and I would have to implement my authentication myself.
Basically something like;

// in beforeFilter() eventually in app_controller.php
$this->Auth->authorize = 'controller';

and then implement a function isAuthorized()

function isAuthorized() {
 // get authed user

// Loop his groups
// foreach group call $this->Acl->check($group, $current_aco_path)
// if one call returns true, return true else false
}

regards,
Jens

On 7 Jan., 14:18, Pehmolelu  wrote:
> Hi folks! :)
>
> Im building a website and decided to use CakePHP as framework. So Im
> totally new to the framework and Im not familiar with alots of things.
> I have though spent tens of hours reading the CookBook througtly.
>
> I have a problem with ACL in my website, which is the reason Im
> writing this. I have read about the tree structure and dont know
> really if it fits to my purposes. Let me back up the story a bit...
>
> My website is divided in quite many sections. There are few groups who
> can control specific sections:
>
> Admins - Controls all
> General moderators - Controls same sections as moderators but with
> higher priviledges over some actions. They dont control things that
> content developers or general developers control.
> Moderators - Controls some sections (different than content
> developers).
> General content developers - Controls same sections as content
> developers but with higher priviledges over some actions.They dont
> control things that moderators or general moderators control.
> Content developers - Controls some sections (different than
> moderators).
>
> These are the "main" groups. However, there can be people who are
> mixed in groups like being General moderator and General content
> developer. Or being content developer and General moderator. so
> basically I would want a person to be able to be in multiple groups
> but as far as I understand this is not possible?
>
> There are also "special" groups (or roles) like "News writers" and
> "Critics" which have their specific sections that they are allowed to.
> Id like to have General moderators plus Admins ofcourse to have the
> priviledges these controls are accessed to. I'd also like to have some
> specific users from other groups to be in these groups(roles). Like
> Moderator being able to be in Critics group (or being a critic) aswell
> and thus having both pribiledges.
>
> How I can achieve this type of ACL with CakePHP? What approach I
> should use? If there is any good documentation somewhere, please link
> it. Im really interested in CakePHP and want to read more if there is
> some.
>
> Thanks :)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


PDF output issue after upgrading to 2.0-dev

2011-01-11 Thread Ernesto
Hi all

i just upgraded to 2.0-dev
the only big problem i'm encountering are on-the-fly generated PDFs
i'll use one of my views as example

model/controller: this is a PageController action, without data and
without model. it just changes the layout from "default" to "pdf"

PdfHelper: that's a simple TCPDF wrapper that loads an istance of
TCPDF during startup

layout:
[PHP]
header("content-type: application/pdf");
echo $content_for_layout
[/PHP]

view:
[PHP]
$this->Pdf->PdfLib->addPage()
//some random TCPDF commands
$this->Pdf->pdfLib->Output("myPDF");
[/PHP]

all this code worked flawlessy in 1.3.6 but in 2.0-dev the PDFs are
printed just like HTML code

%PDF-1.7 7 0 obj << /Type /Page /Parent 1 0 R /LastModified (D:
2011020027+01'00') /Resources 2 0 R /MediaBox [0.00 0.00 595.28
841.89] /CropBox [0.00 0.00 595.28 841.89] /BleedBox [0.00 0.00 595.28
841.89] /TrimBox [0.00 0.00 595.28 841.89] /ArtBox [0.00 0.00 595.28
841.89] /Contents 8 0 R /Rotate 0 /Group << /Type /Group /S /
Transparency /CS /DeviceRGB >> /Annots [ 6 0 R ] /PZ 1 >> endobj 8 0
obj <> stream x��]]��6�}��<��#�  ��jێ�x*��z\S Om� ��-IlSl{� H� 
$] h ��ʃ Q�

why?

is cake formatting the output?

i can't get rid of that

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: update db instead of insert if entry already exists - CakePHP

2011-01-11 Thread Stephen
>From the book [1]

//Create: id isn't set or is null
$this->Recipe->create();
$this->Recipe->save($this->data);

//Update: id is set to a numerical value

$this->Recipe->id = 2;
$this->Recipe->save($this->data);


[1] http://book.cakephp.org/view/1031/Saving-Your-Data

On 11 January 2011 10:23, Spha ps  wrote:

> Hi All,
>
> Im trying to update db instead of insert if entry already exists - CakePHP
> Any thoughts on how I could do that ?
>
> thanks
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


update db instead of insert if entry already exists - CakePHP

2011-01-11 Thread Spha ps
Hi All,

Im trying to update db instead of insert if entry already exists - CakePHP
Any thoughts on how I could do that ?

thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Check database

2011-01-11 Thread Stephen
You should look at this:

http://book.cakephp.org/view/1017/Retrieving-Your-Data

and this:

http://book.cakephp.org/view/1031/Saving-Your-Data

On 11 January 2011 09:52, Spha ps  wrote:

> Ok I will try this in the mean while but what I am doing is setting cookies
> so that it recognises that specific users details when they add info to the
> database so they enter their email among other things so thats why im using
> email to check for their details so that if they already exist then i add a
> new post for the same user and not add onther user with the same info but
> different id
>
>
> On Tue, Jan 11, 2011 at 11:34 AM, Stephen 
> wrote:
>
>> Try using:
>>
>> $user = $this->User->find('first', array('conditions' =>
>> array('User.email' => $email_address)));
>>
>> Although in most applications it's usually best to get the current user's
>> id from the auth component session data.
>> i.e. $this->Auth->user('id');
>>
>> Unless ofcourse you're doing something a little bit different
>>
>> Hth
>>
>> On 11 January 2011 09:03, Spha ps  wrote:
>>
>>> Hi all,
>>>
>>> I was wonder how would i go about check the users table to see if an
>>> email exists if it does get that id to add a new post for that user ?
>>>
>>> thanks in advance
>>> Spha
>>>
>>> Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> 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.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>
>>
>> --
>> Kind Regards
>>  Stephen @ NinjaCoderMonkey
>>
>>  www.ninjacodermonkey.co.uk
>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Check database

2011-01-11 Thread Spha ps
Ok I will try this in the mean while but what I am doing is setting cookies
so that it recognises that specific users details when they add info to the
database so they enter their email among other things so thats why im using
email to check for their details so that if they already exist then i add a
new post for the same user and not add onther user with the same info but
different id

On Tue, Jan 11, 2011 at 11:34 AM, Stephen wrote:

> Try using:
>
> $user = $this->User->find('first', array('conditions' => array('User.email'
> => $email_address)));
>
> Although in most applications it's usually best to get the current user's
> id from the auth component session data.
> i.e. $this->Auth->user('id');
>
> Unless ofcourse you're doing something a little bit different
>
> Hth
>
> On 11 January 2011 09:03, Spha ps  wrote:
>
>> Hi all,
>>
>> I was wonder how would i go about check the users table to see if an email
>> exists if it does get that id to add a new post for that user ?
>>
>> thanks in advance
>> Spha
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>
>
> --
> Kind Regards
>  Stephen @ NinjaCoderMonkey
>
>  www.ninjacodermonkey.co.uk
>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Fatal error: Call to undefined function __l()

2011-01-11 Thread Amit Badkas
Hi,

You can check in the old code, in which file does the 'function __l' string
contain.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Tue, Jan 11, 2011 at 2:39 PM, osamo101  wrote:

> Hi Amit,
>
> This is very strange, the __l() is repeated in the code over 8000
> times with strings i.e. __l('Delete'), do you have any idea about how
> this can happen?
>
> On Jan 11, 8:46 am, Amit Badkas  wrote:
> > Hi,
> >
> > I don't think there is/was any __l() function in CakePHP-1.2.x, it may be
> > written in any file which got overwritten.
> >
> > Amit Badkas
> >
> > PHP Applications for E-Biz:http://www.sanisoft.com
> >
> > On Tue, Jan 11, 2011 at 12:09 PM, osamo101  wrote:
> > > Hello,
> >
> > > I have a website written in CakePHP 1.2 and I am upgrading it to 1.3,
> > > when I try to run it, it displays the error "Fatal error: Call to
> > > undefined function __l() ", could you please tell me what is that
> > > function? and what function should I use instead of it if it is
> > > deprecated.
> >
> > > thanks in advance.
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> others
> > > with their CakePHP related questions.
> >
> > > 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
> >For
> more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=en
> >
> >
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Check database

2011-01-11 Thread Stephen
Try using:

$user = $this->User->find('first', array('conditions' => array('User.email'
=> $email_address)));

Although in most applications it's usually best to get the current user's id
from the auth component session data.
i.e. $this->Auth->user('id');

Unless ofcourse you're doing something a little bit different

Hth

On 11 January 2011 09:03, Spha ps  wrote:

> Hi all,
>
> I was wonder how would i go about check the users table to see if an email
> exists if it does get that id to add a new post for that user ?
>
> thanks in advance
> Spha
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Fatal error: Call to undefined function __l()

2011-01-11 Thread osamo101
Hi Amit,

This is very strange, the __l() is repeated in the code over 8000
times with strings i.e. __l('Delete'), do you have any idea about how
this can happen?

On Jan 11, 8:46 am, Amit Badkas  wrote:
> Hi,
>
> I don't think there is/was any __l() function in CakePHP-1.2.x, it may be
> written in any file which got overwritten.
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Tue, Jan 11, 2011 at 12:09 PM, osamo101  wrote:
> > Hello,
>
> > I have a website written in CakePHP 1.2 and I am upgrading it to 1.3,
> > when I try to run it, it displays the error "Fatal error: Call to
> > undefined function __l() ", could you please tell me what is that
> > function? and what function should I use instead of it if it is
> > deprecated.
>
> > thanks in advance.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cake source code optimization

2011-01-11 Thread Adrian Arnautu
I'm not tracking the dev progress, could you tell me when the 2.0 release is
to be scheduled?

Thanks,
Adrian

On Tue, Jan 11, 2011 at 1:10 AM, euromark wrote:

> thats what i remarked at the end :)
> i suppose it does
>
> as for the other bottlenecks we will have to wait for 2.0 (and lazy
> loading for all kinds of stuff)
>
>
>
> On 10 Jan., 17:05, Jon Bennett  wrote:
> > > i would have liked that cake offered some kind of packed core (like CI
> > > - code igniter - does)
> >
> > > all relevant core files that are required on every single request
> > > (30-40?) combined and minified
> > > directly included by the dispatcher or whatever
> > > although opcode cache should already minimize the include process
> > > delay
> >
> > doesn't using an opcode cache like APC makes minifying php source
> > completely pointless?
> >
> > j
> >
> > --
> > jon bennett -www.jben.net- blog.jben.net
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Check database

2011-01-11 Thread Spha ps
Hi all,

I was wonder how would i go about check the users table to see if an email
exists if it does get that id to add a new post for that user ?

thanks in advance
Spha

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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 For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en