當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。