Re: Fat Models vs. App Controller

2011-02-26 Thread Sam Sherlock
I have just finished moving some a controller method to a model just now (if
the same logic had to be used by multiple models then I would have made a
helper)

my app manges a list of jobs held in a db (an external system puts them in -
another reason why behaviours would not work in my case; my system just
monitors what the system logs)

so I had a controller method checking the params of a job for validity  if
files exist and stuff; is such a record first in set
having the model check validty meant less code overall and great ablity to
reuse it

so now my index view of jobs shows faily detailed overiew of the job params
- with error feedback for user

I baked this app in about 8 minutes and tweaked afterwards- very rapid
development; near complete

 - S




On 27 February 2011 01:30, Eric Anderson  wrote:

> Awesome article. Thanks!
>
> I think I'm going to move everything over to my model, via either an
> available function I can then call from other controllers or place the
> function in beforeSave, afterSave, etc. Should work great.
>
> Eric
>
> On Feb 26, 5:59 pm, Sam Sherlock  wrote:
> > to me it sounds list behaviours
> >
> > all controllers extend the app controller - choose carefully what you put
> > here
> >
> > if the stuff is entity related it goes in model
> >
> > you can add to app model (& helper & error also) in the same way as you
> can
> > with app controller
> >
> > fat models, skinny controllers and athletic behaviourshttp://
> nuts-and-bolts-of-cakephp.com/tag/observable-behavior/
> >  - S
> >
> > On 26 February 2011 23:46, Eric Anderson 
> wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Ya a component doesn't necessarily work because I'm interfacing with
> > > the DB (inserting, deleting, querying) a lot. I'm thinking from
> > > articles I've been digging up (Mark Story's personal site) that
> > > putting these functions in my Activity controller makes the most
> > > sense, then I can just grab feeds, save data, etc by calling the
> > > function through related models.
> >
> > > As for "libs", what do you mean? I can create a library for these
> > > functions? Can you explain further?
> >
> > > Thanks!
> >
> > > Eric
> >
> > > On Feb 26, 4:39 pm, euromark  wrote:
> > > > usually you would put functions you use in multiple controllers in
> > > > either the model (data?) or a component (logic?)
> > > > you can also use libs to "dry" your code :)
> >
> > > > On 27 Feb., 00:02, Eric Anderson  wrote:
> >
> > > > > Hi everyone,
> >
> > > > > Just wondering when it comes to performance and any other factors
> you
> > > > > may deem important, what's the better option for storing functions
> > > > > that I will use among many controllers: A function in the model
> that I
> > > > > can then access via $this->Model->Model->function() or a function
> > > > > inside of my App Controller?
> >
> > > > > Moreover, when is it better to put a function in a model and when
> is
> > > > > it better to put it in the app controller?
> >
> > > > > To put this in context, I'm investigating this for use with an
> > > > > activities feature. I track activities and then display them in
> feeds.
> > > > > Of course, I need to quite often save an activity, feeding it
> > > > > arguments (as well as delete an activity). Moreover, I need to
> often
> > > > > grab a feed, customized based on the arguments I feed it. I'm
> trying
> > > > > to avoid using RequestAction.
> >
> > > > > Thanks!
> >
> > > > > Eric
> >
> > > --
> > > Our newest site for the community: CakePHP Video Tutorials
> > >http://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > > others with their CakePHP related questions.
> >
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this
> group
> > > athttp://groups.google.com/group/cake-php
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


RE: pages_controller

2011-02-26 Thread Krissy Masters
Not sure what you're getting at? 

The view is the "guts" of the page. View gets dropped into the layout. Index
page has a fat header with 400px high. Im not going to code that into every
view div header this view and internal pages do not have a fat header so why
put that inside the view every time? Imagine changing the image in every
page or just 1 layout header?

2 layouts left_default or right_default by saying this->layout which ever I
want I can change the page look do not have to go into each view and re-code
the cols

