Sunday, January 31, 2010

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

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 <ramkumar.r...@gmail.com> 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 <mark.st...@gmail.com> 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 <ramkumar.r...@gmail.com> 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>For 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Associated Pagination

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

Tree Behaviour Help

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

cookies / localhost / mac

I am using cakephp 1.2 on my mac. i cannot get $this->Cookie->write
to actually write a cookie. i am guessing this has something to do
with my localhost development environment, but I can't find any
information on this issue. can someone 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+unsubscribe@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

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 <mark.story@gmail.com> 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 <ramkumar.r...@gmail.com> 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+unsubscribe@googlegroups.com For 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+unsubscribe@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

Check routes. Together with standard pages controller cake have
standard routes for it.

On Jan 30, 4:36 pm, gautam lakum <lakum7...@gmail.com> 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Random question

Of course yes. Everything have worse performance then static HTML.

On Jan 28, 10:55 pm, Jeremy Burns <jeremybu...@me.com> 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
> <p>Hello world</p>?

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+unsubscribe@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

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 <majna...@gmail.com> 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 <bett...@dsi.unifi.it> 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+unsubscribe@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

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 <bett...@dsi.unifi.it> 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+unsubscribe@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

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 <ell...@gmail.com> 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 <mileswjohn...@gmail.com> 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 <mileswjohn...@gmail.com> 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 <ell...@gmail.com> 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"
>
> > > > <php...@gmail.com> 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 <peterchenad...@gmail.com>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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Release: CakePHP 1.2.6

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 <mark.st...@gmail.com> 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+unsubscribe@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

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 <mileswjohn...@gmail.com> 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 <mileswjohn...@gmail.com> 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 <ell...@gmail.com> 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"
>
> > > <php...@gmail.com> 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 <peterchenad...@gmail.com>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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Paginator helper bug cakephp 1.2

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+unsubscribe@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

Bingo! It's a beautiful thing. Thanks Miles J.

On Jan 31, 9:27 pm, Miles J <mileswjohn...@gmail.com> wrote:
> Try null instead of false, see if that works.
>
> On Jan 30, 8:02 pm, Jules <fattyju...@gmail.com> 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';
>
> > <?php
> > 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+unsubscribe@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

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+unsubscribe@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

Try null instead of false, see if that works.

On Jan 30, 8:02 pm, Jules <fattyju...@gmail.com> 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';
>
> <?php
> 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: i18n partial translation

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

Re: array + sql problem

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

Saturday, January 30, 2010

Re: how to save data from a model and all related models to a new table on 'completion'?

Is there an easy or good way to convert the data to a new table for
archives? Going back to the real project tables of using a work_order
and invoice: Once a work_order has been flagged as 'completed' on the
afterSave maybe create an array with all the related data 'belonging'
to Invoice and save it all? If you did it that way how would you save
the Invoice from the WorkOrder model since they're not really related?


I think both models are related: In the invoice is desirable to have the
work_order that origin it, even thought the work_order changes later.
If you still think there should not be a relation, you can do, as you
suggest:

In work_order:

function afterSave($created) {
App::import('Model', 'Invoice');
$Invoice = new Invoice();

... // Get all necessary data on an array $data

$Invoice->save($data);
}


Hope this helps!

MARTIN


On 01/30/2010 04:22 PM, fly2279 wrote:
> I am building a 'work_order' table that I need to convert to an
> invoice once it's been flagged as 'completed'. I need to save all the
> related models' information also when converting so that I can go back
> and look at an invoice and see all the related data too, even if the
> original related data to the 'work_order' table has been changed or
> deleted.
>
> I'll use the standard blog schema to make it easy. I have a Post model
> that hasMany Comments, HABTM Tags, and belongsTo User. In the Post
> table there is a boolean column for 'published'. When the Post is
> flagged as 'published' I'd like to copy over the data from the Post
> into a new table for archiving purposes but I also need to copy the
> Users, Comments and Tags data that are related to that Post to their
> respective 'archived' tables so that if a User gets changed (i.e.
> address or phone changes) or deleted from the User table the row of
> user information is still in the archived table as it was originally.
>
> Is there an easy or good way to convert the data to a new table for
> archives? Going back to the real project tables of using a work_order
> and invoice: Once a work_order has been flagged as 'completed' on the
> afterSave maybe create an array with all the related data 'belonging'
> to Invoice and save it all? If you did it that way how would you save
> the Invoice from the WorkOrder model since they're not really related?
>
> Does anyone have a good practice or suggestions on how it should be
> done?
>
> 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+unsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Weird problem with form that doesn't use model

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

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

