Welcome to the Cookbook

loading...

Special CSS Classes

There are certain elements that can be given special attention. These require a special class attribute to be applied to the element.

# Warning

Warnings should be used to let the user know about something that is important such as indicating that a method or property is deprecated. It could also be used to point out where certain usage might create adverse effects.

Example:

This method has been deprecated. Please use methodName.

<p class="warning">This method has been deprecated. Please use <a href="#">methodName</a>.</p>
  1. <p class="warning">This method has been deprecated. Please use <a href="#">methodName</a>.</p>

Alternatively, if you have a warning that spans across multiple block elements then use a DIV to wrap all elements.

Example:

This approach may create serious performance degradation. Consider alternative approaches:

  • Approach A
  • Approach B
<div class="warning">
   <p>This approach may create serious performance degradation. Consider alternative approaches:</p>
   <ul>
      <li>Approach A</li>
      <li>Approach B</li>
   </ul>
</div>
  1. <div class="warning">
  2. <p>This approach may create serious performance degradation. Consider alternative approaches:</p>
  3. <ul>
  4. <li>Approach A</li>
  5. <li>Approach B</li>
  6. </ul>
  7. </div>

# Note

A note can be used to highlight information that a reader should know or be aware of when developing their application.

Example:

You can add conditions to any of the methods to narrow down your results.

<p class="note">You can add conditions to any of the methods to narrow down your results.</p>
  1. <p class="note">You can add conditions to any of the methods to narrow down your results.</p>

A note that needs to span across multiple block elements should use a DIV that wraps all elements. See the previous section for example.

# Method

The method class should be used to wrap the method statement, parameters, and return value. The class is only applied to a single paragraph element.

Example:

string render (array $options = array())

<p class="method">
   <code>string render (array $options = array())</code>
</p>
  1. <p class="method">
  2. <code>string render (array $options = array())</code>
  3. </p>

# Code and pre tags

Pre tags are assumed to contain php code unless otherwise specified

There are however other classes which can be used for pre tags specifcally:

plain for plain text. I.e. entering:

<pre class="plain">
Plain text
With self entered carriage return
</pre>

Gives:

Plain text
With self entered carriage return

shell for shell commands. I.e. entering:

<pre class="shell">
$ cake bake shell code
</pre>

Gives:

$ cake bake shell code