Example layout


Element('block_header',
array('cache' => forever)); ?>
Element('crumb_block',
array('cache' => forever)); ?>

Sidebar->getSidebar(); ?>
 <= my side gets dropped in here
 
<= my view html gets dropped in here


Element('block_footer', array('cache' =>
if I feel like it)); ?>




Ok changed my mind 


Element('block_header',
array('cache' => forever)); ?>
Element('crumb_block',
array('cache' => forever)); ?>

 
<= my view html gets dropped in here 
Sidebar->getSidebar(); ?>
 <= my side gets dropped in here



Element('block_footer', array('cache' =>
if I feel like it)); ?>


All I had to do was $this->layout = default_left to default_right, never
touched the view could not be easier than that.




If I want to use a different layout use left_side or right side I can just
use either layout. Your not saying code each view with left_col right_side
inside the view? So if you want to change from left to right or see what it
looks like you have to recode the view

I guess your layouts are just empty? 
Your view files, you hardcode code the  layout cols inside every view?
all left data, navigation
all your code

Anyways thanks for just answering a question with a question :)

-Original Message-
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Ryan Schmidt
Sent: Saturday, February 26, 2011 8:39 PM
To: cake-php@googlegroups.com
Subject: Re: pages_controller

On Feb 26, 2011, at 15:58, Krissy Masters wrote:

> the pages controller.
> 
> I understand the basic idea of rendering static pages display => some_page
> but how can you define different layouts for each rendered static page?
> 
> All I can guess is pages_controller:
> 
> function index (){
> $this->layout = 'default_index';
> }
>
> function about() {
> $this->layout = 'default_internal';
> }
> 
> And just skip the display function.  link directly to the action
controller
> = > pages , action => index
> Am I wrong?

Why do your static pages have different layouts? I would have expected your
static pages (and your dynamic pages too, for that matter) to use the same
global layout, and only need a separate view file.

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


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

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


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


Re: Fat Models vs. App Controller

2011-02-26 Thread Eric Anderson
Awesome article. Thanks!

I think I'm going to move everything over to my model, via either an
available function I can then call from other controllers or place the
function in beforeSave, afterSave, etc. Should work great.

Eric

On Feb 26, 5:59 pm, Sam Sherlock  wrote:
> to me it sounds list behaviours
>
> all controllers extend the app controller - choose carefully what you put
> here
>
> if the stuff is entity related it goes in model
>
> you can add to app model (& helper & error also) in the same way as you can
> with app controller
>
> fat models, skinny controllers and athletic 
> behaviourshttp://nuts-and-bolts-of-cakephp.com/tag/observable-behavior/
>  - S
>
> On 26 February 2011 23:46, Eric Anderson  wrote:
>
>
>
>
>
>
>
> > Ya a component doesn't necessarily work because I'm interfacing with
> > the DB (inserting, deleting, querying) a lot. I'm thinking from
> > articles I've been digging up (Mark Story's personal site) that
> > putting these functions in my Activity controller makes the most
> > sense, then I can just grab feeds, save data, etc by calling the
> > function through related models.
>
> > As for "libs", what do you mean? I can create a library for these
> > functions? Can you explain further?
>
> > Thanks!
>
> > Eric
>
> > On Feb 26, 4:39 pm, euromark  wrote:
> > > usually you would put functions you use in multiple controllers in
> > > either the model (data?) or a component (logic?)
> > > you can also use libs to "dry" your code :)
>
> > > On 27 Feb., 00:02, Eric Anderson  wrote:
>
> > > > Hi everyone,
>
> > > > Just wondering when it comes to performance and any other factors you
> > > > may deem important, what's the better option for storing functions
> > > > that I will use among many controllers: A function in the model that I
> > > > can then access via $this->Model->Model->function() or a function
> > > > inside of my App Controller?
>
> > > > Moreover, when is it better to put a function in a model and when is
> > > > it better to put it in the app controller?
>
> > > > To put this in context, I'm investigating this for use with an
> > > > activities feature. I track activities and then display them in feeds.
> > > > Of course, I need to quite often save an activity, feeding it
> > > > arguments (as well as delete an activity). Moreover, I need to often
> > > > grab a feed, customized based on the arguments I feed it. I'm trying
> > > > to avoid using RequestAction.
>
> > > > Thanks!
>
> > > > Eric
>
> > --
> > Our newest site for the community: CakePHP Video Tutorials
> >http://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group
> > athttp://groups.google.com/group/cake-php

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


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


