Re: How & where to define a new class for routes

2010-01-31 Thread Miles J
http://mark-story.com/posts/view/using-custom-route-classes-in-cakephp

There's the post. Im sure the functionality hasn't been released yet.

On Jan 31, 7:52 pm, Ramkumar Ramkumar  wrote:
> Hey mark, I'm not sure I'm using your example. will you please give me the
> URL where you are going to explain it?
>
>
>
> On Sat, Jan 30, 2010 at 3:15 AM, mark_story  wrote:
> > Well considering you're using an example from my post, why not read
> > the rest of it.  I explain it there.
>
> > -Mark
>
> > On Jan 28, 11:47 pm, Ram  wrote:
> > > Hi all,
>
> > >      In my application i need to analyze the url, I seen in one
> > > article that in order to do this stuff we can define a class to routes
> > > like
>
> > > Router::connect('/:slug', array('controller' => 'posts', 'action' =>
> > > 'view'), array('routeClass' => 'SlugRoute'));
>
> > > I want to to where to define this SlugRoute class.
>
> > > Thanks,
> > > M.Ramkumar
>
> > 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
>
> --
> Thanks & Regards,
> M.Ramkumar

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


Associated Pagination

2010-01-31 Thread Changoso
Hello, I know this might be kind of a newbie question but hope you
could help.

I have 2 tables, Galleries and Photos.

One Gallery has many Photos

On my Gallery View/$id I have the common: "Gallery related Photos"
view.

What I want is to paginate the Related Photos.

I tried adding: $this->set('photos', $this->paginate("Photo")); in the
View Function.

so...

function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid Gallery.', true));
$this->redirect(array('action'=>'index'));
}
$this->set('photos', $this->paginate("Photo"));
$this->set('gallery', $this->Gallery->read(null, $id));

}

but its not working.. so... any idea?!

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


Tree Behaviour Help

2010-01-31 Thread Dave
Just starting with the tree behaviour to create a simple dynamic navigation.
 
So I added the cookbook steps to give me my:
 
My Categories

*   Fun 


*   Sport 


*   Surfing
*   Extreme knitting

*   Friends 


*   Gerald
*   Gwendolyn

*   Work 


*   Reports 


*   Annual
*   Status

*   Trips 


*   National
*   International

So i go to add but form is empty. How do i get it so it I want to add a new
item in Work i can select that? Or add an item to Fun/Sport i can add it
there type thing?
 
Thanks,
 
Dave

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 & where to define a new class for routes

2010-01-31 Thread Ramkumar Ramkumar
Hey mark, I'm not sure I'm using your example. will you please give me the
URL where you are going to explain it?

On Sat, Jan 30, 2010 at 3:15 AM, mark_story  wrote:

> Well considering you're using an example from my post, why not read
> the rest of it.  I explain it there.
>
> -Mark
>
> On Jan 28, 11:47 pm, Ram  wrote:
> > Hi all,
> >
> >  In my application i need to analyze the url, I seen in one
> > article that in order to do this stuff we can define a class to routes
> > like
> >
> > Router::connect('/:slug', array('controller' => 'posts', 'action' =>
> > 'view'), array('routeClass' => 'SlugRoute'));
> >
> > I want to to where to define this SlugRoute class.
> >
> > Thanks,
> > M.Ramkumar
>
> 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
>



-- 
Thanks & Regards,
M.Ramkumar

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: pages_controller.php in controllers folder not working

2010-01-31 Thread Dr. Loboto
Check routes. Together with standard pages controller cake have
standard routes for it.

On Jan 30, 4:36 pm, gautam lakum  wrote:
> Hi all,
>
> I have created pages_controller.php in controllers folder. There are
> two actions in it named index and getmodel. I have created index.ctp
> and getmodel.ctp in /app/views/pages. But when I try to 
> accesshttp://.../pages/indexorhttp://.../pages/getmodel, it gives error404
> error. One thing is I have customized the cakephp default error pages.
>
> But the question is why I can't access these urls although I have
> created pages_controller.php actions and its .ctp files.
>
> 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: Random question

2010-01-31 Thread Dr. Loboto
Of course yes. Everything have worse performance then static HTML.

