ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

CMS Made Simple Snippets

by bbonora ALL

The is a package for Sublime Text 2 which contains a bunch of snippets commonly used for module development.

Labels snippets

Details

  • 2012.11.05.23.48.48
  • github.​com
  • github.​com
  • 13 years ago
  • 3 hours ago
  • 13 years ago

Installs

  • Total 2K
  • Win 2K
  • Mac 513
  • Linux 266
Aug 14 Aug 13 Aug 12 Aug 11 Aug 10 Aug 9 Aug 8 Aug 7 Aug 6 Aug 5 Aug 4 Aug 3 Aug 2 Aug 1 Jul 31 Jul 30 Jul 29 Jul 28 Jul 27 Jul 26 Jul 25 Jul 24 Jul 23 Jul 22 Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1
Windows 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
01234Aug 14Aug 11Aug 8Aug 5Aug 2Jul 30Jul 27Jul 24Jul 21Jul 18Jul 15Jul 12Jul 9Jul 6Jul 3Aug 14 Linux: 0 Mac: 0 Windows: 0Aug 13 Linux: 0 Mac: 0 Windows: 0Aug 12 Linux: 0 Mac: 0 Windows: 1Aug 11 Linux: 0 Mac: 0 Windows: 0Aug 10 Linux: 0 Mac: 0 Windows: 0Aug 9 Linux: 0 Mac: 0 Windows: 0Aug 8 Linux: 0 Mac: 0 Windows: 0Aug 7 Linux: 0 Mac: 0 Windows: 0Aug 6 Linux: 0 Mac: 0 Windows: 0Aug 5 Linux: 0 Mac: 0 Windows: 0Aug 4 Linux: 0 Mac: 0 Windows: 0Aug 3 Linux: 0 Mac: 0 Windows: 0Aug 2 Linux: 0 Mac: 0 Windows: 0Aug 1 Linux: 0 Mac: 0 Windows: 0Jul 31 Linux: 0 Mac: 0 Windows: 0Jul 30 Linux: 0 Mac: 0 Windows: 0Jul 29 Linux: 0 Mac: 0 Windows: 0Jul 28 Linux: 0 Mac: 0 Windows: 0Jul 27 Linux: 0 Mac: 0 Windows: 0Jul 26 Linux: 0 Mac: 0 Windows: 0Jul 25 Linux: 0 Mac: 0 Windows: 0Jul 24 Linux: 0 Mac: 0 Windows: 0Jul 23 Linux: 0 Mac: 0 Windows: 0Jul 22 Linux: 0 Mac: 0 Windows: 0Jul 21 Linux: 0 Mac: 0 Windows: 0Jul 20 Linux: 0 Mac: 0 Windows: 0Jul 19 Linux: 0 Mac: 0 Windows: 0Jul 18 Linux: 0 Mac: 0 Windows: 0Jul 17 Linux: 0 Mac: 0 Windows: 0Jul 16 Linux: 0 Mac: 0 Windows: 0Jul 15 Linux: 0 Mac: 0 Windows: 0Jul 14 Linux: 0 Mac: 0 Windows: 0Jul 13 Linux: 0 Mac: 0 Windows: 0Jul 12 Linux: 0 Mac: 0 Windows: 0Jul 11 Linux: 0 Mac: 0 Windows: 0Jul 10 Linux: 0 Mac: 0 Windows: 0Jul 9 Linux: 0 Mac: 0 Windows: 1Jul 8 Linux: 0 Mac: 0 Windows: 0Jul 7 Linux: 0 Mac: 0 Windows: 0Jul 6 Linux: 0 Mac: 0 Windows: 0Jul 5 Linux: 0 Mac: 0 Windows: 0Jul 4 Linux: 0 Mac: 0 Windows: 0Jul 3 Linux: 0 Mac: 0 Windows: 0Jul 2 Linux: 0 Mac: 0 Windows: 0Jul 1 Linux: 0 Mac: 0 Windows: 0Aug 14 Linux: 0 Mac: 0 Windows: 0Aug 13 Linux: 0 Mac: 0 Windows: 0Aug 12 Linux: 0 Mac: 0 Windows: 1Aug 11 Linux: 0 Mac: 0 Windows: 0Aug 10 Linux: 0 Mac: 0 Windows: 0Aug 9 Linux: 0 Mac: 0 Windows: 0Aug 8 Linux: 0 Mac: 0 Windows: 0Aug 7 Linux: 0 Mac: 0 Windows: 0Aug 6 Linux: 0 Mac: 0 Windows: 0Aug 5 Linux: 0 Mac: 0 Windows: 0Aug 4 Linux: 0 Mac: 0 Windows: 0Aug 3 Linux: 0 Mac: 0 Windows: 0Aug 2 Linux: 0 Mac: 0 Windows: 0Aug 1 Linux: 0 Mac: 0 Windows: 0Jul 31 Linux: 0 Mac: 0 Windows: 0Jul 30 Linux: 0 Mac: 0 Windows: 0Jul 29 Linux: 0 Mac: 0 Windows: 0Jul 28 Linux: 0 Mac: 0 Windows: 0Jul 27 Linux: 0 Mac: 0 Windows: 0Jul 26 Linux: 0 Mac: 0 Windows: 0Jul 25 Linux: 0 Mac: 0 Windows: 0Jul 24 Linux: 0 Mac: 0 Windows: 0Jul 23 Linux: 0 Mac: 0 Windows: 0Jul 22 Linux: 0 Mac: 0 Windows: 0Jul 21 Linux: 0 Mac: 0 Windows: 0Jul 20 Linux: 0 Mac: 0 Windows: 0Jul 19 Linux: 0 Mac: 0 Windows: 0Jul 18 Linux: 0 Mac: 0 Windows: 0Jul 17 Linux: 0 Mac: 0 Windows: 0Jul 16 Linux: 0 Mac: 0 Windows: 0Jul 15 Linux: 0 Mac: 0 Windows: 0Jul 14 Linux: 0 Mac: 0 Windows: 0Jul 13 Linux: 0 Mac: 0 Windows: 0Jul 12 Linux: 0 Mac: 0 Windows: 0Jul 11 Linux: 0 Mac: 0 Windows: 0Jul 10 Linux: 0 Mac: 0 Windows: 0Jul 9 Linux: 0 Mac: 0 Windows: 1Jul 8 Linux: 0 Mac: 0 Windows: 0Jul 7 Linux: 0 Mac: 0 Windows: 0Jul 6 Linux: 0 Mac: 0 Windows: 0Jul 5 Linux: 0 Mac: 0 Windows: 0Jul 4 Linux: 0 Mac: 0 Windows: 0Jul 3 Linux: 0 Mac: 0 Windows: 0Jul 2 Linux: 0 Mac: 0 Windows: 0Jul 1 Linux: 0 Mac: 0 Windows: 0Aug 14 Linux: 0 Mac: 0 Windows: 0Aug 13 Linux: 0 Mac: 0 Windows: 0Aug 12 Linux: 0 Mac: 0 Windows: 1Aug 11 Linux: 0 Mac: 0 Windows: 0Aug 10 Linux: 0 Mac: 0 Windows: 0Aug 9 Linux: 0 Mac: 0 Windows: 0Aug 8 Linux: 0 Mac: 0 Windows: 0Aug 7 Linux: 0 Mac: 0 Windows: 0Aug 6 Linux: 0 Mac: 0 Windows: 0Aug 5 Linux: 0 Mac: 0 Windows: 0Aug 4 Linux: 0 Mac: 0 Windows: 0Aug 3 Linux: 0 Mac: 0 Windows: 0Aug 2 Linux: 0 Mac: 0 Windows: 0Aug 1 Linux: 0 Mac: 0 Windows: 0Jul 31 Linux: 0 Mac: 0 Windows: 0Jul 30 Linux: 0 Mac: 0 Windows: 0Jul 29 Linux: 0 Mac: 0 Windows: 0Jul 28 Linux: 0 Mac: 0 Windows: 0Jul 27 Linux: 0 Mac: 0 Windows: 0Jul 26 Linux: 0 Mac: 0 Windows: 0Jul 25 Linux: 0 Mac: 0 Windows: 0Jul 24 Linux: 0 Mac: 0 Windows: 0Jul 23 Linux: 0 Mac: 0 Windows: 0Jul 22 Linux: 0 Mac: 0 Windows: 0Jul 21 Linux: 0 Mac: 0 Windows: 0Jul 20 Linux: 0 Mac: 0 Windows: 0Jul 19 Linux: 0 Mac: 0 Windows: 0Jul 18 Linux: 0 Mac: 0 Windows: 0Jul 17 Linux: 0 Mac: 0 Windows: 0Jul 16 Linux: 0 Mac: 0 Windows: 0Jul 15 Linux: 0 Mac: 0 Windows: 0Jul 14 Linux: 0 Mac: 0 Windows: 0Jul 13 Linux: 0 Mac: 0 Windows: 0Jul 12 Linux: 0 Mac: 0 Windows: 0Jul 11 Linux: 0 Mac: 0 Windows: 0Jul 10 Linux: 0 Mac: 0 Windows: 0Jul 9 Linux: 0 Mac: 0 Windows: 1Jul 8 Linux: 0 Mac: 0 Windows: 0Jul 7 Linux: 0 Mac: 0 Windows: 0Jul 6 Linux: 0 Mac: 0 Windows: 0Jul 5 Linux: 0 Mac: 0 Windows: 0Jul 4 Linux: 0 Mac: 0 Windows: 0Jul 3 Linux: 0 Mac: 0 Windows: 0Jul 2 Linux: 0 Mac: 0 Windows: 0Jul 1 Linux: 0 Mac: 0 Windows: 0