Re: Fat Models vs. App Controller

2011-02-26 Thread Sam Sherlock
to me it sounds list behaviours

all controllers extend the app controller - choose carefully what you put
here

if the stuff is entity related it goes in model

you can add to app model (& helper & error also) in the same way as you can
with app controller

fat models, skinny controllers and athletic behaviours
http://nuts-and-bolts-of-cakephp.com/tag/observable-behavior/
 - S




On 26 February 2011 23:46, Eric Anderson  wrote:

> Ya a component doesn't necessarily work because I'm interfacing with
> the DB (inserting, deleting, querying) a lot. I'm thinking from
> articles I've been digging up (Mark Story's personal site) that
> putting these functions in my Activity controller makes the most
> sense, then I can just grab feeds, save data, etc by calling the
> function through related models.
>
> As for "libs", what do you mean? I can create a library for these
> functions? Can you explain further?
>
> Thanks!
>
> Eric
>
> On Feb 26, 4:39 pm, euromark  wrote:
> > usually you would put functions you use in multiple controllers in
> > either the model (data?) or a component (logic?)
> > you can also use libs to "dry" your code :)
> >
> > On 27 Feb., 00:02, Eric Anderson  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Hi everyone,
> >
> > > Just wondering when it comes to performance and any other factors you
> > > may deem important, what's the better option for storing functions
> > > that I will use among many controllers: A function in the model that I
> > > can then access via $this->Model->Model->function() or a function
> > > inside of my App Controller?
> >
> > > Moreover, when is it better to put a function in a model and when is
> > > it better to put it in the app controller?
> >
> > > To put this in context, I'm investigating this for use with an
> > > activities feature. I track activities and then display them in feeds.
> > > Of course, I need to quite often save an activity, feeding it
> > > arguments (as well as delete an activity). Moreover, I need to often
> > > grab a feed, customized based on the arguments I feed it. I'm trying
> > > to avoid using RequestAction.
> >
> > > Thanks!
> >
> > > Eric
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: pages_controller

2011-02-26 Thread Ryan Schmidt
On Feb 26, 2011, at 15:58, Krissy Masters wrote:

> the pages controller.
> 
> I understand the basic idea of rendering static pages display => some_page
> but how can you define different layouts for each rendered static page?
> 
> All I can guess is pages_controller:
> 
> function index (){
> $this->layout = 'default_index';
> }
>
> function about() {
> $this->layout = 'default_internal';
> }
> 
> And just skip the display function.  link directly to the action controller
> = > pages , action => index
> Am I wrong?

Why do your static pages have different layouts? I would have expected your 
static pages (and your dynamic pages too, for that matter) to use the same 
global layout, and only need a separate view file.

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


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


Re: Fat Models vs. App Controller

2011-02-26 Thread Eric Anderson
Ya a component doesn't necessarily work because I'm interfacing with
the DB (inserting, deleting, querying) a lot. I'm thinking from
articles I've been digging up (Mark Story's personal site) that
putting these functions in my Activity controller makes the most
sense, then I can just grab feeds, save data, etc by calling the
function through related models.

As for "libs", what do you mean? I can create a library for these
functions? Can you explain further?

Thanks!

Eric

