Permalink
Browse files

new snippets

  • Loading branch information...
1 parent a52efdc commit e1f2bb63fb911b5b5a501b0855ee3c45ac93c853 @david-soyez committed Feb 5, 2012
Showing with 233 additions and 14 deletions.
  1. +15 −0 Package Control.sublime-settings
  2. +2 −2 yii-cache-add.sublime-snippet
  3. +1 −1 yii-cache-flush.sublime-snippet
  4. +1 −1 yii-cache-get.sublime-snippet
  5. +1 −1 yii-model-count.sublime-snippet
  6. +1 −1 yii-model-countBySql.sublime-snippet
  7. +1 −1 yii-model-deleteAll.sublime-snippet
  8. +1 −1 yii-model-deleteByPk.sublime-snippet
  9. +1 −1 yii-model-exists.sublime-snippet
  10. +1 −1 yii-model-find.sublime-snippet
  11. +1 −1 yii-model-findAll.sublime-snippet
  12. +1 −1 yii-model-findAllByAttributes.sublime-snippet
  13. +1 −1 yii-model-findAllByPk.sublime-snippet
  14. +1 −1 yii-model-findBySql.sublime-snippet
  15. +6 −0 yii-model-updateAll.sublime-snippet
  16. +6 −0 yii-model-updateByPk.sublime-snippet
  17. +6 −0 yii-normalizeUrl.sublime-snippet
  18. +6 −0 yii-openTag.sublime-snippet
  19. +6 −0 yii-params.sublime-snippet
  20. +6 −0 yii-passwordField.sublime-snippet
  21. +6 −0 yii-radioButton.sublime-snippet
  22. +6 −0 yii-radioButtonList.sublime-snippet
  23. +6 −0 yii-redirect.sublime-snippet
  24. +6 −0 yii-refresh.sublime-snippet
  25. +6 −0 yii-register-css.sublime-snippet
  26. +6 −0 yii-register-cssfile.sublime-snippet
  27. +6 −0 yii-register-script.sublime-snippet
  28. +6 −0 yii-register-scriptfile.sublime-snippet
  29. +6 −0 yii-render.sublime-snippet
  30. +6 −0 yii-renderDynamic-internal.sublime-snippet
  31. +6 −0 yii-renderDynamic.sublime-snippet
  32. +6 −0 yii-renderPartial.sublime-snippet
  33. +6 −0 yii-renderText.sublime-snippet
  34. +6 −0 yii-requestType.sublime-snippet
  35. +6 −0 yii-resetButton.sublime-snippet
  36. +6 −0 yii-script.sublime-snippet
  37. +6 −0 yii-scriptFile.sublime-snippet
  38. +6 −0 yii-session.sublime-snippet
  39. +6 −0 yii-setcache.sublime-snippet
  40. +6 −0 yii-statefullForm.sublime-snippet
  41. +6 −0 yii-submitButton.sublime-snippet
  42. +6 −0 yii-t.sublime-snippet
  43. +6 −0 yii-tag.sublime-snippet
  44. +6 −0 yii-textArea.sublime-snippet
  45. +6 −0 yii-textField.sublime-snippet
  46. +6 −0 yii-trace.sublime-snippet
  47. +6 −0 yii-user.sublime-snippet
  48. +6 −0 yii-userHostAddress.sublime-snippet