Readme

Source
raw.​githubusercontent.​com

SublimeCMSMadeSimple

Sublime Text 2 CMS Made Simple package is a collection of CMS Made Simple snippets and auto-completions for Sublime Text 2. It includes all of the methods found in the CMSModule class plus a few commonly used snippets for PHP and smarty programing.

Installation

Install the package via the package control (CMS Made Simple) or clone the contents of the repo in your Sublime Text 2 package directory.

Usage

  • PHP Files: Begin typing the name of the method you would like to use. The auto-completion menu will appear. Select the desired function from the list. Most all methods have placeholders. You can cycle through the placeholders using the tab key. A list of all the available CMSModule class methods can be viewed here: http://apidoc.cmsmadesimple.org/CMS/CMSModule.html

  • Smarty Files (*.tpl): Type the full name of the snippet followed by the tab key.

Available Snippets

PHP

  • cms_db - $db = cmsms()->GetDb();
  • cms_dict - $dict = NewDataDictionary($db);
  • cms_loop
while($results && $row = $results->FetchRow())
{
    $onerow = stdClass;
    $onerow->name = $row['name'];

    $entryarray[] = $onerow;
}
  • cms_getmod - $mod = cms_utils::get_module('module_name');
  • get_tabopt - $taboptarray = array('mysql' => 'TYPE=MyISAM');
  • cms_createtab
