$prefix = '$this->' . $prefix . '->';
        }
        $example = $comment->example();
        if (empty($example) and isset($examples[$method])) {
            $example = $examples[$method];
        }
        ?>
	
<?php 
        echo user_guide_block('function', array('function' => $method_obj, 'prefix' => $prefix));
        ?>
<div class="toggle_block">
<?php 
        echo $description;
        ?>

<?php 
        echo user_guide_block('return', array('return' => $comment_return));
        ?>

<?php 
        echo user_guide_block('params', array('params' => $parameters, 'comment_params' => $comment_params));
        ?>

<?php 
        echo user_guide_block('example', array('example' => $example));
        ?>
</div>
<?php 
    }
}
Exemplo n.º 2
0
?>
"><strong>Field Class (optional)</strong> - the custom object for a specific field. By default, it will simply return the value in the database</a></li>
</ul>


<h2 id="initializing">Initializing the Class</h2>

<p>The Model class is initialized using the <dfn>$this->load->model</dfn> function:</p>

<pre class="brush: php">$this->load->model('examples_model');</pre>
<p>Once loaded, the Model object will be available using: <dfn>$this->examples_model</dfn>.</p>

<h2 id="configuring">Configuring Model Information</h2>
<?php 
$vars['class'] = $my_model;
echo user_guide_block('properties', $vars);
?>


<h2 id="extending">Extending Your Model</h2>
<p>When extending <a href="<?php 
echo user_guide_url('libraries/my_model#my_model');
?>
">MY_Model</a> or <a href="<?php 
echo user_guide_url('libraries/base_module_model');
?>
">Base_module_model</a>, it is recommended to use a plural version of the objects name, in
this example <strong>Examples</strong>, with the suffix of <strong>_model</strong> (e.g.<dfn>Examples_model</dfn>). 
The plural version is recommended because the singular version is often used for the custom record class (see below for more). 
</p>
                if ($class->parent()) {
                    ?>
	<p>This class extends the <dfn><?php 
                    echo $class->parent();
                    ?>
</dfn> class.</p>
<?php 
                }
                ?>

<?php 
                echo user_guide_block('properties', array('class' => $class));
                ?>

<?php 
                echo user_guide_block('function_list', array('class' => $class));
                ?>

</div>

<?php 
            }
            ?>

<?php 
        }
        ?>
<br /><br />
<?php 
    }
}