Admin Section as plugin

Hello,

i want to create a plugin, which covers a little admin section, e.g.
Usermanagement,Basic Authentication and website Settings....
The idea is to have a admin section which is easy maintainable, but
also extendable to fit the needs of different projects...

Do I run into problems creating this as plugin?
Could it be possible involve other plugins in my admin plugin?
Can I use the plugin layout in other plugins?


One point could be the navigation menu. But if I store the menu array
in the session i could easily extend the menu in other plugins...

An example:
I have my admin plugin ready, with basic stuff. In one project i need
a newsletter module/plugin, which should be triggered by the admin
section... The specific newsletter models, controller and views are
handled by the newsletter plugin, but uses the layout of the admin
plugin...

Now, if i do adjustments to the basic stuff in the admin plugin, I
simply update the plugin and could be sure, that the newsletter plugin
is working as usual!

I could easily update the admin plugin in several projects, without
touching other areas of the different projects!

Sure, all other plugins need to folllow a kind of conventions the
admin plugin dictates... But that shouldn't a problem at all...

Is this a stupid idea? Anyone of you implented something similiar
before?
I would like to hear your opinions !

Regards,
AxlF

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

Facebook app pagination problem

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

Facebook app pagination problem

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+unsubscribe@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

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 <mileswjohn...@gmail.com> 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 <ell...@gmail.com> 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"
>
> > <php...@gmail.com> 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 <peterchenad...@gmail.com>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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@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+unsubscribe@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

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 <ell...@gmail.com> 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"
>
> <php...@gmail.com> 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 <peterchenad...@gmail.com>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.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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: how to switch between app controller etc for test suite

sry
not beforeFilter() of course
those things for every page are in the beforeRender() method of the
app controller


On 30 Jan., 21:01, euromark <dereurom...@googlemail.com> wrote:
> testing components, helpers, models etc is working just fine
> but behaviors are a huge pain in the rear
>
> they seem to trigger the whole app + default layout
>
> if i use the app as it is for productive mode it dies with the
> following error
> "Fatal error: Call to a member function find() on a non-object in ...
> \app\app_controller.php on line 227"
>
> even if i try to disable all the beforeFilter() stuff like
> "WhoIsOnline" or "NewestEvents"
> it still dies: "table test_countries to Model Country is missing
> but there is nothing triggered using the country model
>
> is there a way to switch to a "basic" app controller + test layout for
> testing? (the default layout of course needs some beforeFilter stuff
> from the current app controller)
> a version that does not invoke all those unnessarry models for just
> testing a simple and easy behavior?
>
> thx so much

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

how to switch between app controller etc for test suite

testing components, helpers, models etc is working just fine
but behaviors are a huge pain in the rear

they seem to trigger the whole app + default layout

if i use the app as it is for productive mode it dies with the
following error
"Fatal error: Call to a member function find() on a non-object in ...
\app\app_controller.php on line 227"

even if i try to disable all the beforeFilter() stuff like
"WhoIsOnline" or "NewestEvents"
it still dies: "table test_countries to Model Country is missing
but there is nothing triggered using the country model

is there a way to switch to a "basic" app controller + test layout for
testing? (the default layout of course needs some beforeFilter stuff
from the current app controller)
a version that does not invoke all those unnessarry models for just
testing a simple and easy behavior?

thx so much

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

another CakePHP wordpress blog

http://harake.wordpress.com/

So, please never hesitate to criticize or like the articles

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

how to save data from a model and all related models to a new table on 'completion'?

I am building a 'work_order' table that I need to convert to an
invoice once it's been flagged as 'completed'. I need to save all the
related models' information also when converting so that I can go back
and look at an invoice and see all the related data too, even if the
original related data to the 'work_order' table has been changed or
deleted.

I'll use the standard blog schema to make it easy. I have a Post model
that hasMany Comments, HABTM Tags, and belongsTo User. In the Post
table there is a boolean column for 'published'. When the Post is
flagged as 'published' I'd like to copy over the data from the Post
into a new table for archiving purposes but I also need to copy the
Users, Comments and Tags data that are related to that Post to their
respective 'archived' tables so that if a User gets changed (i.e.
address or phone changes) or deleted from the User table the row of
user information is still in the archived table as it was originally.

