Skip to content

Instantly share code, notes, and snippets.

@rootbear
rootbear / remove-last-row-from-table.html
Created August 2, 2012 15:17
Javascript: Remove Last Row from Table
<html>
<head>
<title>remove last row from a table</title>
<script language="JavaScript" type="text/javascript">
<!--
var rws;
function RemoveRow(obj){
obj=document.getElementById(obj);
rws=obj.getElementsByTagName('TR');
obj.removeChild(rws[rws.length-1]);
@rootbear
rootbear / TestModule.php
Last active December 22, 2015 09:58
yii: specify per module theme
<?php
class TestModule extends CWebModule
{
public function init()
{
$this->setImport(array(
'tmp.models.*',
'tmp.components.*',
));
@rootbear
rootbear / view.php
Created September 5, 2013 20:20
Name of current module controller or action from Yii view
<?php
// Module
if(isset($this->module)): echo $this->module->getName(); endif;
// Controller
echo $this->ID;
// Action
echo $this->action->id;
?>
@rootbear
rootbear / linux-commands
Created September 6, 2013 01:33
linux commands
tar -xzf yii-1.1.14.f0fee9.tar.gz
@rootbear
rootbear / config_main.php
Last active December 22, 2015 11:59
Access to other modules
<?php
//config 3rd party component
'components'=>array(
...
'mailer'=>array(
'class'=>'application.extensions.mailer.EMailer',
'Mailer'=>'smtp',
'Host'=>'yourhost',
'SMTPAuth'=>true,
'Username'=>'smtpuser',