本文整理汇总了PHP中LogModel::save方法的典型用法代码示例。如果您正苦于以下问题:PHP LogModel::save方法的具体用法?PHP LogModel::save怎么用?PHP LogModel::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogModel
的用法示例。
在下文中一共展示了LogModel::save方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createComponentBasicTabella
protected function createComponentBasicTabella($name)
{
// asi nepotřebuje komentář :-)
$model = new LogModel();
$grid = new Tabella($model->getDataSource(), array('sorting' => 'id_log', 'order' => 'id_log', "onSubmit" => function ($post) {
print_r($post);
LogModel::save($post, $post['id_log']);
}));
$grid->addColumn("id_log", "id_log", array("width" => 30));
$grid->addColumn("name_modul", "name_modul", array("width" => 100, "editable" => true));
$grid->addColumn("description", "description", array("width" => 100));
$grid->addColumn("value", "value", array("width" => 100));
$grid->addColumn("query", "query", array("width" => 100));
$grid->addColumn("date", "date", array("width" => 100));
$grid->addColumn("ip", "ip", array("width" => 100));
$this->addComponent($grid, $name);
}
示例2: createComponentProductTabella
protected function createComponentProductTabella($name)
{
// ProductModel::repairAllProductSequence();
$id_category = $this->getParam('id_category');
$fluent = ProductModel::getFluent()->orderBy('product_sequence');
if ($id_category) {
$fluent->where('id_category = %i', $id_category);
} else {
$fluent->groupBy('id_product');
}
$datasource = $fluent->toDatasource();
$grid = new Tabella($datasource, array('sorting' => 'product_sequence', 'order' => 'product_sequence', 'limit' => 400, "onSuccess" => function ($post) {
LogModel::save($post, $post['id_log']);
}));
$grid->addColumn("Názov", "name", array("width" => 300, "editable" => false));
$grid->addColumn("Cena", "min_price", array("width" => 100, "editable" => false));
$_active = array('' => '', 0 => 'Zakázaný', 1 => 'Povolený');
$grid->addColumn("Akcia", "sale", array("width" => 100, 'type' => Tabella::SELECT, "filter" => array('' => '', 0 => 'nie', 1 => 'áno'), "options" => NULL, "renderer" => function ($row) {
$el = NHtml::el("td");
$pom = array('' => '', 0 => 'nie', 1 => 'áno');
return $el->add($pom[$row['sale']]);
}));
$grid->addColumn("Najpredá.", "our_tip", array("width" => 100, 'type' => Tabella::SELECT, "filter" => array('' => '', 0 => 'nie', 1 => 'áno'), "options" => NULL, "renderer" => function ($row) {
$el = NHtml::el("td");
$pom = array('' => '', 0 => 'nie', 1 => 'áno');
return $el->add($pom[$row['our_tip']]);
}));
$grid->addColumn("_", "active", array("width" => 100, 'type' => Tabella::SELECT, "filter" => $_active, "options" => '', "editable" => false, "renderer" => function ($row) use($_active) {
$el = NHtml::el("td");
// print_r($row);exit;
/*
* link na zmazanie produktu
*/
$el->add(NHtml::el('a')->href(NEnvironment::getApplication()->getPresenter()->link('deleteProduct!', array('id' => $row->id_product)))->addClass('deleteIcon ajax')->title('Naozaj chcete zmazať položku?'));
/*
* link na editaciu produktu
*/
$el->add(NHtml::el('a')->href(NEnvironment::getApplication()->getPresenter()->link('Product:edit', array('id' => $row->id_product)))->addClass('editIcon'));
/*
* posuvanie - ak sa spusti posubanie, treba vypnut zoradovanie !!! order=>false
*/
// $el->add(
// NHtml::el( 'a' )->href('#')->addClass( 'moveIcon' )
// ->addId( 'index_'.$row['id_product'] )
// );
/*
* ikona aktivan polozka, neaktivan polozka
*/
$span = NHtml::el('span');
if ($row->active) {
$span->addClass('activeIcon active');
} else {
$span->addClass('unactiveIcon active ');
}
$el->add($span);
return $el;
}));
//
// $grid->addColumn( "", "id_product",
// array( "width" => 55,
// 'filter'=>null,
// 'order'=>false,
// "renderer" => function( $row ) {
//
// return NHtml::el( "td" )->add(
// NHtml::el( 'a' )->href(
// NEnvironment::getApplication()->getPresenter()->link( 'Product:edit' , array('id'=>$row->id_product))
// )
// ->addClass( 'editIcon' )
// );
//
// })
// );
$this->addComponent($grid, $name);
}