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


PHP Manufacturer::model方法代码示例

本文整理汇总了PHP中Manufacturer::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Manufacturer::model方法的具体用法?PHP Manufacturer::model怎么用?PHP Manufacturer::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Manufacturer的用法示例。


在下文中一共展示了Manufacturer::model方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 public function run()
 {
     $inn = false;
     $cat = Category::model()->with('categoryDescriptions')->find('categoryDescriptions.link=:link', array(':link' => $this->current));
     if (!empty($cat)) {
         $catName = $cat->getName();
         $categories = $cat->categories;
         if (empty($categories)) {
             $categories = array($cat);
             $inn = true;
         }
         //echo print_r($categories);
     } else {
         $catName = 'All';
         $categories = Category::model()->findAll();
     }
     $products = array();
     $nbrands = $brands = array();
     foreach ($categories as $category) {
         $products = array_merge($products, $category->products);
     }
     foreach ($products as $product) {
         $nbrands[] = $product->manufacturer_id;
     }
     $nbrands = array_unique($nbrands, SORT_NUMERIC);
     foreach ($nbrands as $nbrand) {
         $manu = Manufacturer::model()->findByPk($nbrand);
         if (!empty($manu)) {
             $brands[$nbrand] = $manu->name;
         }
     }
     //$brands = asort($brands);
     $this->render('category_navigation', array('inn' => $inn, 'cat' => $cat, 'name' => $catName, 'categories' => $categories, 'products' => $products, 'brands' => $brands, 'current' => $this->current));
 }
开发者ID:Rudianasaja,项目名称:cycommerce,代码行数:34,代码来源:CategoryNavigation.php

示例2: loadModel

 public function loadModel($id)
 {
     $model = Manufacturer::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
开发者ID:tierous,项目名称:yiirisma,代码行数:8,代码来源:ManufacturerController.php

示例3: actionAutocomplete

 public function actionAutocomplete($query)
 {
     $json = array();
     $manufacturers = Manufacturer::model()->findAll("name LIKE '%{$query}%' ");
     foreach ($manufacturers as $manufacturer) {
         $json[] = array('id' => $manufacturer->manufacturer_id, 'value' => $manufacturer->name);
     }
     echo CJSON::encode($json);
 }
开发者ID:damnpoet,项目名称:yiicart,代码行数:9,代码来源:ManufacturersController.php

示例4: save

 public function save()
 {
     $manufacturer = Manufacturer::model()->findByPk($this->id);
     if (is_null($manufacturer)) {
         // is insert
         $manufacturer = new Manufacturer();
     }
     $manufacturer->name = $this->name;
     $manufacturer->image = $this->image;
     $manufacturer->sort_order = $this->sortOrder;
     $manufacturer->save();
     // SEO Keyword
     $manufacturer->updateSEOKeyword($this->seoKeyword);
     // Stores
     $manufacturer->clearAllStoresRelations();
     if (isset($this->stores) && count($this->stores)) {
         foreach ($this->stores as $storeId) {
             $manufacturer->addToStore($storeId);
         }
     }
 }
开发者ID:damnpoet,项目名称:yiicart,代码行数:21,代码来源:ManufacturerForm.php

示例5: array

echo $form->labelEx($model, 'category_id');
?>
		<?php 
echo $form->dropDownList($model, 'category_id', CHtml::listData(Category::model()->findAll(), 'category_id', 'category_name'), array('empty' => '--please select--'));
?>
		<?php 
echo $form->error($model, 'category_id');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'manufacturer_id');
?>
		<?php 
echo $form->dropDownList($model, 'manufacturer_id', CHtml::listData(Manufacturer::model()->findAll(), 'manufacturer_id', 'manufacturer_name'), array('empty' => '--please select--'));
?>
		<?php 
echo $form->error($model, 'manufacturer_id');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'product_name');
?>
		<?php 
echo $form->textField($model, 'product_name', array('size' => 60, 'maxlength' => 64));
?>
		<?php 
echo $form->error($model, 'product_name');
开发者ID:tierous,项目名称:yico-commerce,代码行数:31,代码来源:_form.php

示例6: array

?>
</div>
		            <div class="span3"><?php 
echo $form->dropDownList($model, 'status_id', CHtml::listData(Status::model()->findAll(), 'id', 'status'), array('span' => 2, 'prompt' => '---'));
?>
		            <?php 
echo CHtml::ajaxLink(Yii::t('status', TbHtml::button('+', array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'size' => TbHtml::BUTTON_SIZE_DEFAULT))), $this->createUrl('status/addnew'), array('onclick' => '$("#divDialog2").dialog("open"); return false;', 'update' => '#divDialog2'), array('id' => uniqid()));
?>
					        <div id="divDialog2"></div>
					</div>
		            <div class="span2"><?php 
echo $form->labelEx($model, 'manufacturer_id', array('class' => 'inline-labels'));
?>
</div>
		            <div class="span3"><?php 
echo $form->dropDownList($model, 'manufacturer_id', CHtml::listData(Manufacturer::model()->findAll(), 'id', 'name'), array('span' => 2, 'prompt' => '---'));
?>
		            <?php 