On Feb 26, 4:39 pm, euromark  wrote:
> usually you would put functions you use in multiple controllers in
> either the model (data?) or a component (logic?)
> you can also use libs to "dry" your code :)
>
> On 27 Feb., 00:02, Eric Anderson  wrote:
>
>
>
>
>
>
>
> > Hi everyone,
>
> > Just wondering when it comes to performance and any other factors you
> > may deem important, what's the better option for storing functions
> > that I will use among many controllers: A function in the model that I
> > can then access via $this->Model->Model->function() or a function
> > inside of my App Controller?
>
> > Moreover, when is it better to put a function in a model and when is
> > it better to put it in the app controller?
>
> > To put this in context, I'm investigating this for use with an
> > activities feature. I track activities and then display them in feeds.
> > Of course, I need to quite often save an activity, feeding it
> > arguments (as well as delete an activity). Moreover, I need to often
> > grab a feed, customized based on the arguments I feed it. I'm trying
> > to avoid using RequestAction.
>
> > Thanks!
>
> > Eric

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


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


Re: Fat Models vs. App Controller

2011-02-26 Thread euromark
usually you would put functions you use in multiple controllers in
either the model (data?) or a component (logic?)
you can also use libs to "dry" your code :)


On 27 Feb., 00:02, Eric Anderson  wrote:
> Hi everyone,
>
> Just wondering when it comes to performance and any other factors you
> may deem important, what's the better option for storing functions
> that I will use among many controllers: A function in the model that I
> can then access via $this->Model->Model->function() or a function
> inside of my App Controller?
>
> Moreover, when is it better to put a function in a model and when is
> it better to put it in the app controller?
>
> To put this in context, I'm investigating this for use with an
> activities feature. I track activities and then display them in feeds.
> Of course, I need to quite often save an activity, feeding it
> arguments (as well as delete an activity). Moreover, I need to often
> grab a feed, customized based on the arguments I feed it. I'm trying
> to avoid using RequestAction.
>
> Thanks!
>
> Eric

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


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


Fat Models vs. App Controller

2011-02-26 Thread Eric Anderson
Hi everyone,

Just wondering when it comes to performance and any other factors you
may deem important, what's the better option for storing functions
that I will use among many controllers: A function in the model that I
can then access via $this->Model->Model->function() or a function
inside of my App Controller?

Moreover, when is it better to put a function in a model and when is
it better to put it in the app controller?

To put this in context, I'm investigating this for use with an
activities feature. I track activities and then display them in feeds.
Of course, I need to quite often save an activity, feeding it
arguments (as well as delete an activity). Moreover, I need to often
grab a feed, customized based on the arguments I feed it. I'm trying
to avoid using RequestAction.

Thanks!

Eric

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


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


pages_controller

2011-02-26 Thread Krissy Masters
Maybe because I never used it in my journey with Cake so far, but the pages
controller.

I understand the basic idea of rendering static pages display => some_page
but how can you define different layouts for each rendered static page?

All I can guess is pages_controller:

function index (){
$this->layout = 'default_index';
}
 
function about() {
$this->layout = 'default_internal';
}

And just skip the display function.  link directly to the action controller
= > pages , action => index
Am I wrong?

Thanks,

K

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


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


Re: Admin Route or Admin Password

2011-02-26 Thread Sam Sherlock
also see the book.cakephp.org
http://book.cakephp.org/view/1254/Change-Hash-Function

 - S




On 26 February 2011 19:53, amarradi  wrote:

