Code Monkey home page Code Monkey logo

bonfire-snippets's Introduction

Bonfire Snippets for Sublime Text Editor

Just a random collection of Snippets I use for CI-Bonfire , development in Sublime Text Editor. I highly suggest using these with the Offical CodeIgniter Snippet package released and maintained by Marco Monteiro

Feel free to fork and add your own to the mix

Installation

Currently installation is manual via GIT, Sorry I have no clue where Windows stored it's Packages but I'm sure a quick google search will find it for you.

  • Mac Installation

    git clone [email protected]:svizion/bonfire-snippets.git ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/bonfire-snippets

  • Linux Installation

    git clone [email protected]:svizion/bonfire-snippets.git ~/.config/sublime-text-2/Packages/bonfire-snippets

Current Snippets

These are the current snippets I've included, left hand side is the trigger, right hand side is what happens.

Template and Assets

Tab TriggerOutput
set_data Template::set();
render Template::render();
toolbar_title Template::set('toolbar_title', '');
clear_cache Assets::clear_cache();
add_js Assets::add_js();
add_css Assets::add_css();
add_mod_js Assets::add_module_js();
add_mod_css Assets::add_module_css();

Various Randoms

Tab TriggerOutput
cur_user $this->current_user->?
bf_model Generates Bonfire Model Skeleton Structure
auth_controller Generates Authenticated_Controller Skeleton Structure
haz_perm PHP If Wrapper for has_permission check
restrict $this->auth->restrict();
log_activity $this->activity_model->log_activity($this->current_user->user_id(), '', 'module');
settings_set $this->settings_lib->set();
settings_delete $this->settings_lib->delete();

Bonfire Module Snippets

<tr>
	<td>count_by</td>
	<td>$num = $this->$1_model->count_by('$2', '$3');</td>
</tr>
</tbody>
Tab TriggerOutput
find $records = $this->$1_model->find($2);
find_by $records = $this->$1_model->find_by('$1', '$2');
find_all_by $records = $this->$1_model->find_all_by('$1', '$2');
insert $id = $this->$1_model->insert($2);
update $result = $this->$1_model->update($2, $data);
update_where $result = $this->$1_model->update_where('$2', '$3', \$${4:$data});
delete $result = $this->$1_model->delete($2);
delete_where $result = $this->$1_model->delete_where('$2', '$3');

Debugging snippets I use some are not fully Bonfire related.

</tbody>
Tab Trigger Output
cplog ChromePhp::log($1);
cperror ChromePhp::error($1);
console Console::log($1);
enable_profiler $this->output->enable_profiler(FALSE);
bflog parent::logit($1, '${2:error]');
log logit($1, '${2:error]');
dad $dump()die;

Follow me else where

  • My Blog lots of guides and articles on CodeIgniter, Bonfire and Web Development.
  • Twitter lots of insanity by your's truly

bonfire-snippets's People

Contributors

og-shawn-crigger avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

bonfire-snippets's Issues

[enhancement] Windows GIT command

First off all, sorry if i am using the issue tracker for posting feedback. Couldn't find an option to comment/edit the README.md file.

This would be the git command for windows :)

%appdata% points to the user's application directory.

git clone [email protected]:svizion/bonfire-snippets.git %appdata%\Sublime Text 2\Packages\bonfire-snippets

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.