pre_start(); ?> /* UPDATE bugs SET updated_on='2007-03-23',bug_status='FIXED' WHERE bug_id = 4 */ $data = array( 'updated_on' => '2007-03-23', 'bug_status' => 'FIXED' ); $n = $db->update('bugs', $data, 'bug_id = ?', $bug_id); <?php pre_end(); ?> <h2>Deleting Data</h2> <p> The <b>delete()</b> method takes a table name as first argument. The second argument is the criteria, which can take binding parameters. Be careful because the criteria is optional. <?php pre_start(); ?> // => DELETE FROM users $db->delete('users'); // => DELETE FROM users WHERE userid = 50 $db->delete('users', 'userid = ?', $user_id); <?php pre_end();
config_dir # defaults to CORE_ROOT_DIR/config # Application directories app_dir # defaults to CORE_ROOT_DIR/apps/[appname] app_config_dir # defaults to CORE_ROOT_DIR/apps/[appname]/config app_lib_dir # defaults to CORE_ROOT_DIR/apps/[appname]/lib app_module_dir # defaults to CORE_ROOT_DIR/apps/[appname]/modules app_template_dir # defaults to CORE_ROOT_DIR/apps/[appname]/templates sf_web_dir # defaults to CORE_ROOT_DIR/web sf_upload_dir # defaults to CORE_ROOT_DIR/web/uploads sf_cache_dir # cache root directory (sfCache) sf_root_dir # project root directory sf_symfony_lib_dir # where to autoload symfony classes from sf_charset # defaults to 'utf-8' sf_test # defaults to CORE_DEBUG (front controller) sf_debug # defaults to CORE_DEBUG (front controller) sf_compressed # defaults to enabled if support detected <?php pre_end(); ?> <h2>Example</h2> <p> These are all current coreConfig settings: <?php pre_start('printr'); print_r(coreConfig::getAll()); pre_end(); ?>
with the <b>core_factories</b> setting. For each configurable factory, you can provide a custom class that will be used by the framework instead of the Core class. <p> These are the configurable factories, the setting name, and the class that you need to extend if replacing the Core class: <ul> <li><b>user</b> : extend <em>coreUserBasicSecurity</em></li> <li><b>request</b> : extend <em>coreWebRequest</em></li> <li><b>response</b> : extend <em>coreWebResponse</em></li> </ul> <p> Here we replace the user factory (coreUserBasicSecurity) with myUser: <?php pre_start('info'); ?> // myUser.php class myUser extends coreUserBasicSecurity { public function initialize(coreSessionStorage $storage, $options = array()) { parent::initialize($storage, $options); // Add our initialization code... } // Add our methods... public function signIn($signInName, $credentials = array()) {
// Subscribe the default callback for events bubbling up to // the root element. Use e.target in this handler to get the // element that started the event chain, otherwise "el" will be the root element. onDefault(fn[, scope]) // Cleanup the event listener from the DOM. destroy() <?php pre_end(); ?> <h2>Callback signature:</h2> <p> The callback receives the event object, and the current element in the bubble chain. Usually matchedEl is the element with the class name that was registered with on(). </p> <p> When using onDefault(), matchedEl is always the root element. To get the element that started the event chain use <samp>e.target</samp>. </p> <p> Return <strong>false</strong> explicitly to stop the event and interrupt the event chain. Otherwise the event will continue bubbling up to the onDefault() handler if set, or the default element behaviour (links, form submit button, etc). </p> <?php pre_start('js'); ?> myCallback(e, matchedEl) <?php pre_end();
<?php pre_start('js'); ?> Core.ready(function() { var ajaxTable = new Core.Ui.AjaxTable(Core.Ui.get('MembersListComponent')); }); <?php pre_end(); ?> <p>The component's view returns a FORM element and the table code. The FORM element is output by the form_tag() helper (FormHelper). The form's action attribute (the ajax url) and the method (post) will be used by AjaxPanel for the request.</p> <?php pre_start('code'); ?> <?php use_helper('Form') ?> <?php echo form_tag('corejs/ajaxtable') ?> <?php echo input_hidden_tag('hidden1', 'foobar') ?> </form> <table cellspacing="0" class="tabular"> ... </table> <?php pre_end(); ?> <script type="text/javascript">
<?php use_helper('Widgets'); ?> <h3>Markup reference:</h3> <?php pre_start('html'); ?> <div class="uiProgressBar"> <div> <span class="g" title="30 of 50" style="width:60%"></span> <span class="r" title="5 of 50" style="width:10%"></span> </div> </div> <?php pre_end(); ?> <h2>ui_progress_bar() helper</h2> <?php echo ui_progress_bar(array(array('value' => 75), array('value' => 0, 'label' => 'custom label', 'class' => 'r')), 100, array('id' => 'custom_id')); ?> <p>With custom border color:</p> <?php echo ui_progress_bar(array(array('value' => 75), array('value' => 0, 'label' => 'custom label', 'class' => 'r')), 100, array('borderColor' => '#A1A1A1'));