> i added an password from login into the mysql db and now i'm ready for
> login
>
> But where i set the hashing algorithm i dont know
>
> On 26 Feb., 20:37, acl68  wrote:
> > Hi Marcus,
> >
> > I tried a lot, too , until it finally worked, it is not really simple.
> Which
> > kind of password hashing do you use?
> > Try to  debug output the password from the db and the hashed password you
> give
> > at the login form.
> >
> > Anja
> >
> > Am Samstag, 26. Februar 2011, um 20:21:16 schrieb amarradi:
> >
> > > Thanks a lot,
> >
> > > I tryed this video tutorial
> > >http://tv.cakephp.org/video/jasonwydro/2011/01/29/cakephp_1_3_auth_au.
> ..
> > > cation_component_tutorial_-_administrator_login This System runs also
> under
> > > 1.3.7. But the login doesn't work
> >
> > > On 26 Feb., 20:08, acl68  wrote:
> > > > Hi Marcus,
> >
> > > > you have no password automatically set. Cake is a framework an not an
> > > > WCMS. You can code a user authenitication and autheticated users can
> be
> > > > allowed to use the admin methods, but when you start you have no
> values,
> > > > no passwords, no login.
> >
> > > > Have a look
> > > > here:
> http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/
> > > > This is based on cake 1.2 but should work for 1.3, too.
> >
> > > > Hope that helps!
> >
> > > > Anja
> >
> > > > Am Samstag, 26. Februar 2011, um 19:54:38 schrieb amarradi:
> > > > > Hello together,
> >
> > > > > when i add the admin routing to my Application, where did i set the
> > > > > Password for Admin. Or an other Question. Whats the
> standard-Password
> > > > > for Admin?
> >
> > > > > Many greetings
> > > > > Marcus Radisch
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group
> at http://groups.google.com/group/cake-php
>

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


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


Re: Admin Route or Admin Password

2011-02-26 Thread amarradi
i added an password from login into the mysql db and now i'm ready for
login

But where i set the hashing algorithm i dont know

On 26 Feb., 20:37, acl68  wrote:
> Hi Marcus,
>
> I tried a lot, too , until it finally worked, it is not really simple. Which
> kind of password hashing do you use?
> Try to  debug output the password from the db and the hashed password you give
> at the login form.
>
> Anja
>
> Am Samstag, 26. Februar 2011, um 20:21:16 schrieb amarradi:
>
> > Thanks a lot,
>
> > I tryed this video tutorial
> >http://tv.cakephp.org/video/jasonwydro/2011/01/29/cakephp_1_3_auth_au...
> > cation_component_tutorial_-_administrator_login This System runs also under
> > 1.3.7. But the login doesn't work
>
> > On 26 Feb., 20:08, acl68  wrote:
> > > Hi Marcus,
>
> > > you have no password automatically set. Cake is a framework an not an
> > > WCMS. You can code a user authenitication and autheticated users can be
> > > allowed to use the admin methods, but when you start you have no values,
> > > no passwords, no login.
>
> > > Have a look
> > > here:http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/
> > > This is based on cake 1.2 but should work for 1.3, too.
>
> > > Hope that helps!
>
> > > Anja
>
> > > Am Samstag, 26. Februar 2011, um 19:54:38 schrieb amarradi:
> > > > Hello together,
>
> > > > when i add the admin routing to my Application, where did i set the
> > > > Password for Admin. Or an other Question. Whats the standard-Password
> > > > for Admin?
>
> > > > Many greetings
> > > > Marcus Radisch

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


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


Re: Admin Route or Admin Password

2011-02-26 Thread amarradi
Where did i found the hashing algorithm

On 26 Feb., 20:37, acl68  wrote:
> Hi Marcus,
>
> I tried a lot, too , until it finally worked, it is not really simple. Which
> kind of password hashing do you use?
> Try to  debug output the password from the db and the hashed password you give
> at the login form.
>
> Anja
>
> Am Samstag, 26. Februar 2011, um 20:21:16 schrieb amarradi:
>
> > Thanks a lot,
>
> > I tryed this video tutorial
> >http://tv.cakephp.org/video/jasonwydro/2011/01/29/cakephp_1_3_auth_au...
> > cation_component_tutorial_-_administrator_login This System runs also under
> > 1.3.7. But the login doesn't work
>
> > On 26 Feb., 20:08, acl68  wrote:
> > > Hi Marcus,
>
> > > you have no password automatically set. Cake is a framework an not an
> > > WCMS. You can code a user authenitication and autheticated users can be
> > > allowed to use the admin methods, but when you start you have no values,
> > > no passwords, no login.
>
> > > Have a look
> > > here:http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/
> > > This is based on cake 1.2 but should work for 1.3, too.
>
> > > Hope that helps!
>
> > > Anja
>
> > > Am Samstag, 26. Februar 2011, um 19:54:38 schrieb amarradi:
> > > > Hello together,
>
> > > > when i add the admin routing to my Application, where did i set the
> > > > Password for Admin. Or an other Question. Whats the standard-Password
> > > > for Admin?
>
> > > > Many greetings
> > > > Marcus Radisch

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


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


