Re: basic website with cake.
MrTufty: Me to. thanks anyway. ;) I have 2 controllers (news, and cases) What should I do if I want to use both news and cases one the same page? Is it correct to create a page (e.g. welcome) in views/pages ? It does not make sense to create a controller for the welcome page as it does not use a table. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: basic website with cake.
You're correct about the welcome, creating a page for that under views/pages would do the job just fine. As for the other part, it depends how you want to deal with it. You can use $this-requestAction('/controller/action'); to pull in data from any other controller you like (you can use this in the controller or the view) - but it depends entirely on what the layout of your page is. For your home page, as an example (and this may not work) - create the file home.thtml under views/pages - this is the default page for your site, unless you've edited the routes. In this file you could use $this-requestAction('/news/latest'); and $this-requestAction('/cases/latest'); to pull in the news or cases you want to display on your home page. That'd work, as long as you made sure you had the action for latest in each of your controllers. That's how I'd do it, there's probably a better way! :) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: basic website with cake.
MrTufty: Interesting. That really cleared up a few things. I am doing my best to learn the correct design technics. Don't want to pick up to many bad habits :) Best regards. Asbjørn Morell. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: basic website with cake.
Hi atmorell, do you mean a CMS (that anybody can use) or you mean you (as a developer) want to be able to manage the content? Assuming the latter I would suggest handling things seperately, and as such the tasks become much smaller [EMAIL PROTECTED] wrote: Text and images should be stored in the database. Does anyone have a clue about how I should approach this? Storing the text in a database, would just mean something that is (in princple) very similar to the blog tutorial. Storing images in the database is quite easy, if you generate the links for your images in the form a href='/MyImageControllerName/Display/ImageID / then if you create an image controller, with a function display, that reads from the db the image with the id ImageID, outputs the correct headers and dumps the image data - that´s that task completed. 'MyImageControllerName' can be anything, you could call it ImgController and for any file that isn´t in your root /img/ folder, this controller would be triggered. I am thinking about creating a login form - if a user has validated I will display a modify/delete bottom below each element (text/image) - this logic will be placed in each view!! (are this ok?) There will only be one admin user. Acccess control would just mean (for example) setting a session variable when someone logs in, and checking for this session variable to display 'admin' content. You should also put a check in the beforeFilter of your controller (or app controller if you want acl site wide in one call) so that should anyone guess the right url they don't get access to something they shouldn't. you could do something like if ($Session['MemberLoggedIn']) { $this-renderElement(AdminActions); } In your view/layout to keep the views simple and the logic easily seperable. So far I have created the following controllers: ccases (customer cases), ccases_pictures (ccase_id, file_id) text (all text, e.g. about us, contact, description etc), files, Assuming that you mean a CMS for a single site, you don´t need a text controller, there is an inbuilt one named pages that is used to display static content. It isn´t too difficult to create a controller to edit your static pages, should that be required. A contact form requires a form target and as such it´s best to give it it's own controller. How do I put all this together? Should I create a page controller with one action for each tab? (forside, om-os, det-kan-vi, cases, kontakt) (translated: home, about-us, skills, cases, contact) If you pages are static in nature (dont require controller logic) use the pages controller. You can use routes such that /forside is understood by cake to mean /pages/display/home. I hope this helps answer some of your questions, Cheers, AD7six --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: basic website with cake.
For what you want, I'd probably recommend a pre-built CMS, because otherwise it's going to kill you. There's so much design stuff before you can even get into the programming, believe me - I know. If you do want to go ahead - read up on the things other CMSes have. Decide what you need and what you don't need, and junk the rest. Then spend a few days at least planning out how you're going to do it (this part, if done properly, will save you a fair bit of time later - but don't worry too much, Cake works well for agile development so you don't need to design it all in advance, just plan the basics). Any static text blocks that won't change much can probably use the PagesController that already exists, you can just stick your html into the /views/pages/ directory if you want that. But if you want complete editing functions it'll be harder. Give it some more thought anyway, if you still think it's worth the effort then maybe some of us can point you in the right direction. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---