@@ -0,0 +1,15 @@
+{
+ "auto_upgrade_last_run": 1328387801,
+ "installed_packages":
+ [
+ "jQuery Snippets pack",
+ "Package Control",
+ "PhpDoc",
+ "SublimeCodeIntel",
+ "ZenCoding"
+ ],
+ "repositories":
+ [
+ "https://bitbucket.org/sublimator/sublime-2-zencoding"
+ ]
+}
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[Yii::app()->cache->add('${1:key}', ${2:value}, ${3:expire}${4:, new C$5CacheDependency($6)});$0]]></content>
- <tabTrigger>addcache</tabTrigger>
+ <tabTrigger>cad</tabTrigger>
<scope>source.php</scope>
- <description>Yii Yii::app()->cache->add</description>
+ <description>Yii Add cache</description>
</snippet>
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[Yii::app()->cache->flush();$0]]></content>
- <tabTrigger>flushcache</tabTrigger>
+ <tabTrigger>caf</tabTrigger>
<scope>source.php</scope>
<description>Yii Flush cache</description>
</snippet>
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[Yii::app()->cache->get('${1:key}');$0]]></content>
- <tabTrigger>getcache</tabTrigger>
+ <tabTrigger>cag</tabTrigger>
<scope>source.php</scope>
<description>Yii Get cache</description>
</snippet>
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[${1:ModelName}::model()->count(${2:condition}${3:, array('${4:key}'=>${5:value})})$0]]></content>
- <tabTrigger>mcount</tabTrigger>
+ <tabTrigger>countm</tabTrigger>
<scope>source.php</scope>
<description>Yii Model count</description>
</snippet>
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[${1:ModelName}::model()->countBySql(${2:sql}${3:, array('${4:key}'=>${5:value})})$0]]></content>
- <tabTrigger>mcountbs</tabTrigger>
+ <tabTrigger>countbs</tabTrigger>
<scope>source.php</scope>
<description>Yii Model countBySql</description>
</snippet>
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[${1:ModelName}::model()->deleteAll(${2:condition}${3:, array('${4:key}'=>${5:value})})$0]]></content>
- <tabTrigger>mdela</tabTrigger>
+ <tabTrigger>dela</tabTrigger>
<scope>source.php</scope>
<description>Yii Model deleteAll</description>
</snippet>
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[${1:ModelName}::model()->deleteByPk(${2:pk}, ${3:condition}${4:, array('${5:key}'=>${6:value})})$0]]></content>
- <tabTrigger>mdelbp</tabTrigger>
+ <tabTrigger>delbp</tabTrigger>
<scope>source.php</scope>
<description>Yii Model deleteByPk</description>
</snippet>
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[${1:ModelName}::model()->exists(${2:condition}${3:, array('${4:key}'=>${5:value})})$0]]></content>
- <tabTrigger>mexists</tabTrigger>
+ <tabTrigger>exists</tabTrigger>
<scope>source.php</scope>
<description>Yii Model exists</description>
</snippet>
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[${1:ModelName}::model()->find(${2:condition}${3:, array('${4:key}'=>${5:value})})$0]]></content>
- <tabTrigger>mfind</tabTrigger>
+ <tabTrigger>find</tabTrigger>
<scope>source.php</scope>
<description>Yii Model find</description>
</snippet>
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[${1:ModelName}::model()->findAll(${2:condition}${3:, array('${4:key}'=>${5:value})})$0]]></content>
- <tabTrigger>mfinda</tabTrigger>
+ <tabTrigger>finda</tabTrigger>
<scope>source.php</scope>
<description>Yii Model findAll</description>
</snippet>
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[${1:ModelName}::model()->findAllByAttributes(${2:array('${3:attributeName}'=>${4:attributeValue})}, ${5:condition}${6:, array('${7:key}'=>${8:value})})$0]]></content>
- <tabTrigger>mfindaba</tabTrigger>
+ <tabTrigger>findaba</tabTrigger>
<scope>source.php</scope>
<description>Yii Model findAllByAttributes</description>
</snippet>
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[${1:ModelName}::model()->findAllByPk(${2:pk}, ${3:condition}${4:, array('${5:key}'=>${6:value})})$0]]></content>
- <tabTrigger>mfindabp</tabTrigger>
+ <tabTrigger>findabp</tabTrigger>
<scope>source.php</scope>
<description>Yii Model findAllByPk</description>
</snippet>
@@ -1,6 +1,6 @@
<snippet>
<content><![CDATA[${1:ModelName}::model()->findBySql(${2:sql}${3:, array('${4:key}'=>${5:value})})$0]]></content>
- <tabTrigger>mfindbs</tabTrigger>
+ <tabTrigger>findbs</tabTrigger>
<scope>source.php</scope>
<description>Yii Model findBySql</description>
</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[${1:ModelName}::model()->updateAll(${2:array('attributes')}, ${3:condition}${4:, array('${5:key}'=>${6:value})})$0]]></content>
+ <tabTrigger>updatea</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii Model updateAll</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[${1:ModelName}::model()->updateByPk(${2:pk}, ${3:array('attributes')}, ${4:condition}${5:, array('${6:key}'=>${7:value})})$0]]></content>
+ <tabTrigger>updatebp</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii Model updateByPk</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[<?php echo CHtml::normalizeUrl(array('$1')); ?>$0]]></content>
+ <tabTrigger>hnurl</tabTrigger>
+ <scope>text.html</scope>
+ <description>Yii CHtml::normalizeUrl</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[<?php echo CHtml::openTag('${1:tag}'${2:, array('${3:optionName}'=>${4:optionValue})}); ?>$0]]></content>
+ <tabTrigger>hot</tabTrigger>
+ <scope>text.html</scope>
+ <description>Yii CHtml::openTag</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[Yii::app()->params['$1']$0]]></content>
+ <tabTrigger>par</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii params</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[<?php echo CHtml::passwordField('${1:name}', '${2:value}'${3:, array('${4:optionName}'=>${5:optionValue})}); ?>$0]]></content>
+ <tabTrigger>hpf</tabTrigger>
+ <scope>text</scope>
+ <description>Yii CHtml::passwordField</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[<?php echo CHtml::radioButton('${1:name}', ${2:false}${3:, array('${4:optionName}'=>${5:optionValue})}); ?>$0]]></content>
+ <tabTrigger>hrb</tabTrigger>
+ <scope>text</scope>
+ <description>Yii CHtml::radioButton</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[<?php echo CHtml::radioButtonList('${1:name}', ${2:select}, array($3)${4:, array('${5:optionName}'=>${6:optionValue})}); ?>$0]]></content>
+ <tabTrigger>hrbl</tabTrigger>
+ <scope>text</scope>
+ <description>Yii CHtml::radioButtonList</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[\$this->redirect(array('${1:controller}/${2:action}'));$0]]></content>
+ <tabTrigger>re</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii redirect</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[\$this->refresh();$0]]></content>
+ <tabTrigger>rf</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii refresh</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[Yii::app()->clientScript->registerCss('${1:id}', '$2');$0]]></content>
+ <tabTrigger>regc</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii register CSS</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[Yii::app()->clientScript->registerCssFile('$1');$0]]></content>
+ <tabTrigger>regcf</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii register CSS file</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[Yii::app()->clientScript->registerScript('${1:id}', '$2', CClientScript::POS_${3:READY});$0]]></content>
+ <tabTrigger>regs</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii register script</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[Yii::app()->clientScript->registerScriptFile('${1:scriptUrl}', CClientScript::POS_${2:END});$0]]></content>
+ <tabTrigger>regsf</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii register script file</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[\$this->render('${1:view}'${2:, array('${3:key}'=>${4:value})});$0]]></content>
+ <tabTrigger>r</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii render view</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[\$this->renderDynamic('${1:callback}', array('${2:key}'=>${3:value}));$0]]></content>
+ <tabTrigger>rdi</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii renderDynamic internal</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[\$this->renderDynamic('${1:callback}');$0]]></content>
+ <tabTrigger>rd</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii renderDynamic</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[\$this->renderPartial('${1:view}'${2:, array('${3:key}'=>${4:value})});$0]]></content>
+ <tabTrigger>rp</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii render partial</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[\$this->renderText('$1');$0]]></content>
+ <tabTrigger>rt</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii render text</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[Yii::app()->request->requestType$0]]></content>
+ <tabTrigger>reqtype</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii requestType</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[<?php echo CHtml::resetButton('${1:label}'${2:, array('${3:optionName}'=>${5:optionValue})}); ?>$0]]></content>
+ <tabTrigger>hrsb</tabTrigger>
+ <scope>text.html</scope>
+ <description>Yii CHtml::resetButton</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[<?php echo CHtml::script('${1:test}'); ?>$0]]></content>
+ <tabTrigger>hjs</tabTrigger>
+ <scope>text.html</scope>
+ <description>Yii CHtml::script</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[<?php echo CHtml::scriptFile('${1:url}'); ?>$0]]></content>
+ <tabTrigger>hjsf</tabTrigger>
+ <scope>text.html</scope>
+ <description>Yii CHtml::scriptFile</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[Yii::app()->session['$1'];$0]]></content>
+ <tabTrigger>se</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii session offset</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[Yii::app()->cache->set('${1:key}', ${2:value}, ${3:expire}${4:, new C$5CacheDependency($6)});$0]]></content>
+ <tabTrigger>cas</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii set cache</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[<?php echo CHtml::statefulForm(array('${1}'), '${2:post}'${3:, array('${4:optionName}'=>${6:optionValue})}); ?>]]></content>
+ <tabTrigger>hsform</tabTrigger>
+ <scope>text.html</scope>
+ <description>Yii CHtml::statefulForm</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[<?php echo CHtml::submitButton('${1:label}'${2:, array('${3:optionName}'=>${5:optionValue})}); ?>$0]]></content>
+ <tabTrigger>hsb</tabTrigger>
+ <scope>text.html</scope>
+ <description>Yii CHtml::resetButton</description>
+</snippet>
View
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[Yii::t('${1:category}', '${2:message}'${3:, array($4)});$0]]></content>
+ <tabTrigger>t</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii translate</description>
+</snippet>
View
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[<?php echo CHtml::tag('${1:tag}'${2:, array('${3:optionName}'=>${4:optionValue})}${5:, ${6:false}}${7:, ${8:true}}); ?>$0]]></content>
+ <tabTrigger>ht</tabTrigger>
+ <scope>text.html</scope>
+ <description>Yii CHtml::tag</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[<?php echo CHtml::textArea('${1:name}', '${2:value}'${3:, array('${4:optionName}'=>${5:optionValue})}); ?>$0]]></content>
+ <tabTrigger>hta</tabTrigger>
+ <scope>text.html</scope>
+ <description>Yii CHtml::textArea</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[<?php echo CHtml::textField('${1:name}', '${2:value}'${3:, array('${4:optionName}'=>${5:optionValue})}); ?>$0]]></content>
+ <tabTrigger>htf</tabTrigger>
+ <scope>text.html</scope>
+ <description>Yii CHtml::textField</description>
+</snippet>
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[Yii::trace('${1:msg}');$0]]></content>
+ <tabTrigger>trace</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii trace</description>
+</snippet>
View
@@ -0,0 +1,6 @@
+<snippet>
+ <content><![CDATA[Yii::app()->user->$1]]></content>
+ <tabTrigger>user</tabTrigger>
+ <scope>source.php</scope>
+ <description>Yii user-></description>
+</snippet>
Oops, something went wrong.

0 comments on commit e1f2bb6

Please sign in to comment.