Re: CakePHP form validation before sending post to the requested controller function

2011-02-26 Thread OldWest
I solved the issue by using implode(), but my errors are no longer 
displaying below my form fields. Errors are displaying in the default 
layout... Hmmm.. Anyhow here is my working code:

...else {
  $errors = $this->Plan->invalidFields();
  $error_messages = implode(' ',$errors);
  $this->Session->setFlash($error_messages);
  $this->redirect('/'); ...

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


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


Re: Admin Route or Admin Password

2011-02-26 Thread acl68
Hi Marcus,


I tried a lot, too , until it finally worked, it is not really simple. Which 
kind of password hashing do you use? 
Try to  debug output the password from the db and the hashed password you give 
at the login form.


Anja


Am Samstag, 26. Februar 2011, um 20:21:16 schrieb amarradi:
> Thanks a lot,
> 
> I tryed this video tutorial
> http://tv.cakephp.org/video/jasonwydro/2011/01/29/cakephp_1_3_auth_authenti
> cation_component_tutorial_-_administrator_login This System runs also under
> 1.3.7. But the login doesn't work
> 
> On 26 Feb., 20:08, acl68  wrote:
> > Hi Marcus,
> > 
> > you have no password automatically set. Cake is a framework an not an
> > WCMS. You can code a user authenitication and autheticated users can be
> > allowed to use the admin methods, but when you start you have no values,
> > no passwords, no login.
> > 
> > Have a look
> > here:http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/
> > This is based on cake 1.2 but should work for 1.3, too.
> > 
> > Hope that helps!
> > 
> > Anja
> > 
> > Am Samstag, 26. Februar 2011, um 19:54:38 schrieb amarradi:
> > > Hello together,
> > > 
> > > when i add the admin routing to my Application, where did i set the
> > > Password for Admin. Or an other Question. Whats the standard-Password
> > > for Admin?
> > > 
> > > Many greetings
> > > Marcus Radisch

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


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


Re: CakePHP form validation before sending post to the requested controller function

2011-02-26 Thread OldWest
kdubya,

I've already tried that several times. The error *never* displays *because *of 
the redirect.

I am trying to work it into a session, but no luck yet : (

else {
  //$errors = $this->Plan->invalidFields();
  //$this->Plan->validates();
  $errors = $this->Plan->invalidFields();
  debug($errors);
  //$this->Session->setFlash() = $this->Plan->invalidFields();
  $this->Session->setFlash("this works, but how do I get the errors array 
from my model and \$this->Plan->validates() in here???");
  $this->redirect('/');
} 
}


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


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


Re: Admin Route or Admin Password

2011-02-26 Thread amarradi
Thanks a lot,

I tryed this video tutorial
http://tv.cakephp.org/video/jasonwydro/2011/01/29/cakephp_1_3_auth_authentication_component_tutorial_-_administrator_login
This System runs also under 1.3.7. But the login doesn't work



On 26 Feb., 20:08, acl68  wrote:
> Hi Marcus,
>
> you have no password automatically set. Cake is a framework an not an WCMS.
> You can code a user authenitication and autheticated users can be allowed to
> use the admin methods, but when you start you have no values, no passwords, no
> login.
>
> Have a look 
> here:http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/
> This is based on cake 1.2 but should work for 1.3, too.
>
> Hope that helps!
>
> Anja
>
> Am Samstag, 26. Februar 2011, um 19:54:38 schrieb amarradi:
>
> > Hello together,
>
> > when i add the admin routing to my Application, where did i set the
> > Password for Admin. Or an other Question. Whats the standard-Password
> > for Admin?
>
> > Many greetings
> > Marcus Radisch

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


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


Re: Advanced Form, use Form Helper?

2011-02-26 Thread kdubya
What "extra parameters"?

Post a bit code showing how you use the date picker without CakePHP
and we may be able to suggest how to do it using the $form->input()
method.

Ken

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


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


Re: Admin Route or Admin Password

2011-02-26 Thread acl68
Hi Marcus,

you have no password automatically set. Cake is a framework an not an WCMS. 
You can code a user authenitication and autheticated users can be allowed to 
use the admin methods, but when you start you have no values, no passwords, no 
login.

Have a look here:
http://www.webdevelopment2.com/cakephp-auth-component-tutorial-1/
This is based on cake 1.2 but should work for 1.3, too.

Hope that helps!

Anja


Am Samstag, 26. Februar 2011, um 19:54:38 schrieb amarradi:
> Hello together,
> 
> when i add the admin routing to my Application, where did i set the
> Password for Admin. Or an other Question. Whats the standard-Password
> for Admin?
> 
> Many greetings
> Marcus Radisch

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


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


Re: CakePHP form validation before sending post to the requested controller function

2011-02-26 Thread kdubya
So, in your search() action, call the validates() method as show in
the book here:
http://book.cakephp.org/view/3/The-Manual#!/view/410/Validating-Data-from-the-Controller

Something like:
if ($this->Plan->validates()) {
// continue to show your search results view
} else {
// didn't validate logic
   $this->redirect(SearchFormView); // Send them back to the
search form
}

HTH,
Ken

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


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


Admin Route or Admin Password

2011-02-26 Thread amarradi
Hello together,

when i add the admin routing to my Application, where did i set the
Password for Admin. Or an other Question. Whats the standard-Password
for Admin?

Many greetings
Marcus Radisch

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


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


Re: CakePHP form validation before sending post to the requested controller function

2011-02-26 Thread OldWest
Hi Stephen,

I don't have a *search *controller. My *search()* action is in my *Plan *
controller.

The validation works, but naturally directs to the* plan/search(.ctp)* view 
file which of course displays 0 results, but the validation message appears 
just fine. I just don't want the *search.ctp* file to display prior to the 
form validating - the element (that contains the form) should "stand alone" 
or appear that way until validation happens - then the search page can be 
displayed. This way no matter where I put the form it can validate 
stand-alone and only search when in fact validated.




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


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


Re: Lost in Testing: Fixtures / testAction

2011-02-26 Thread acl68
Hi Ryan,

thank you for your research that helps me at least with the redirect.


What I still don't understand is how the data at 
/tests/fixtures/somemodel_fixture.php relates to the $this->Somemodel->data 
Array im Marks tutorial. When do I use which? Do I use both? 

Thanks for any hints!

Anja


Am Samstag, 26. Februar 2011, um 00:19:31 schrieb Ryan Schmidt:
> On Feb 25, 2011, at 07:06, acl68 wrote:
> > Also: does anybody know what happened to the link in "4.7.6.3 Pitfalls"
> > http://book.cakephp.org/#!/view/1213/Pitfalls in the cookbook? The Link
> > to the mentioned tickets doesn't work. So I am not sure how to proceed,
> > because nearly all my methods use redierts after the did what they
> > should do.
> 
> Your link did not work for me, but I used the search field and typed in
> "pitfalls" and it got me to
> 
> http://book.cakephp.org/view/1213/Pitfalls
> 
> which did work. All it says is:
> 
> "If you use testAction to test a method in a controller that does a
> redirect, your test will terminate immediately, not yielding any results.
> 
> "See https://trac.cakephp.org/ticket/4154 for a possible fix."
> 
> 
> And I see trac.cakephp.org no longer works. I know the team has moved from
> Trac to Lighthouse for issue tracking, and as I understand it, has not
> necessarily copied all old issues from Trac to Lighthouse.
> 
> Here is a cached version of that ticket:
> 
> http://webcache.googleusercontent.com/search?q=cache:hK6fIPD0bqgJ:https://t
> rac.cakephp.org/ticket/4154

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


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


Re: Media plugin - usage questions

2011-02-26 Thread John Andersen
ad 1)
You have to use the path constant MEDIA to identify where the files
are stored and then combine it with the information for the requested
file - directory and filename - adding it all together to get the
filename with path information.
Read the configuration for the Media plugin here:
https://github.com/davidpersson/media/blob/1.3/config/core.php

ad 2)
PUT, is that not about REST then?