Is there an easy or good way to convert the data to a new table for
archives? Going back to the real project tables of using a work_order
and invoice: Once a work_order has been flagged as 'completed' on the
afterSave maybe create an array with all the related data 'belonging'
to Invoice and save it all? If you did it that way how would you save
the Invoice from the WorkOrder model since they're not really related?

Does anyone have a good practice or suggestions on how it should be
done?

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

Js help with Cake 1.3

For some reason I can't get this line of code to work:
$js->get('click1')->event("click", $js->alert("You clicked me!"));

Nothing is returned. I've echoed inside the get function and inside
the event function, and it works fine. But outside the functions, it
says there is no selection, and neither returns anything. Whats going
on?

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

array + sql problem

hi All,

I've got a problem of how statment in array is translated into sql

Below is my function that is supposed to find records od certain day.
field creaded is day+hour dormat yyyy-mm-dd 00:00:00; in variable
$created there's only yyyy-mm-dd. I would like to find all records
that start with $creaded

function indexdate($created = null) {
$this->Audit->created = $created;
$conditions = array('Audit.created START WITH' => $this->Audit-
>created)
// $conditions = array('START WITH'=> array('Audit.created',
$this->Audit->created));
//$this->set('audits', $this->Audit->findAllByCreated(array
('conditions' => $conditions)));
$this->set('audits',$this->Audit->find('all', array('conditions'
=> $conditions)));
// $this->set('audits',$this->Audit->find('threaded',
array('conditions' => $conditions)));
$data=$this->paginate($this->Audit->read());
}

When i use version with
$conditions = array('START WITH'=> array('Audit.created',$this->Audit-
>created));
that i found http://old.nabble.com/findAll-with-OR,-AND,-and-BETWEEN-td15175585.html
i get
WHERE START WITH IN ('Audit.created', '2010-01-16')

when i use
$conditions = array('Audit.created START WITH' => $this->Audit-
>created);
found http://book.cakephp.org/view/808/find-all
i got additional =
WHERE `Audit`.`created START` WITH = '2010-01-16'
if i use , in stead of => i got additional AND, can't use nothing of
course

i'd be grateful for solution or any hint..

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

Re: calling a component in a model

Don't forget, in most cases you want a Behavior (or Datasource) not a
Component (only if the component exists and writes data)

On Jan 29, 3:14 pm, Florian <florian.end...@me.com> wrote:
> Thanks, to all.
>
> Worked with App::Import
>
> On 29 Jan., 08:55, "j0n4s.h4rtm...@googlemail.com"
>
> <j0n4s.h4rtm...@googlemail.com> wrote:
> > While Miles J is right in general, there are exceptions.
>
> > This is how I used Emailcomponent from amodel:http://github.com/ionas/sna/blob/master/www/app/app_model.php#L98
> > (1.2.5)
>
> > I am not sure if an email datasource would be the best approach in
> > general (and thecomponentas well as models could use that) or if
> > there is something missing to the MVC aka. DS/M/B + C+C + V+H
> > architecture, something like "lib" or so...
>
> > King regards
> >  ionas
>
> > On Jan 28, 7:04 pm, Miles J <mileswjohn...@gmail.com> wrote:
>
> > > You should not be using Components from yourModel. If you are, then
> > > your application structure is wrong.
>
> > > There are if cases like the Email and Sessioncomponent.
>
> > > On Jan 28, 9:19 am, bujanga <buja...@gmail.com> wrote:
>
> > > > I have found 2 MVC use cases for this approach. One is to send email
> > > > from amodeland the other is to send email from a shell task. Here is
> > > > how I go about it:
>
> > > > //      IMPORT AND INITIALIZE EMAILCOMPONENT
> > > > App::import('Core', 'Controller');
> > > > App::import('Component', 'Email');
> > > > $this->Controller =& new Controller();
> > > > $this->Email =& new EmailComponent(null);
> > > > $this->Email->initialize($this->Controller);
>
> > > > $data = $this->Model->find();
> > > > $this->Controller->set('data', $data);
>
> > > > On Thu, Jan 28, 2010 at 8:33 AM, euromark <dereurom...@googlemail.com> wrote:
> > > > > you cant automatically use them
>
> > > > > manual inclusion:
>
> > > > > App::import('Component', 'My');
> > > > > $this->My = new MyComponent();
> > > > > ...
>
> > > > > On 28 Jan., 11:54, Florian <florian.end...@me.com> wrote:
> > > > >> Hi @ all,
>
> > > > >> my Problem is that i can not call acomponentfrom amodel.
>
> > > > >> Source -Model:
>
> > > > >> class Approval extends AppModel{
> > > > >>       $components = array('CheckKont');
>
> > > > >> .
> > > > >> .
> > > > >> .
> > > > >> .
>
> > > > >>       function beforeSave(){
> > > > >>              $this->CheckKont->execute ();
> > > > >>       }
>
> > > > >> }
>
> > > > >> Source -Component:
>
> > > > >> class CheckKont extends Object(){
> > > > >>      execute(){
> > > > >>           return true;
> > > > >>      }
>
> > > > >> }
>
> > > > >> Over the Controller i can call thecomponent, also included with
> > > > >> $components = array()
>
> > > > >> Has anybody a hint how do call thecomponentin amodel?
>
> > > > >> Thanks
> > > > >> Florian
>
> > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelpotherswith 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+unsubscribe@googlegroups.com For more options, visit this group athttp://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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Pretty URLs don't work without .htaccess ?

