当前位置: 首页>>代码示例>>PHP>>正文


PHP LogModel::save方法代码示例

本文整理汇总了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);
 }
开发者ID:oaki,项目名称:demoshop,代码行数:17,代码来源:LogPresenter.php

示例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);
 }
开发者ID:oaki,项目名称:demoshop,代码行数:75,代码来源:Admin_EShopPresenter.php


注:本文中的LogModel::save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。