On Jan 28, 10:55 pm, Jeremy Burns  wrote:
> This might seem a bit random/basic but I thought I'd ask it anyway. I
> love using the html helper, but is there a performance hit (even teeny
> tiny marginal because that can compound up) when calling up the helper
> to echo $html->tag('p', 'Hello world') compared a vanilla with
> Hello world?

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: disabling cache when a user is logged

2010-01-31 Thread euromark
this will never work
the session is initialized in __construct() of the app controller
therefore not available until beforeFilter() in any controller

the session will not be present at that time yet
or am i mistaken?


On 31 Jan., 22:09, majna  wrote:
> dirty way (not tested)
> in app/config/bootstrap.php
>
> check if user is logged in, like:
>
> if (isset($_SESSION['User']['id])) {
>    Configure::write('Cache.check', false);
>
> }
>
> On Jan 31, 11:32 am, Lorenzo Bettini  wrote:
>
> > Hi
>
> > in my AppController I've enabled cache for view and index actions and
> > they work fine.
>
> > Now, I'd like to disable cache when a user is logged, since in that case
> > additional information are shown that must not be cached.
>
> > Thus I added the method
>
> >         function beforeRender() {
> >                 if ($this->is_logged_user()) {
> >                         // disable cache when the user is logged, since 
> > some information
> >                         // must NOT be cached, e.g., private papers
> >                         $this->cacheAction = array();
> >                 }
> >         }
>
> > where is_logged_user is a function that checks whether a user is logged.
>
> > This works in the sense that no cache is used when a user is browsing
> > the site.  However, if the user visits an action page which has already
> > been cached then he will get the cached page, which I want to avoid as
> > well...  is there a way to avoid this?
>
> > I've also tried with $this->disableCache() but that does not work.
>
> > The only solution I see is to clear the cache, but I'd want to avoid that...
>
> > thanks in advance
> >         Lorenzo
>
> > --
> > Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
> > HOME:http://www.lorenzobettini.itMUSIC:http://www.purplesucker.com
> > BLOGS:http://tronprog.blogspot.com http://longlivemusic.blogspot.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: disabling cache when a user is logged

2010-01-31 Thread majna
dirty way (not tested)
in app/config/bootstrap.php

check if user is logged in, like:

if (isset($_SESSION['User']['id])) {
   Configure::write('Cache.check', false);
}



On Jan 31, 11:32 am, Lorenzo Bettini  wrote:
> Hi
>
> in my AppController I've enabled cache for view and index actions and
> they work fine.
>
> Now, I'd like to disable cache when a user is logged, since in that case
> additional information are shown that must not be cached.
>
> Thus I added the method
>
>         function beforeRender() {
>                 if ($this->is_logged_user()) {
>                         // disable cache when the user is logged, since some 
> information
>                         // must NOT be cached, e.g., private papers
>                         $this->cacheAction = array();
>                 }
>         }
>
> where is_logged_user is a function that checks whether a user is logged.
>
> This works in the sense that no cache is used when a user is browsing
> the site.  However, if the user visits an action page which has already
> been cached then he will get the cached page, which I want to avoid as
> well...  is there a way to avoid this?
>
> I've also tried with $this->disableCache() but that does not work.
>
> The only solution I see is to clear the cache, but I'd want to avoid that...
>
> thanks in advance
>         Lorenzo
>
> --
> Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
> HOME:http://www.lorenzobettini.itMUSIC:http://www.purplesucker.com
> BLOGS:http://tronprog.blogspot.com http://longlivemusic.blogspot.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: Javascript libraries with images/css inside Cake Plugins

2010-01-31 Thread Miles J
Well in that case, personally I would place everything in the vendors
folder, and not in a js/css folder.

On Jan 31, 4:16 am, Elte Hupkes  wrote:
> Yeah, the people I work for like wysiwyg though, so I'm kind'a stuck
> to TinyMCE. Changing the TinyMCE structure isn't really an option,
> that would be an awful lot of work. And it still doesn't solve the
> flash file problems.
>
> On Jan 30, 9:19 pm, Miles J  wrote:
>
> > Oh I also suggest Markitup compared to TinyMCE, because its a lot
> > smaller and easier, and just as awesome. I ran into the same problem
> > you did.
>
> > On Jan 30, 12:17 pm, Miles J  wrote:
>
> > > I have an easy answer for you... get ready for it.
>
> > > Your css/images/js DO NOT HAVE TO BE structured the same way they are
> > > when downloaded, move them around.
>
> > > I added Markitup to me plugin, so I customized the Markitup
> > > architecture to work with my plugin, not the other around.
>
> > > Take a gander:http://github.com/milesj/forum/tree/master/vendors/
>
> > > On Jan 30, 2:55 am, Elte Hupkes  wrote:
>
> > > > That URL no longer works, I believe it's located here 
> > > > now:http://cakephp.lighthouseapp.com/projects/42648/13-new-features-plugi...
>
> > > > Awesome news nontheless! Can't wait for a stable 1.3 release!
>
> > > > On Dec 3 2009, 4:12 pm, "Larry E. Masters aka PhpNut"
>
> > > >  wrote:
> > > > >http://code.cakephp.org/wiki/1.3/new-features/plugin-assets
>
> > > > > --
> > > > > /**
> > > > > * @author Larry E. Masters
> > > > > * @var string $userName
> > > > > * @param string $realName
> > > > > * @returns string aka PhpNut
> > > > > * @access  public
> > > > > */
>
> > > > > On Thu, Dec 3, 2009 at 4:53 AM, peterchenadded 
> > > > > wrote:
>
> > > > > > Have a look at mediaview (http://book.cakephp.org/view/489/Media-
> > > > > > Views).
>
> > > > > > Basically, it will give you access to any file on your system
> > > > > > including your plugins folder. If you name your controller and 
> > > > > > action
> > > > > > properly you should be able to achieve what you want.
>
> > > > > > Cheers.
>
> > > > > > Check out the new CakePHP Questions 
> > > > > > sitehttp://cakeqs.organdhelpothers
> > > > > > 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


Paginator helper bug cakephp 1.2

2010-01-31 Thread Pau
Hi.
I have created a database view and then bake it into a cake model.

I have:
MydbView Controller call:

$this->set('mydbview', $this->paginate('Mydbview'));

MydbView index view:

echo $paginator->counter(array(
 'format' => __('Página %page% de %pages%, Mostrando %current%
registros de %count% total, Empezando en el %start%, acabando en el
%end%', true)
 ));

This sentence display:
Página 1 de 1, Mostrando 3 registros de 3 total, Empezando en el 1,
acabando en el 3 ; ?>; ?>; ?>; ?>; ?>; ?>; ?>; ?>; ?>

I look for this unwanted chars in the helper's files but I haven´t
found the bug.

The table information in the index view work's fine, the problem is
only the $paginator->counter " ; ?>; ?>; ?>; ?>; ?>; ?>; ?>; ?>; ?>"
string.

Any idea?

OS: Windows XP PRO sp3.
Web Server: Wamp
Cakephp 1.2
Database: MySql

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


Facebook app pagination problem

2010-01-31 Thread depi
Hello,

Is there any way to get PaginationHelper work when developing Facebook
apps?

I am sorry to as it so general, but I believe that everyone who
developed for FB (FBML) encountered the same problem as me.

P.S. I implemented the Facebook API to CakePHP following this article
http://facebook-developer.net/2007/10/18/building-your-first-facebook-application-with-cakephp/

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


Facebook app pagination problem

2010-01-31 Thread depi
Hello,

I would like to ask how is it possible to use CakePHP with pagination
when developing a Facebook application.

I implemented Facebook API to CakePHP following this article
http://facebook-developer.net/2007/10/18/building-your-first-facebook-application-with-cakephp/.
Everything works almost fine (I have only problems with $html->link
and of course with the paginaton.

When I use pagination I get the following error:

URLExceptionUnable to parse URL: /directory/myapp/pictures/index/page:
2

Any ideas how to fix 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: Release: CakePHP 1.2.6

2010-01-31 Thread j0n4s.h4rtm...@googlemail.com
Now this is what I love about cake,
its so mature and stable, there are regular stability releases.

Thanks to all the contributes esp. the core team!

On Jan 30, 4:50 am, mark_story  wrote:
> The CakePHP development team is happy to announce CakePHP 1.2.6[1].
> 1.2.6 is a bug fix release of the latest stable branch. Check the
> changelog[2] for all the changes.
>
> CakePHP 1.2.6 Includes more than 160 commits improving performance and
> fixing more than 75 related tickets.  There have been a number of long
> standing issues fixed in 1.2.6 that may affect your application
> including:
>
> - Controller::$cacheAction now functions as documented
>   a87d31cc7f570a1ac03abc2c04b04f71e4f6c955
>
> - returning false from a beforeValidate actually cancels a save
> operation
>   e609875754103913927f4bab7f67323aa6529165
>
> - DboSource::fields() now accepts expression objects.
>   02330b2d9c292110240c606e976e182c973897e9
>
> - Configure::store() now correctly stores values with slashes.
>   862ff82ad48ef613df33447697e6b2f33903d464
>
> - App::import() can be used from bootstrap.php without the penalty of
> having no cache available.
>   82a2b1a01957ccbfd3a6abe31133f49b9005bced
>
> - Controller::paginate() now accounts for  limit:0 -
>   4bbfcbff7e90fab42bef39e01003113dc715a3b0
>
> - Debugger::log() does what its doc block says.
>   a31a2d264c2cd128de2db839fa2901680c7de2ba
>
> - group key was added to DboOracle
>   34deb2a18df1cf15c1b120333d47070c850db3fd
>
> - 'with' models failing validation will now make save() return false.
>   a490e249fa76b1076ab5ee255636f1f533560842
>
> Be sure to check the full changelog[2] for all changes that have
> occurred. The 1.3 branch continues progress and we hope to have a
> release candidate ready for release soon.  If you are interested in
> helping with the ongoing development of 1.3 please visit lighthouse[3]
> for additional information on how you can help.
>
> In other project news, the API documentation for 1.3 is now available
> athttp://api13.cakephp.org.  In addition to the 1.3 API, the 1.1 API
> has been restored as well, and can be found athttp://api11.cakephp.org.
> A big thanks to Graham Weldon (aka. Predominant) for getting the API's
> online.
>
> And as always, thank you for helping us make a great framework.
>
> [1]http://github.com/cakephp/cakephp1x/downloads
> [2]http://cakephp.lighthouseapp.com/projects/42648/changelog-1-2-6
> [3]http://cakephp.lighthouseapp.com/how-you-can-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: Javascript libraries with images/css inside Cake Plugins

2010-01-31 Thread Elte Hupkes
Yeah, the people I work for like wysiwyg though, so I'm kind'a stuck
to TinyMCE. Changing the TinyMCE structure isn't really an option,
that would be an awful lot of work. And it still doesn't solve the
flash file problems.

On Jan 30, 9:19 pm, Miles J  wrote:
> Oh I also suggest Markitup compared to TinyMCE, because its a lot
> smaller and easier, and just as awesome. I ran into the same problem
> you did.
>
> On Jan 30, 12:17 pm, Miles J  wrote:
>
> > I have an easy answer for you... get ready for it.
>
> > Your css/images/js DO NOT HAVE TO BE structured the same way they are
> > when downloaded, move them around.
>
> > I added Markitup to me plugin, so I customized the Markitup
> > architecture to work with my plugin, not the other around.
>
> > Take a gander:http://github.com/milesj/forum/tree/master/vendors/
>
> > On Jan 30, 2:55 am, Elte Hupkes  wrote:
>
> > > That URL no longer works, I believe it's located here 
> > > now:http://cakephp.lighthouseapp.com/projects/42648/13-new-features-plugi...
>
> > > Awesome news nontheless! Can't wait for a stable 1.3 release!
>
> > > On Dec 3 2009, 4:12 pm, "Larry E. Masters aka PhpNut"
>
> > >  wrote:
> > > >http://code.cakephp.org/wiki/1.3/new-features/plugin-assets
>
> > > > --
> > > > /**
> > > > * @author Larry E. Masters
> > > > * @var string $userName
> > > > * @param string $realName
> > > > * @returns string aka PhpNut
> > > > * @access  public
> > > > */
>
> > > > On Thu, Dec 3, 2009 at 4:53 AM, peterchenadded 
> > > > wrote:
>
> > > > > Have a look at mediaview (http://book.cakephp.org/view/489/Media-
> > > > > Views).
>
> > > > > Basically, it will give you access to any file on your system
> > > > > including your plugins folder. If you name your controller and action
> > > > > properly you should be able to achieve what you want.
>
> > > > > Cheers.
>
> > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpothers
> > > > > 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: Weird problem with form that doesn't use model

2010-01-31 Thread Jules
Bingo! It's a beautiful thing. Thanks Miles J.

On Jan 31, 9:27 pm, Miles J  wrote:
> Try null instead of false, see if that works.
>
> On Jan 30, 8:02 pm, Jules  wrote:
>
> > Hi everyone, I'm experiencing extreme frustration with this problem!
> > Luckily, it's easy to reproduce.
>
> > In any controller, create this method;
>
> > function test() {
> >        debug($this->data);
>
> > }
>
> > Then create a corresponding view called 'test';
>
> >  > echo $form->create(false,array('action'=>'test'));
> > echo $form->input('address');
> > echo $form->end('Submit');
> > ?>
>
> > You'll note that the form is created WITHOUT a model.
>
> > When I enter something into the field, however, the page returns with
> > ONLY THE FIRST character populated in the field! E.g., if I enter '123
> > smith st', when it reloads it only say '1'.
>
> > Examining $this->data, I can see that the whole string is being
> > passed. Can anyone help?
>
> > P.S. there's a good reason I'm not using the model.

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


disabling cache when a user is logged

2010-01-31 Thread Lorenzo Bettini

Hi

in my AppController I've enabled cache for view and index actions and 
they work fine.


Now, I'd like to disable cache when a user is logged, since in that case 
additional information are shown that must not be cached.


Thus I added the method

function beforeRender() {
if ($this->is_logged_user()) {
// disable cache when the user is logged, since some 
information
// must NOT be cached, e.g., private papers
$this->cacheAction = array();
}
}

where is_logged_user is a function that checks whether a user is logged.

This works in the sense that no cache is used when a user is browsing 
the site.  However, if the user visits an action page which has already 
been cached then he will get the cached page, which I want to avoid as 
well...  is there a way to avoid this?


I've also tried with $this->disableCache() but that does not work.

The only solution I see is to clear the cache, but I'd want to avoid that...

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com  http://longlivemusic.blogspot.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: Weird problem with form that doesn't use model

2010-01-31 Thread Miles J
Try null instead of false, see if that works.

On Jan 30, 8:02 pm, Jules  wrote:
> Hi everyone, I'm experiencing extreme frustration with this problem!
> Luckily, it's easy to reproduce.
>
> In any controller, create this method;
>
> function test() {
>        debug($this->data);
>
> }
>
> Then create a corresponding view called 'test';
>
>  echo $form->create(false,array('action'=>'test'));
> echo $form->input('address');
> echo $form->end('Submit');
> ?>
>
> You'll note that the form is created WITHOUT a model.
>
> When I enter something into the field, however, the page returns with
> ONLY THE FIRST character populated in the field! E.g., if I enter '123
> smith st', when it reloads it only say '1'.
>
> Examining $this->data, I can see that the whole string is being
> passed. Can anyone help?
>
> P.S. there's a good reason I'm not using the model.

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: i18n partial translation

2010-01-31 Thread bram
I just found out that cake keeps a cache of the translations in

/app/tmp/cache/persistent

If you remove all files* in there, the translation should work fine
again.

Cheers,

B.


*If you only want to remove the lang cache, you can identify them as:

cake_core_{lang domain}_{lang code}

for example:

cake_core_default_dut

On Jan 8, 10:59 pm, lemp  wrote:
> Since upgrading to Cake 1.2.5, most of the string in my app do not
> translate any more (but some do).
>
> I checked and config.language is set properly.
>
> Any suggestions on where and what I should be looking for to debug
> this?

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: array + sql problem

2010-01-31 Thread newbie
got it before it  was acked

start with is not for that :/

i should have add % mark at the end of searched date $creaded [10]=%
and use LIKE,  WHERE Audit.created  LIKE $creaded

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