Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Documentation Standards
  • Hi guys, I just forked the documentation on fuel to add an example for using set_config to add attributes to form tag when using Fieldset class. I figured out how to do this from looking at code, but there is no list of available config options in documentation. I added my example under the set_config examples. During this time, I noticed larger issue, however. It seems that documentation standards are not being kept consistent. On the page I edited for example, all examples are coded like this: <code>$article_form = Fieldset::factory('article');</code> But on other pages, examples are coded like this: <code class="php"><span class="comment">// returns <form action="http://mydomain.com/uri/to/form"; accept-charset="utf-8" method="post"></span>
    <span class="keyword">echo</span> Form::open(<span class="string">'uri/to/form'</span>);
    <span class="comment">// returns <form action="http://google.com/"; accept-charset="utf-8" method="get"></span>
    <span class="keyword">echo</span> Form::open(<span class="keyword">array</span>(<span class="string">'action'</span> => <span class="string">'http://google.com/'</span>, <span class="string">'method'</span> => <span class="string">'get'</span>));</code> The second example is taken from http://fuelphp.com/docs/classes/form.html The second example obviously looks much prettier, and someone took the trouble to make those formatting options available through classes. My question is, what is the right way to update documentation? I updated using same coding standards I found on fieldset page, but it worries me that coding standards are different on form page. If we do not keep this organized and standardized, not all pages will look consistent. It's just css/html, but I think it's important. I also realized today that whenever I figure out how to do something that wasn't shown in examples, I should add it to documentation. That will make it easier for others to learn Fuel without needing to reinvent things (as I think I have done several times already). Ok - that's all I have to say! I made pull request on my documentation change.
  • Are you sure you seen ?
    <code class="php"><span class="comment">...
    I am looking at http://fuelphp.com/docs/classes/form.html and all examples are only with:
    <pre class="php">
    <code>
    // returns <form action="http://mydomain.com/uri/to/form"; accept-charset="utf-8" method="post">
    echo Form::open('uri/to/form');
    ... And this is the way it should be, as the highlighting of the code is made with Javascript.
    If you look at the header you will see:
    hljs.tabReplace = ' ';
    hljs.initHighlightingOnLoad();
  • Look at these 2 pages: http://fuelphp.com/docs/classes/fieldset.html http://fuelphp.com/docs/classes/form.html Tell me are they not formatted differently? Here is code taken from first example of each: Fieldset class:
    <th>Example</th>
    <td>
    <code>$article_form = Fieldset::factory('article');</code>
    </td> Form class:
    <th>Example</th>
    <td>
    <pre class="php"><code>// returns <form action="http://mydomain.com/uri/to/form"; accept-charset="utf-8" method="post">
    echo Form::open('uri/to/form'); // returns <form action="http://google.com/"; accept-charset="utf-8" method="get">
    echo Form::open(array('action' => 'http://google.com/', 'method' => 'get'));</code></pre>
    </td> My question is what is correct way.
  • The first one is wrong, it should be:
    <pre class="php"><code>
    

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion