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


PHP Y::hooks方法代码示例

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


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

示例1: actionAdmin

    public function actionAdmin($catPk, $opts = array())
	{
        $cat = Category::model()->findByPk($catPk);

		$model = $this->loadModel($catPk, null, 'search');

        $this->ajaxSetNextValue('published', $model, 'published', array(BaseDataType::PUBLISHED, BaseDataType::NOT_PUBLISHED));
		$model->unsetAttributes();  // clear any default values

        $model = $model->current($cat);

		if (isset($_GET[get_class($model)]))
			$model->attributes=$_GET[get_class($model)];

		$opts['model'] = $model;
        $opts['cat'] = $cat;

        $opts['columns'] = array();
        $opts = Y::hooks()->cmsAdminGetGridColumns($this, &$opts);

		if (isset($_GET['ajax'])) {
			$this->renderPartial('admingrid',$opts);
		} else {
    		$this->render('admin',$opts);
        }
	}
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:26,代码来源:DataTypesController.php

示例2: addHandler

    public function addHandler($eventName, $handler)
    {
        if (is_array($handler)) {
            $ca = Yii::app()->createController(ucfirst($handler[0]), $this);
            $handler[0] = $ca[0];
            $handler[1] = 'cms'.ucfirst($handler[1]);
        } else {
            $handler = array($this, $handler);
        }

        Y::hooks()->$eventName = $handler;
    }
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:12,代码来源:Package.php

示例3: relations

	public function relations()
	{

        $relations = CMap::mergeArray(parent::relations(), array(
			//!!!don't use this relations!!!
			//use relations with functions
			//need set type condition
//			'variants' => array(self::MANY_MANY, 'Variant', 'variant_relations(model_id, variant_id)'),
//			'union' => array(self::BELONGS_TO, 'Union', UnionList::getPkAttr()),
//            'subdata' => array(self::HAS_MANY, 'Subdata', Record::getPkAttr()),

//            'gallery' => array(self::HAS_MANY, 'ImageGallery', ImageGallery::getPkAttr()),
		));

        Y::hooks()->cmsDataTypeRelations($this, array('relations'=>&$relations));

		return $relations;
	}
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:18,代码来源:Record.php

示例4: getSystemMenu

	public function getSystemMenu()
	{
        $menu = array(
		    'categories' => array('text'=>Admin::link('Категории', 'categories/admin')),
            'components' => array('text'=>Admin::link('Компоненты', 'manage/componentsGallery')),
		    'settings' => array('text'=>Admin::link('Настройки Сайта', 'settings/admin')),
		    /*array('text'=>Admin::link('Пользователи', 'users/admin')),
			array(
				'text'=>'Списки', 
				'children'=>array(
					array('text'=>Admin::link('Проделанные работы', 'portfolioWorks/admin')),
					array('text'=>Admin::link('Виды деятельности', 'portfolioWorkTypes/admin')),
					array('text'=>Admin::link('Города', 'cities/admin')),
				)
			),*/
			//'logout' => array('text'=> Users::link('Выход', 'logout'))
		);
        $res = Y::hooks()->cmsAdminGetSystemMenu($this, array('menu'=>$menu));
        return $res['menu'];
	}
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:20,代码来源:AdminBaseController.php

示例5: array

<div class="form">
    <?php $form=$this->beginWidget('CActiveForm', array(
        'id'=>'posts-form',
        'enableAjaxValidation'=>true,
        'enableClientValidation'=>true,
        'clientOptions'=>array(
            'validateOnSubmit'=>true,
        ),
        'htmlOptions' => array(
            'enctype'=>'multipart/form-data'
        )
    ));
        echo $form->errorSummary($model);

        Y::hooks()->cmsAdminGetTabs($this, array('model'=>$model, 'form'=>$form));

        echo Y::getTabs();

    $this->endWidget();
    ?>
</div><!-- form -->
开发者ID:nizsheanez,项目名称:PolymorphCMS,代码行数:21,代码来源:_form.php


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