echo CHtml::ajaxLink(Yii::t('manufacturer', TbHtml::button('+', array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'size' => TbHtml::BUTTON_SIZE_DEFAULT))), $this->createUrl('manufacturer/addnew'), array('onclick' => '$("#divDialog4").dialog("open"); return false;', 'update' => '#divDialog4'), array('id' => uniqid()));
?>
					        <div id="divDialog4"></div>
		            </div>
	        	</div>
	        </div>      
        </tr>
        <tr>
        <div class="row">
	    	<div class="col-md-3 col-sm-6">
            	<div class="span2"><?php 
echo $form->labelEx($model, 'printer_type_id', array('class' => 'inline-labels'));
?>
开发者ID:anjanababu,项目名称:Asset-Management,代码行数:31,代码来源:_form.php

示例7: actionManufacturer

 public function actionManufacturer()
 {
     $criteria = new CDbCriteria();
     $criteria->addCondition("t.active=1");
     $criteria->addCondition("t.delete=0");
     $criteria->order = "t.order, t.id DESC";
     $manufacturer = null;
     if (isset($_GET['manufacturer'])) {
         //$criteria->addCondition("t.productCategories=".$_GET['category']);
         //$categories=ProductCategories::model()->findByPk($_GET['category']);
         $manufacturer = Manufacturer::model()->findByAttributes(array('non_utf8_name' => $_GET['manufacturer']));
         if ($manufacturer === null || $manufacturer->active == 0 || $manufacturer->delete == 1) {
             throw new CHttpException(404, 'Địa chỉ bạn yêu cầu không tồn tại.');
         }
         $criteria->addCondition("t.manufacturer=" . $manufacturer->id);
     }
     $count = Product::model()->count($criteria);
     $pages = new CPagination($count);
     // results per page
     $pages->pageSize = Config::model()->getValueByKey('rowsperpageproduct');
     $pages->applyLimit($criteria);
     $models = Product::model()->findAll($criteria);
     //$pageTitle = Yii::t('site', 'AllProducts');
     $pageTitle = 'Tất cả sản phẩm';
     $metaDescription = Config::model()->getValueByKey('metadescription');
     $metaKeywords = Config::model()->getValueByKey('metakeywords');
     if (isset($manufacturer)) {
         $pageTitle = $manufacturer->name;
         $metaDescription = $manufacturer->metadescription;
         $metaKeywords = $manufacturer->metakeywords;
     }
     $this->pageTitle = $pageTitle . ' - ' . Config::model()->getValueByKey('sitetitle');
     $this->metaDescription = $metaDescription;
     $this->metaKeywords = $metaKeywords;
     $this->render('products', array('products' => $models, 'categories' => $manufacturer, 'pages' => $pages));
 }
开发者ID:phantsang,项目名称:xzsUuJg0keDWW5Rx679PHBVBJ,代码行数:36,代码来源:SiteController.php

示例8: getDropdown

 public function getDropdown()
 {
     global $dataDropdown;
     $dataDropdown = array();
     $parents = Manufacturer::model()->with('levelTop')->findALl();
     foreach ($parents as $parent) {
         $dataDropdown[$parent->id] = $parent->name;
         $this->_subDropDown($parent->childCategories);
     }
     return $dataDropdown;
 }
开发者ID:phantsang,项目名称:xzsUuJg0keDWW5Rx679PHBVBJ,代码行数:11,代码来源:Manufacturer.php

示例9: array

<?php

$this->breadcrumbs = array('Products' => array('index'), 'Manage');
$this->menu = array(array('label' => 'List Product', 'url' => array('index')), array('label' => 'Create Product', 'url' => array('create')));
$this->title = 'Manage Products';
?>

<!-- <h1>Manage Products</h1> -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'product-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('product_id', array('name' => 'category_id', 'type' => 'html', 'value' => '$data->category->category_name', 'sortable' => TRUE, 'filter' => CHtml::listData(Category::model()->findAll(), 'category_id', 'category_name')), array('name' => 'manufacturer_id', 'type' => 'html', 'value' => '$data->manufacturer->manufacturer_name', 'sortable' => TRUE, 'filter' => CHtml::listData(Manufacturer::model()->findAll(), 'manufacturer_id', 'manufacturer_name')), 'product_name', 'product_model', 'product_price', array('class' => 'CButtonColumn', 'template' => '{update}&nbsp;&nbsp;{delete}'))));
开发者ID:tierous,项目名称:yiirisma,代码行数:11,代码来源:admin.php

示例10: array

<?php 
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'related-form', 'enableAjaxValidation' => false));
?>

	<?php 
echo $form->errorSummary($model);
?>
	
	<div class="row">
		<?php 
echo $form->labelEx($model, 'manufacturer_id');
?>
		
        <?php 
echo CHtml::activeDropDownList($model, 'manufacturer_id', CHtml::listData(Manufacturer::model()->findAll(), 'id', 'name'));
?>
        <?php 
echo $form->error($model, 'manufacturer_id');
?>
    </div>
	
	<div class="row">
		<?php 
echo $form->labelEx($model, 'categories');
?>
		
        <?php 
echo CHtml::activeListBox($model, 'categories', CHtml::listData(Category::model()->findAll(), 'id', function ($data) {
    return $data->getName();
}), array('multiple' => 'multiple'));
开发者ID:Rudianasaja,项目名称:cycommerce,代码行数:30,代码来源:_related.php


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