1

I'm currently working through a geddy tutorial and came across a line of code:

<%- partial('form', {step: {}, toDos: toDos}) %>

What does partial mean? I've done a google search without much insight. I'm guessing it means that you partially load the content so the page loads faster?

Any explanations or helpful links would be appreciated.

http://geddyjs.org/tutorial

It's been a while since I've coded so if I should be looking at a particular method of coding (e.g. OOP, MVC) that I'm missing let me know.

user2864740
  • 60,010
  • 15
  • 145
  • 220
  • This question appears to be off-topic because it is about something easily found in the [documentation](http://geddyjs.org/reference#helpers_partial): _partial partial(partialURL, data) Partial takes a partialURL which is the location to a partial template and a data object which is the data to render the partial with(params, etc), then it renders the partial and puts the contents in place where the partial function was called._ – mplungjan May 12 '14 at 04:48
  • 1
    The documentation uses the word 'partial' to explain what a partial is. Now I know it is a 'reusable file/template' the above makes much more sense. – user3627070 May 13 '14 at 05:15

2 Answers2

3

I received this answer by Dan Craciun on experts exchange which answers it for me:

In geddy, a partial (denoted by a _ in front of the name) is a reusable file/template, that is meant to be used in more than one template. It helps share code between different templates.

See here for a longer explanation (about half page, "An intro to partials"): http://code.tutsplus.com/tutorials/creating-a-todo-list-app-with-nodejs-and-geddy--net-24535

HTH, Dan

  • Right. so you can now accept your own answer :) It was not obvious from the question that you did not know what partial as a concept was, but rather did not understand what the function `partial` did – mplungjan May 13 '14 at 06:15
-2

I am not sure, but in Symfony - partials are used in case that you have the some template, but there is a part that may be changed later (for example if you have the heading part of your html page, but the title will be different depending on what type of page it is).

So in order to keep the entire template and not break it into 2 parts, there are partials.

naneri
  • 3,771
  • 2
  • 29
  • 53
  • 1
    This is not symphony. If you read my comment, you will see it is a matter of reading the GEDDY documentation. It is a proprietary function in that framework. Now you have answered, the OP cannot delete the question. Please wait until you have more rep and can make comments which this is – mplungjan May 12 '14 at 05:25
  • Here is some wiki: "Partial takes a partialURL which is the location to a partial template and a data object which is the data to render the partial with(params, etc), then it renders the partial and puts the contents in place where the partial function was called." Thats from [geddy wiki](https://github.com/geddy/geddy/wiki/View-Helpers) – naneri May 12 '14 at 06:55
  • which I posted in a comment yesterday – mplungjan May 13 '14 at 06:18