$sqlarray = $dict->CreateTableSQL(cms_db_prefix()."tablename", 
        $flds, $taboptarray);
$dict->ExecuteSQLArray($sqlarray);
  • cms_getconfig - $config = cmsms()->GetConfig();
  • cms_getsmarty - $smarty = cms_utils::get_smarty();
  • cms_createtabindex
$sqlarray = $dict->CreateIndexSQL(cms_db_prefix().'index_name',
                  cms_db_prefix().'table_name',
                  'column_name');
$dict->ExecuteSQLArray($sqlarray);
  • cms_db_sql - $db->sql;
  • cms_db_error - $db->ErrorMsg();
  • cms_db_getone - $db->GetOne($query,array(value,value));
  • cms_db_execute - $db->Execute($query,array(value,value));
  • cms_db_fetchrow - $results->FetchRow();

Smarty

  • smarty_form
{$startform}
<div class="pageoverflow">
    <p class="pagetext">{$prompt_name}</p>
    <p class="pageinput">{$input_name}</p>
</div>

<div class="pageoverflow">
    <p class="pagetext">&nbsp;</p>
    <p class="pageinput">{$submit} {$cancel} {$apply}</p>
</div>
{$endform}
  • smarty_table “ {$foreach from=$items key=key item=entry} {cycle values="row1,row2” assign='rowclass'} {/foreach}
    Heading 1 Heading 2 Heading 3 Heading 4 Heading 5        
    {$entry->one} {$entry->two} {$entry->three} {$entry->four} {$entry->five} {$entry->six} {$entry->seven} {$entry->eight} {$entry->nine}
+ **smarty_foreach**

{foreach from=$items key=key item=entry name=name} {$entry->item} {/foreach}

Author
------
**Ben Bonora**
+ http://twitter.com/bbonora
+ http://github.com/bbonora
+ http://www.bennyvbonora.com