Re: CakePHP programming problem
In general, read up about MVC as anselm said earlier http://en.wikipedia.org/wiki/Model-view-controller is one site, but there are a whole slew of other sites which provide descriptions which should give you an overall view of what Cake is trying to achieve. Hopefully, I have covered all your questions above. 1. Is there a formal thing called a "page template" and this is meant to invoke its known properties? Also, is "action" a defined formal term for something? A page template is a layout. It is the framework into which all your content goes. You have a default layout, and each action may instead define that it uses a different layout. An action is a function in a controller class which basically becomes the second item in a URL - http://www.sitename.com/myControllerName/actionName/param1/param2/... -where param1 and 2 etc are optional, and if you do not have an action, it calls the index function in your controller. 2. What does "PostsController::add()" represent? It represents a coll to the add funciton in the PostsController class when you visit URL www.sitename.com/posts/add 3. What do you do with these files (view files)? You define what the output to the browser is for the particular action. 4. Is that supposed to mean something, the "view template file"? Is that the verb "to view the template file"? Then we have something called a template file and there s a file that when executed displays it? Where is this explained? The template file is a file in the view directory. Any of the files endin thtml are template files and they define in mixed HTML/PHP what output is being provided to the browser. 5. How do you do that and why (you can use the data from the corresponding Model. This data is passed as an array called $data. )? The Model class is your interface to the database table named after the model. Any data in that table is available via the data array. 6. What does "using set" mean? In your controller, you can use the function $this->set to allow you to make data available to your view. The view can see no other data. 7. What are HTML helpers? These are functions which are designed to make your job of editing the thtml files and outputting HTML easier. 8. How can I see a list of all of these functions with explanations? Look in api.cakephp.org The source code is available and can be read. 9. What does "default layout" mean? Answered above. 10. Why do we create a layout and where does t explain how to? So you can define your page. 11. What kind of thing is $content_for_layout? And why is $title_for_layout optional? $content_for_layout is a string containing all of your output data. It is where what you have defined in your view thtml file goes in your layout. $title_for_layout allows you to set a custom title for a page. It is not required, but useful. 12. What is a controller variable? A variable defined in a controller class. 13. What is the controller's $layout variable and setLayout() function? Allow you to override the default layout and provide a layout specific for this controller or action. 14. What does it mean to give an element access to data, and to send it as a named parameter in an array? Elements do not see any data by default. You have to add an extra array as the second parameter to render_element which contains a list of parameters and their names. 15. What in general do you input into CakePHP? How do you use it after you do all the input to set it up? What are the options that you can use in order to run the application then? Whatever your want to do. Call the controller and action using the URL of your page and it will run the code in that controller. Paul --~--~-~--~~~---~--~~ 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: CakePHP programming problem
Larry E. Masters aka PhpNut wrote: Peter, Just out of curiosity have you even attempted the tutorial that in in the manual? Doing it will help you understand how things work in the framework. Yes, that's the first thing I did. But there is no reference to where their terms are defined, or links from technical terms to pages that explain them, or self-contained explanations. Peter -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ --=_Part_6923_22504336.1167926688891 Content-Type: text/html; charset=ISO-8859-1 X-Google-AttachSize: 356 Peter,Just out of curiosity have you even attempted the tutorial that in in the manual? Doing it will help you understand how things work in the framework.-- /*** @author Larry E. Masters * @var string $userName* @param string $realName* @returns string aka PhpNut* @access public*/ --=_Part_6923_22504336.1167926688891-- --~--~-~--~~~---~--~~ 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: CakePHP programming problem
Peter, Just out of curiosity have you even attempted the tutorial that in in the manual? Doing it will help you understand how things work in the framework. -- /** * @author Larry E. Masters * @var string $userName * @param string $realName * @returns string aka PhpNut * @access public */ --~--~-~--~~~---~--~~ 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: CakePHP programming problem
Chris Hartjes wrote: I think I see *my* problem with your questions here: you are using terminology which I find confusing ("developed an expression" Where are these terms coming form? Are they some sort of hard-core computer science thing, because I studied computer programming at college (although it was 10 years ago now) and don't remember any labels like that being applied. Any description of PHP (or any other programming language) will define expressions pretty early on. For example, in http://www.php.net/langref chapter 5 is Expressions, and begins, "Expressions are the most important building stones of PHP." Peter -- Chris Hartjes "The greatest inefficiencies come from solving problems you will never have." -- Rasmus Lerdorf @TheBallpark - http://www.littlehart.net/attheballpark @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: CakePHP programming problem
Chris Hartjes wrote: On 1/2/07, PHPBABY3 <[EMAIL PROTECTED]> wrote: > are fairly sophisticated. I developed an expression that defines the > format of a page, giving directions for my parser program to walk > through a site given a little knowledge from a user. > My questions aren't asking about PHP programming. They are > specifically asking what it is that CakePHP provides in terms of chores I think I see *my* problem with your questions here: you are using terminology which I find confusing ("developed an expression" and the use of "chores" as a label to describe input). Hence my apparent inability to understand the questions you are asking # 1. I mean expressions as in PHP expressions that make up PHP code, composed of constants, operators and functions. Programmers know that most inputs into most applications are single values (e.g. a person's first name) rather than an expression that combines multiple values. And they also know the power of systems that allow you to input an expression e.g. to define input data validation. What I did was to apply the concept to defining the syntax of an HTML page so a general purpose parser can take an HTML file plus the expression that defines the format of the data presented in that HTML and extract that value. I developed this system in PHP and MySQL. # 2. By chores, I don't mean input. I mean the general sense of what you must do to get something done. I am asking the general question of what you do to set up an application: enter data into forms, modify files with PHP code in them, copy functions that you have written into existing CakePHP files, etc. That is why I used the general word "chore" - to represent all of the types of things that you do. I am seeing that you must create files of PHP code to define parameters (e.g. validation of fields) rather than entering it into a form. If there is a link to something that answers these questions, then I would like to see it. All I have found is low level descriptions with all of the details, and no high level overall summary of how CakePHP works. It is always best to start at the highest level of abstraction and work your way down, whether it is an explanation or problem-solving in general. Peter and (more importantly) why you can't find them in the manual or any of the tutorials. Am I the only one here who thinks the manual and bakery are clear? Where are these terms coming form? Are they some sort of hard-core computer science thing, because I studied computer programming at college (although it was 10 years ago now) and don't remember any labels like that being applied. Maybe something is lost in translation (I'm not assuming English is everyone's first language here, even though it is mine). -- Chris Hartjes "The greatest inefficiencies come from solving problems you will never have." -- Rasmus Lerdorf @TheBallpark - http://www.littlehart.net/attheballpark @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: CakePHP programming problem
Chris Hartjes wrote: On 1/2/07, PHPBABY3 <[EMAIL PROTECTED]> wrote: > > Thanks, but it has so many undefined terms that I can't get very far. > Could ANYONE just start by answering some simple questions? > > 1. What are the data structures that you enter into i.e. files that you > create or software that you enter information into? > > 2. What are the outputs that it produces, on the screen or on paper? > > 3. How do you run the application after it has been programmed in > CakPHP? How is it constructed? > > Peter I believe that your questions are more appropriate for a PHP mailing list. Your questions are so basic and the answers so fundamental to programming in PHP Not at all. I am not asking about PHP programming. I already know that. I am asking only about CakePHP. These are simpe questions and there should be a good answer for people who want to know what CakePHP is like. Peter -- Chris Hartjes "The greatest inefficiencies come from solving problems you will never have." -- Rasmus Lerdorf @TheBallpark - http://www.littlehart.net/attheballpark @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: CakePHP programming problem
1. Is there a formal thing called a "page template" and this is meant to invoke its known properties? Also, is "action" a defined formal term for something? I think you are trying too hard. You seem to approach programming as one would approach mathematics - wanting everything to be formally defined. CakePHP is a framework for Rapid Application Development - which works much more on intuition and tacit understanding than formal definition. Relax. Read what you can on MVC (http://en.wikipedia.org/wiki/Model-view-controller). Go through the Cake Blog tutorial. It's here : http://manual.cakephp.org/appendix/blog_tutorial . It tells you exactly what to do. At first, you might not understand _why_ things work the way they do. That's fine -- take it easy. Just do it, and see it running. Then modifiy it. Adapt it. This way you will slowly build your intuition. Next step, write your own small application based on the intuitive understanding you gained. Again, it does not matter if you don't exactly understand why things work the way they do. When you get to something you don't know how to do, check this group's archive ; likelyhood is it's been answered before. If you're not quite sure how a function behave, read it's code. That's the best way to learn (the code of CakePHP is the closest thing you'll get to a formal defintion - it's well written and very readable). Before you know it, you will have build a intuitive understanding of CakePHP, and you will know why and how things work. And this understanding will be usefull beyond CakePHP - it will apply to MVC web frameworks in general. If you can't work that way, then maybe Rapid Application Development is not for you ! "Take it easy baby, Take it as it comes" Anselm --~--~-~--~~~---~--~~ 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: CakePHP programming problem
On Jan 2, 2007, at 2:29 PM, John David Anderson (_psychic_) wrote: Please clarify and narrow the scope for these last questions, as they are too broad to address. Please also run through the CakePHP blog tutorial. Experiencing MVC in a hands-on way will help you to understand how things work together much faster than reading the manual (or anything else). You might also get more mileage out of the manual if you try to cross reference terms and look things up you aren't familiar with in sections other than the most immediate one. Happy Baking, John --~--~-~--~~~---~--~~ 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: CakePHP programming problem
On Jan 2, 2007, at 12:49 PM, PHPBABY3 wrote: anselm wrote: > 1. Create a button that will appear on all pages in the application at > a particular location using CSS, and that does as follows. If you want your button to appear on all pages at the same place, then the easiest is to put the button as part of your layout. Your default layout goes in app/views/layout/default.thtml -- see this part of the manual to lear more about views and about layouts : http://manual.cakephp.org/chapter/views I have some questions (numbered): CakePHP: The Manual Views Section 1 Views A view is a page template, usually named after an action. 1. Is there a formal thing called a "page template" and this is meant to invoke its known properties? The definition of formal depends on context. Also, is "action" a defined formal term for something? Again, this depends on your definition of formal. I've seen the same thing coined as controller action, function, and method. For example, the view for PostsController::add() 2. What does "PostsController::add()" represent? (http://php.net/manual/en/language.oop5.paamayim-nekudotayim.php) A call to the add function of the PostsController. would be found at /app/views/posts/add.thtml. Cake views are quite simply PHP files, so you can use any PHP code inside them. Although most of your view files will contain HTML, a view could be any perspective on a certain set of data, be it XML, and image, etc. 3. What do you do with these files? View files? You place your presentational code inside them. In the view template file, 4. Is that supposed to mean something, the "view template file"? Yes. Its referring to the view template file at /app/views/ controller_name/action_name.thtml Is that the verb "to view the template file"? Then we have something called a template file and there s a file that when executed displays it? Where is this explained? Please clarify this question, as I'm not sure what you're asking here. you can use the data from the corresponding Model. This data is passed as an array called $data. 5. How do you do that and why? Check the Controller::set() method in the API. http://api.cakephp.org/ class_controller.html#8d64f371009811f1d5662a491ba5cf82 Any data that you've handed to the view using set() in the controller 6. What does "using set" mean? http://api.cakephp.org/ class_controller.html#8d64f371009811f1d5662a491ba5cf82 is also now available in your view. The HTML helper 7. What are HTML helpers? http://manual.cakephp.org/chapter/helpers says: "Helpers are meant to provide functions that are commonly needed in views to format and present data in useful ways." is available in every view by default, and is by far the most commonly used helper in views. It is very helpful in creating forms, including scripts and media, linking and aiding in data validation. Please see section 1 in Chapter "Helpers" for a discussion on the HTML helper. Most of the functions available in the views 8. How can I see a list of all of these functions with explanations? http://api.cakephp.org/class_html_helper.html are provided by Helpers. Cake comes with a great set of helpers (discussed in Chapter "Helpers"), and you can also include your own. Because views shouldn't contain much logic, there aren't many well used public functions in the view class. One that is helpful is renderElement(), which will be discussed in section 1.2. Layouts A layout contains all the presentational code that wraps around a view. Anything you want to see in all of your views should be placed in your layout. Layout files are placed in /app/views/layouts. Cake's default layout 9. What does "default layout" mean? Its the layout that is used unless another is specified. http://manual.cakephp.org/chapter/views, see the Layouts section. can be overridden by placing a new default layout at /app/views/layouts/default.thtml. Once a new default layout has been created, controller view code is placed inside of the default layout when the page is rendered. When you create a layout, 10. Why do we create a layout and where does t explain how to? (http://manual.cakephp.org/chapter/views) "A layout contains all the presentational code that wraps around a view. Anything you want to see in all of your views should be placed in your layout." It reduces code duplication. you need to tell Cake where to place your controller view code: to do so, make sure your layout includes a place for $content_for_layout (and optionally, $title_for_layout). 11. What kind of thing is $content_for_layout? It is a scalar variable, usually with string contents. And why is $title_for_layout optional? A complete element isn't required for a page to render in a browser. Here's an example of what a default layout might look like: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/1999/xhtml";> ... ...
Re: CakePHP programming problem
On 1/2/07, PHPBABY3 <[EMAIL PROTECTED]> wrote: are fairly sophisticated. I developed an expression that defines the format of a page, giving directions for my parser program to walk through a site given a little knowledge from a user. My questions aren't asking about PHP programming. They are specifically asking what it is that CakePHP provides in terms of chores I think I see *my* problem with your questions here: you are using terminology which I find confusing ("developed an expression" and the use of "chores" as a label to describe input). Hence my apparent inability to understand the questions you are asking and (more importantly) why you can't find them in the manual or any of the tutorials. Am I the only one here who thinks the manual and bakery are clear? Where are these terms coming form? Are they some sort of hard-core computer science thing, because I studied computer programming at college (although it was 10 years ago now) and don't remember any labels like that being applied. Maybe something is lost in translation (I'm not assuming English is everyone's first language here, even though it is mine). -- Chris Hartjes "The greatest inefficiencies come from solving problems you will never have." -- Rasmus Lerdorf @TheBallpark - http://www.littlehart.net/attheballpark @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: CakePHP programming problem
Chris Hartjes wrote: On 1/2/07, PHPBABY3 <[EMAIL PROTECTED]> wrote: > > Thanks, but it has so many undefined terms that I can't get very far. > Could ANYONE just start by answering some simple questions? > > 1. What are the data structures that you enter into i.e. files that you > create or software that you enter information into? > > 2. What are the outputs that it produces, on the screen or on paper? > > 3. How do you run the application after it has been programmed in > CakPHP? How is it constructed? > > Peter I believe that your questions are more appropriate for a PHP mailing list. They are about CakePHP and this is the CakePHP group. This mailing list is for developers of CakePHP. The About Group page says it is for users and develpers of CakePHP. It is the only Google Group on CakePHP, so it seems to be for CakePHP in general. In any case, I have been developing applications in PHP for 5 years and just started using CakePHP, so I would think that the CakePHP group would be the place to look. and, unfortunately, assumes some level of knowledge of the PHP programming language. I've use PHP to write about 10 different applications. Most of them extracted data from other sites and created a database of that data with routines to display it and let the user peruse it. Some of them are fairly sophisticated. I developed an expression that defines the format of a page, giving directions for my parser program to walk through a site given a little knowledge from a user. Your questions are so basic and the answers so fundamental to programming in PHP that if you've done any work in PHP building a web-based, database-driven application that you will already know those answers. No, CakePHP has its own concepts beyond PHP, and also uses PHP constructs that a programmer doesn't necessarily use himself. Google is your friend for finding PHP tutorials, and I highly recommend any sort of "PHP for beginners" book you can get your hands on. My questions aren't asking about PHP programming. They are specifically asking what it is that CakePHP provides in terms of chores (input) required of the programmer and the specific facilities provided by CakePHP. Can anyone answer these questions abou CakePHP? Thanks, Peter -- Chris Hartjes "The greatest inefficiencies come from solving problems you will never have." -- Rasmus Lerdorf @TheBallpark - http://www.littlehart.net/attheballpark @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: CakePHP programming problem
anselm wrote: > 1. Create a button that will appear on all pages in the application at > a particular location using CSS, and that does as follows. If you want your button to appear on all pages at the same place, then the easiest is to put the button as part of your layout. Your default layout goes in app/views/layout/default.thtml -- see this part of the manual to lear more about views and about layouts : http://manual.cakephp.org/chapter/views I have some questions (numbered): CakePHP: The Manual Views Section 1 Views A view is a page template, usually named after an action. 1. Is there a formal thing called a "page template" and this is meant to invoke its known properties? Also, is "action" a defined formal term for something? For example, the view for PostsController::add() 2. What does "PostsController::add()" represent? would be found at /app/views/posts/add.thtml. Cake views are quite simply PHP files, so you can use any PHP code inside them. Although most of your view files will contain HTML, a view could be any perspective on a certain set of data, be it XML, and image, etc. 3. What do you do with these files? In the view template file, 4. Is that supposed to mean something, the "view template file"? Is that the verb "to view the template file"? Then we have something called a template file and there s a file that when executed displays it? Where is this explained? you can use the data from the corresponding Model. This data is passed as an array called $data. 5. How do you do that and why? Any data that you've handed to the view using set() in the controller 6. What does "using set" mean? is also now available in your view. The HTML helper 7. What are HTML helpers? is available in every view by default, and is by far the most commonly used helper in views. It is very helpful in creating forms, including scripts and media, linking and aiding in data validation. Please see section 1 in Chapter "Helpers" for a discussion on the HTML helper. Most of the functions available in the views 8. How can I see a list of all of these functions with explanations? are provided by Helpers. Cake comes with a great set of helpers (discussed in Chapter "Helpers"), and you can also include your own. Because views shouldn't contain much logic, there aren't many well used public functions in the view class. One that is helpful is renderElement(), which will be discussed in section 1.2. Layouts A layout contains all the presentational code that wraps around a view. Anything you want to see in all of your views should be placed in your layout. Layout files are placed in /app/views/layouts. Cake's default layout 9. What does "default layout" mean? can be overridden by placing a new default layout at /app/views/layouts/default.thtml. Once a new default layout has been created, controller view code is placed inside of the default layout when the page is rendered. When you create a layout, 10. Why do we create a layout and where does t explain how to? you need to tell Cake where to place your controller view code: to do so, make sure your layout includes a place for $content_for_layout (and optionally, $title_for_layout). 11. What kind of thing is $content_for_layout? And why is $title_for_layout optional? Here's an example of what a default layout might look like: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/1999/xhtml";> ... ... To set the title for the layout, it's easiest to do so in the controller, using the $pageTitle controller variable. 12. What is a controller variable? class UsersController extends AppController { function viewActive() { $this->pageTitle = 'View Active Users'; } } You can create as many layouts as you wish for your Cake site, just place them in the app/views/layouts directory, and switch between them inside of your controller actions using the controller's $layout variable, or setLayout() function. 13. What is the controller's $layout variable and setLayout() function? For example, if a section of my site included a smaller ad banner space, I might create a new layout with the smaller advertising space and specify it as the layout for all controller's actions using something like: var $layout = 'default_small_ad'; Elements Many applications have small blocks of presentational code that needs to be repeated from page to page, sometimes in different places in the layout. Cake can help you repeat parts of your website that need to be reused. These reusable parts are called Elements. Ads, help boxes, navigational controls, extra menus, and callouts are often implemented in Cake as elements. An Element is basically a mini-view that can be included in other Views. Elements live in the /app/views/elements/ folder, and have the .thtml filename extension. The Element by default has no access to any data. To give it access to data, you send it in as a named parameter in an array. 14. What does it
Re: CakePHP programming problem
On 1/2/07, PHPBABY3 <[EMAIL PROTECTED]> wrote: Thanks, but it has so many undefined terms that I can't get very far. Could ANYONE just start by answering some simple questions? 1. What are the data structures that you enter into i.e. files that you create or software that you enter information into? 2. What are the outputs that it produces, on the screen or on paper? 3. How do you run the application after it has been programmed in CakPHP? How is it constructed? Peter I believe that your questions are more appropriate for a PHP mailing list. This mailing list is for developers of CakePHP and, unfortunately, assumes some level of knowledge of the PHP programming language. Your questions are so basic and the answers so fundamental to programming in PHP that if you've done any work in PHP building a web-based, database-driven application that you will already know those answers. Google is your friend for finding PHP tutorials, and I highly recommend any sort of "PHP for beginners" book you can get your hands on. -- Chris Hartjes "The greatest inefficiencies come from solving problems you will never have." -- Rasmus Lerdorf @TheBallpark - http://www.littlehart.net/attheballpark @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: CakePHP programming problem
anselm wrote: > 1. Create a button that will appear on all pages in the application at > a particular location using CSS, and that does as follows. If you want your button to appear on all pages at the same place, then the easiest is to put the button as part of your layout. Your default layout goes in app/views/layout/default.thtml -- see this part of the manual to lear more about views and about layouts : http://manual.cakephp.org/chapter/views Once you've done this successfully, you might want to reconsider refactoring your button into an element -- but get it all running first ! > > 2. Read 2 fields CHOICE and FIND. >a. The top one, CHOICE, is a drop-down list with the same 16 choices > each time. > Function ddlits() returns the list of 16 literal values that are > displayed. >b. The bottom one FIND is a text field with no default, so it is > blank initially. > > 3. By special rules used only here, we translate (2) into a list of > (Query#,SQL Query) pairs. > Function qrz($choice,$find) = list of ($qnm,$sqry) pairs of Query# and > Query. > > 4. Execute (3) and accumulate the results into []=(Query#,Tuple). That > is, we have a function runsql($sqry) = list of tuples returned by query > $sqry. > > 5. Translate (Query#,Tuple) => (Display,URL) by function > qtdis($qnm,$tuple)=($display,$url) to create a list of links to > display. > > 6. Display the (Display,URL) pairs as links. > I'm not sure what you're trying to achieve - is this some sort of search functionality ? Have a look at this thread : http://groups-beta.google.com/group/cake-php/browse_thread/thread/671fe307f99c80c0/b447beb8fc71fe24?lnk=gst&q=search+form&rnum=1#b447beb8fc71fe24 it might help ! > Can someone tell me how to implement this in CakePHP? Please be > explicit: I have to write what and store it where and do what to get > the button to appear on the existing pages? Great place to start is the manual ! http://manual.cakephp.org/ Try and implement the 'blog' example - you will have a better understanding as to what goes where after that. Thanks, but it has so many undefined terms that I can't get very far. Could ANYONE just start by answering some simple questions? 1. What are the data structures that you enter into i.e. files that you create or software that you enter information into? 2. What are the outputs that it produces, on the screen or on paper? 3. How do you run the application after it has been programmed in CakPHP? How is it constructed? Peter Anselm --~--~-~--~~~---~--~~ 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: CakePHP programming problem
1. Create a button that will appear on all pages in the application at a particular location using CSS, and that does as follows. If you want your button to appear on all pages at the same place, then the easiest is to put the button as part of your layout. Your default layout goes in app/views/layout/default.thtml -- see this part of the manual to lear more about views and about layouts : http://manual.cakephp.org/chapter/views Once you've done this successfully, you might want to reconsider refactoring your button into an element -- but get it all running first ! 2. Read 2 fields CHOICE and FIND. a. The top one, CHOICE, is a drop-down list with the same 16 choices each time. Function ddlits() returns the list of 16 literal values that are displayed. b. The bottom one FIND is a text field with no default, so it is blank initially. 3. By special rules used only here, we translate (2) into a list of (Query#,SQL Query) pairs. Function qrz($choice,$find) = list of ($qnm,$sqry) pairs of Query# and Query. 4. Execute (3) and accumulate the results into []=(Query#,Tuple). That is, we have a function runsql($sqry) = list of tuples returned by query $sqry. 5. Translate (Query#,Tuple) => (Display,URL) by function qtdis($qnm,$tuple)=($display,$url) to create a list of links to display. 6. Display the (Display,URL) pairs as links. I'm not sure what you're trying to achieve - is this some sort of search functionality ? Have a look at this thread : http://groups-beta.google.com/group/cake-php/browse_thread/thread/671fe307f99c80c0/b447beb8fc71fe24?lnk=gst&q=search+form&rnum=1#b447beb8fc71fe24 it might help ! Can someone tell me how to implement this in CakePHP? Please be explicit: I have to write what and store it where and do what to get the button to appear on the existing pages? Great place to start is the manual ! http://manual.cakephp.org/ Try and implement the 'blog' example - you will have a better understanding as to what goes where after that. Anselm --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---