On Wednesday, January 27, 2010, Miles J <mileswjohnson@gmail.com> wrote:
> Yes .htaccess is required because its uses mod_rewrite. If you didn't
> your URLs would be like so:
>
> index.php?url=/items/view/
>
> On Jan 27, 1:18 pm, Johnny Cupcake <sparklew...@hotmail.com> wrote:
>> This issue was last discussed here in 2006, as far as I can tell.  I'd
>> like to know if anything has changed since then.
>>
>> Are pretty URLs available without using .htaccess?  For example, with
>> my Apache document root set to my app's webroot dir, a controller
>> "items" and an action "view", and scaffolding on, I would expect
>> something to be available athttp://myserver.com/items/view.  But it
>> is not; the result is a 404 error message.
>>
>> IOW, the example given in the book (http://book.cakephp.org/view/105/
>> Scaffolding) doesn't work.
>>
>> It DOES work if I tryhttp://myserver.com/index.php/items/view
>> instead, but that isn't a very pretty URL.  So I wonder, is there
>> anything I can do short of turning on .htaccess, to make the clean/
>> pretty URLs available?  Using Cake v1.2.5, that is.  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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
>

--
Stefano Salvatori M.
http://stefano.salvatori.cl/

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

Re: Bypassing validation

Thanks John,

It does strike me as a little odd that "'required' => true" is at the
individual rule(s) specific level, and not the field specific level...
as in:

