Re: views without controllers or models??

2008-01-25 Thread AD7six



On Jan 25, 1:22 am, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 Basically, I want to use a pre-existing CakePHP user Authentication
 system as a quick and easy wrapper for a pre-existing website (content
 of website completely independent of CakePHP and its database, it just
 grants access). Is there a way I can create a path somewhere in my app
 directory that only uses the app_controller.php and not it's own
 controller?

 Thanks,
 Dave

What you ask isn't very clear but look at the pages controller.

hth,

AD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: views without controllers or models??

2008-01-25 Thread CodeKing

What I would do would be rework the routing so all requests go to a
controller no matter what path, and have the path be passed to an
argument for the action function.  Then in the view have it use
include to get a page from the existing site.  Something like this:

controller:

function index($url) {
   $this-set('url',$url);
}

view:

include($url);

Why don't you use normal PHP authentication system?  I'm sure there
are plenty.

On Jan 24, 6:22 pm, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 Basically, I want to use a pre-existing CakePHP user Authentication
 system as a quick and easy wrapper for a pre-existing website (content
 of website completely independent of CakePHP and its database, it just
 grants access). Is there a way I can create a path somewhere in my app
 directory that only uses the app_controller.php and not it's own
 controller?

 Thanks,
 Dave

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: views without controllers or models??

2008-01-25 Thread [EMAIL PROTECTED]



On Jan 24, 6:41 pm, CodeKing [EMAIL PROTECTED] wrote:
 What I would do would be rework the routing so all requests go to a
 controller no matter what path, and have the path be passed to an
 argument for the action function.  Then in the view have it use
 include to get a page from the existing site.  Something like this:

Great idea! I can just have my .htaccess file route to cake and pass
the URL then once authentication is confirmed just include the
original path. This way, the website can be anywhere on the server.

 Why don't you use normal PHP authentication system?  I'm sure there
 are plenty.

The only reason I want to use my cake authentication system is that
I'm already familiar with it and it should be very easy to setup and
get running. Also, I know that cake handles security issues well with
it's sanitize function and I'd have to do some research with other
systmes. Thanks for the tip.

Dave
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



views without controllers or models??

2008-01-24 Thread [EMAIL PROTECTED]

Basically, I want to use a pre-existing CakePHP user Authentication
system as a quick and easy wrapper for a pre-existing website (content
of website completely independent of CakePHP and its database, it just
grants access). Is there a way I can create a path somewhere in my app
directory that only uses the app_controller.php and not it's own
controller?

Thanks,
Dave
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: views without controllers

2007-12-11 Thread abba bryant


Or even better.. copy the page_controller from the cake core to your
controllers folder and *gasp* give a $uses array..

Then you dont have those pesky dispatcher calls. If your application doesn't
have a great need for requestAction then you should avoid it. I even write
my elements / requestAction combos now so that they check to see if the data
the need exists in some form in the view - and fascist cacheing - before I
make the requestAction calls - they really add up in terms of framework
overhead )


djiize wrote:
 
 
 default page (see routes.php) is /app/views/home.ctp
 you can cusomize this page like you want, and import data from DB in
 it with elements/requestAction:
 http://bakery.cakephp.org/articles/view/creating-reusable-elements-with-requestaction
 
 On 10 d�c, 17:17, Mike Green [EMAIL PROTECTED] wrote:
 A view without a controller.. is just a php page. you could achieve
 the same effect by other means but it would be pointless.

 On 10/12/2007, Chris Hartjes [EMAIL PROTECTED] wrote:





  On Dec 10, 2007 10:34 AM, boris [EMAIL PROTECTED] wrote:

   Is this possible in CakePHP or am I constrained to associate every
   view with a database table, model, and controller?

  Well, you can certainly create models that don't use databases, and
  controllers that don't need a model, but given the very nature of MVC
  I think you could not create a view without a controller...

  --
  Chris Hartjes

  My motto for 2007:  Just build it, damnit!

  @TheKeyboard -http://www.littlehart.net/atthekeyboard

 --
 
 Mike Green

 Find yourself some misspelled ebay bargains!http://www.typingwand.com
  
 
 

-- 
View this message in context: 
http://www.nabble.com/views-without-controllers-tp14255261p14289781.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



views without controllers