Enjoy,
   John

On Feb 25, 8:23 pm, "will.brooke"  wrote:
> Hi All,
> I am trying to use the media plugin (https://github.com/davidpersson/
> media) for a funky API project. I have 2 issues right now.
>
> I can POST susbmit a file and it gets saved. huzzah. (if you care,
> they are CSV files)
>
> what I need is:
>
> 1.) after save completes in the controller, I need the path and
> filename (the actual stored filename on disk) of the just submitted
> file. i need this to pass to a function in the model that calls a
> postgres function that then handles the CSV file.
>
> i assumed i could get this via something  like: $this->Attachment-
>
> >basepath but no such luck.
>
> 2.) I would like to use PUT to submit the file. other than re-routing
> the edit behaviour, i can't wrap my head around how to handle this.
>
> any help greatly appreciated

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


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


Re: Links to previous forum messages

2011-02-26 Thread John Andersen
I am still on the old version, because I don't like the new design. It
does not give me a quick overview of threads that are missing a reply.
The old version does! :) I will stay on the old version as long as I
can.
Enjoy,
   John

On Feb 26, 6:57 am, Jeremy Burns | Class Outfit
 wrote:
> Hi John
>
> I just tried again and it failed. I then saw a note telling me that I am 
> using the new version of Google groups, click here to revert to the old one. 
> I did that and I was able to get to the article. So I guess that I have to 
> stay there, but this will become a wider problem, surely.
>
> Jeremy Burns
> Class Outfit
>
[snip]

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


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