var $validate = array(
'username' => array(
'required' => true, <-- SHOULD BE HERE
'notEmpty' => array(
'rule' => 'notEmpty',
'message' => 'Your username is required.',
),
...
),

Rather than:

var $validate = array(
'username' => array(
'notEmpty' => array(
'rule' => 'notEmpty',
'message' => 'Your username is required.',
'required' => true, <!-- NOT HERE
),
'alphaNumeric' => array(
'rule' => 'alphaNumeric',
'message' => 'Your username can only use letters and numbers.',
'required' => true, <!-- AND NOT HERE, etc, etc
),
...
),

As in, that 'required' will technically need to be set on every rule
(which is not the default) so that you can get the "safe" setting.

Shouldn't it be the case that frameworks (or at least my
interpretation of them), should be safe by default, and you need to
explicitly tell them to disable security features in order to open
them up.

But then again... on the $this->Model->save() method... you can (and
should) pass in a "fieldList"... which is good for stopping hackers/
crackers adding additional fields (e.g. an "is_admin" field on a
generic user registration form), but that is just to limit the fields,
it doesn't seem to say "these are all the fields which will be
supplied, and if that field does not exist in the $data array, try to
validate it as an empty string".

Craig

On Jan 30, 8:03 am, John Andersen <j.andersen...@gmail.com> wrote:
> You did correctly, added the required => true attribute.
> Only when you want to update the other fields, as you state, then you
> should turn off the rules for username and password by:
>
> [code]
> unset($this->User->validate['username']);
> unset($this->User->validate['password']);
> rest of code, where you do your update.
> [/code]
>
> The above turns off the two validation rules for username and password
> so that you can save/update the other fields.
>
> Enjoy,
>    John
>
> On Jan 29, 7:27 pm, Craig Francis <craig.fran...@gmail.com> wrote:
>
> > (Note: This is my first time using CakePHP).
>
> > I have a fairly simple user model, with validation along the lines of:
>
> >         var $validate = array(
> >                 'username' => array(
> >                                 'notEmpty' => array(
> >                                                 'rule' => 'notEmpty',
> >                                                 'message' => 'Your username is required.',
> >                                         ),
> >                                 'alphaNumeric' => array(
> >                                                 'rule' => 'alphaNumeric',
> >                                                 'message' => 'Your username can only use letters and numbers.',
> >                                         ),
> >                                 'between' => array(
> >                                                 'rule' => array('between', 5, 15),
> >                                                 'message' => 'Your username can only be between 5 to 15
> > characters.',
> >                                         ),
> >                                 'isUnique' => array(
> >                                                 'rule' => 'isUnique',
> >                                                 'message' => 'Your username is already in use.',
> >                                         ),
> >                         ),
> >                 'password' => array(
> >                                 'minLength' => array(
> >                                                 'rule' => array('minLength', 4),
> >                                                 'message' => 'Your password must be at least 4 characters
> > long.',
> >                                         ),
> >                         ),
> >                 'repeat_password' => array(
> >                                 'repeat' => array(
> >                                                 'rule' => array('checkRepeatPassword'),
> >                                                 'message' => 'Your repeated password is not the same.',
> >                                         ),
> >                         ),
> >                 'name_first' => array('notempty'),
> >                 'name_last' => array('notempty'),
> >         );
>
> > And I have then been playing with the DOM inspector in my browser,
> > where I removed the password field (or changed the name attribute).
>
> > When I submitted the registration form (username, password,
> > repeat_password fields), only with the username value supplied... the
> > user account was created, bypassing the password validation and
> > leaving the password blank (should be more then 4 characters)...
> > admittedly this did cause a couple of undefined variables in the
> > checkRepeatPassword function, but didn't stop anything.
>
> > Anyway, I've been wondering how I can avoid this happening, where
> > someone editing the DOM could bypass the field validation.
>
> > I did try adding the "required" attribute via:
>
> >         var $validate = array(
> >                 'username' => array(
> >                                 'notEmpty' => array(
> >                                                 'rule' => 'notEmpty',
> >                                                 'message' => 'Your username is required.',
> >                                                 'required' => true,
> >                                         ),
> >         ...
> >                 'password' => array(
> >                                 'minLength' => array(
> >                                                 'rule' => array('minLength', 4),
> >                                                 'message' => 'Your password must be at least 4 characters
> > long.',
> >                                                 'required' => true,
> >                                         ),
> >                         ),
> >         ...
>
> > Which seems to imply that the validation rules must be run (what I
> > want)... but then on the page where the user is able to change their
> > first/last name, the validation complains when the username and
> > password fields are not present (username should not be editable).
>
> > Craig

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

Re: Error after adding database.php file to project (happening on Windows and Ubuntu)

First of all: Thank you guys for the responses! I really appreciate! :)

The problem is now fixed (on Windows)!

The problem was I installed PHP using a windows installer and when asked to install the extensions I never installed them. So, in order to PHP connect to MySQL it needs the mysql extension. 

I was able to find this out when, without using cake, I was trying to make PHP connect to mysql. When trying that, there was no errors, just a blank screen, but I knew it was not able to connect. So, after installing the php-mysql extension, I was able to connect and cake was able to access the database.

I was really a stupid mistake but I believed it was a CakePHP problem because of that page that, when not able to connect o mysql, was loosing all it styles.

And I'm sorry for the delay on writing this reply to you guys. I really appreciate the help! :)

Unfortunatelly I'm not able to make this work on Linux (Ubuntu). I have the mysql extension installed but PHP is not able to connect to the database. But this is not a CakePHP problem. I'm going to search a little more about this problem.

Thanks again! I really appreciate all the help! :)



On Fri, Jan 22, 2010 at 5:59 AM, Fran Iglesias <cakephpilia@gmail.com> wrote:
Hi

El 21/01/2010, a las 23:44, Lucas Loss escribió:


4. Then I've renamed the file database.php.default to database.php;
5. Back to the browser I reloaded the page and noticed a new sentence:

I miss a step between these. Have you configured your database connection in database.php? And, by the way, is a database server up and running?


see a print of the page on http://yfrog.com/jp125afterdatabasep;

Have you read the error message in the top? It looks that you need to set the right permissions in the tmp folder so Apache can write.

Please, read the manual on installation, I think the answers are all 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+unsubscribe@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+unsubscribe@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

That URL no longer works, I believe it's located here now:
http://cakephp.lighthouseapp.com/projects/42648/13-new-features-plugin-assets

Awesome news nontheless! Can't wait for a stable 1.3 release!

On Dec 3 2009, 4:12 pm, "Larry E. Masters aka PhpNut"
<php...@gmail.com> 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 <peterchenad...@gmail.com>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.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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en