2007-12-10 Thread boris

Hi. I am new to CakePHP and would be thankful for help:

I'm creating a social networking website. Suppose I want to create a
profile page, which displays a user's data. The view would be app/
views/users/profile.php and there would be a controller app/
controllers/users_controller.php with a profile() function (i.e.
action).

What if I want to create a homepage? I don't want this homepage to be
under app/views/users and have a corresponding homepage() function is
app/controllers/users_controller.php. I want the homepage to have
access to data from the 'users' table (e.g. to display a random user's
information), but don't believe it should be associated in the CakePHP
structure to the 'users' table. A homepage is a more general sort of
page.

Is this possible in CakePHP or am I constrained to associate every
view with a database table, model, and controller?

Thank you. Any help is much appreciated.

~ Boris

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: views without controllers

2007-12-10 Thread Chris Hartjes

On Dec 10, 2007 10:34 AM, boris [EMAIL PROTECTED] wrote:

 Is this possible in CakePHP or am I constrained to associate every
 view with a database table, model, and controller?


Well, you can certainly create models that don't use databases, and
controllers that don't need a model, but given the very nature of MVC
I think you could not create a view without a controller...


-- 
Chris Hartjes

My motto for 2007:  Just build it, damnit!

@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: views without controllers

2007-12-10 Thread Mike Green

A view without a controller.. is just a php page. you could achieve
the same effect by other means but it would be pointless.

On 10/12/2007, Chris Hartjes [EMAIL PROTECTED] wrote:

 On Dec 10, 2007 10:34 AM, boris [EMAIL PROTECTED] wrote:
 
  Is this possible in CakePHP or am I constrained to associate every
  view with a database table, model, and controller?
 

 Well, you can certainly create models that don't use databases, and
 controllers that don't need a model, but given the very nature of MVC
 I think you could not create a view without a controller...


 --
 Chris Hartjes

 My motto for 2007:  Just build it, damnit!

 @TheKeyboard - http://www.littlehart.net/atthekeyboard

 



-- 

Mike Green

Find yourself some misspelled ebay bargains!
http://www.typingwand.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: views without controllers

2007-12-10 Thread djiize

default page (see routes.php) is /app/views/home.ctp
you can cusomize this page like you want, and import data from DB in
it with elements/requestAction:
http://bakery.cakephp.org/articles/view/creating-reusable-elements-with-requestaction

On 10 déc, 17:17, Mike Green [EMAIL PROTECTED] wrote:
 A view without a controller.. is just a php page. you could achieve
 the same effect by other means but it would be pointless.

 On 10/12/2007, Chris Hartjes [EMAIL PROTECTED] wrote:





  On Dec 10, 2007 10:34 AM, boris [EMAIL PROTECTED] wrote:

   Is this possible in CakePHP or am I constrained to associate every
   view with a database table, model, and controller?

  Well, you can certainly create models that don't use databases, and
  controllers that don't need a model, but given the very nature of MVC
  I think you could not create a view without a controller...

  --
  Chris Hartjes

  My motto for 2007:  Just build it, damnit!

  @TheKeyboard -http://www.littlehart.net/atthekeyboard

 --
 
 Mike Green

 Find yourself some misspelled ebay bargains!http://www.typingwand.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: views without controllers

2007-12-10 Thread AD7six



On Dec 10, 4:34 pm, boris [EMAIL PROTECTED] wrote:
 Hi. I am new to CakePHP and would be thankful for help:

 I'm creating a social networking website. Suppose I want to create a
 profile page, which displays a user's data. The view would be app/
 views/users/profile.php and there would be a controller app/
 controllers/users_controller.php with a profile() function (i.e.
 action).

 What if I want to create a homepage? I don't want this homepage to be
 under app/views/users and have a corresponding homepage() function is
 app/controllers/users_controller.php. I want the homepage to have
 access to data from the 'users' table (e.g. to display a random user's
 information),

A view receives it's data from a controller, a controller gets
information from models.

Where you put the controller and action for your homepage is up to you
- above you have described a controller action which requires access
to your User model, that doesn't mean the action must go in the Users
controller. Create a new one named WhateverController with a $uses =
array('User') and route / to WhateverController and whatever function
if you prefer - makes no difference to cake of course.

hth,

AD
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---