Re: CakePHP form validation before sending post to the requested controller function

2011-02-26 Thread Stephen
Use custom routing to change /plans/search to /search

If that is the reason?

On 26 February 2011 11:15, Stephen  wrote:

> Why do you have a search controller?
>
> Have a search action in the PlansController, as I assume you are searching
> for plans.
>
> You don't need to call the form from the search action, you can call it
> from anywhere and it will validate - if it doesn't validate, redirect to the
> referer?
>
> a Plan is an Object, a Model. A Search isn't an object so it shouldn't have
> its own controller, that's my opinion.
>
> --
> Kind Regards
>  Stephen
>
>  http://www.ninjacodermonkey.co.uk
>
>
>


-- 
Kind Regards
 Stephen

 http://www.ninjacodermonkey.co.uk

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


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


Re: CakePHP form validation before sending post to the requested controller function

2011-02-26 Thread Stephen
Why do you have a search controller?

Have a search action in the PlansController, as I assume you are searching
for plans.

You don't need to call the form from the search action, you can call it from
anywhere and it will validate - if it doesn't validate, redirect to the
referer?

a Plan is an Object, a Model. A Search isn't an object so it shouldn't have
its own controller, that's my opinion.

-- 
Kind Regards
 Stephen

 http://www.ninjacodermonkey.co.uk

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


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