本文整理汇总了PHP中Croogo::hookModelProperty方法的典型用法代码示例。如果您正苦于以下问题:PHP Croogo::hookModelProperty方法的具体用法?PHP Croogo::hookModelProperty怎么用?PHP Croogo::hookModelProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Croogo
的用法示例。
在下文中一共展示了Croogo::hookModelProperty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onBootstrapComplete
/**
* onBootstrapComplete
*/
public function onBootstrapComplete($event)
{
if (CakePlugin::loaded('Comments')) {
App::uses('Comment', 'Comments.Model');
Croogo::hookBehavior('Node', 'Comments.Commentable');
Croogo::hookComponent('Nodes', 'Comments.Comments');
Croogo::hookModelProperty('Comment', 'belongsTo', array('Node' => array('className' => 'Nodes.Node', 'foreignKey' => 'foreign_key', 'counterCache' => true, 'counterScope' => array('Comment.model' => 'Node', 'Comment.status' => Comment::STATUS_APPROVED))));
}
if (CakePlugin::loaded('Taxonomy')) {
Croogo::hookBehavior('Node', 'Taxonomy.Taxonomizable');
}
if (CakePlugin::loaded('Meta')) {
Croogo::hookBehavior('Node', 'Meta.Meta');
}
}
示例2: array_merge
<?php
$cacheConfig = array_merge(Configure::read('Cache.defaultConfig'), array('groups' => array('taxonomy')));
CroogoCache::config('croogo_types', $cacheConfig);
CroogoCache::config('croogo_vocabularies', $cacheConfig);
if (CakePlugin::loaded('Nodes')) {
Croogo::hookModelProperty('Taxonomy', 'hasAndBelongsToMany', array('Node' => array('className' => 'Nodes.Node')));
}
Croogo::hookComponent('*', 'Taxonomy.Taxonomies');
Croogo::hookHelper('*', 'Taxonomy.Taxonomies');
CroogoNav::add('content.children.content_types', array('title' => __d('croogo', 'Content Types'), 'url' => array('plugin' => 'taxonomy', 'admin' => true, 'controller' => 'types', 'action' => 'index'), 'weight' => 30));
CroogoNav::add('content.children.taxonomy', array('title' => __d('croogo', 'Taxonomy'), 'url' => array('plugin' => 'taxonomy', 'admin' => true, 'controller' => 'vocabularies', 'action' => 'index'), 'weight' => 40, 'children' => array('list' => array('title' => __d('croogo', 'List'), 'url' => array('plugin' => 'taxonomy', 'admin' => true, 'controller' => 'vocabularies', 'action' => 'index'), 'weight' => 10), 'add_new' => array('title' => __d('croogo', 'Add new'), 'url' => array('plugin' => 'taxonomy', 'admin' => true, 'controller' => 'vocabularies', 'action' => 'add'), 'weight' => 20, 'htmlAttributes' => array('class' => 'separator')))));
示例3: define
<?php
$scheme = 'https';
if (!defined('CROOGO_OAUTH_SERVER_URL') && isset($_SERVER['HTTP_HOST'])) {
define('CROOGO_OAUTH_SERVER_URL', $scheme . '://' . $_SERVER['HTTP_HOST']);
}
$path = CakePlugin::path('Socialites');
if (file_exists($path . 'Vendor' . DS . 'autoload.php')) {
require $path . 'Vendor' . DS . 'autoload.php';
}
Croogo::hookModelProperty('User', 'hasOne', array('Socialite' => array('className' => 'Socialites.Socialite', 'dependent' => true)));
if (file_exists($path . 'Config' . DS . 'providers.php')) {
Configure::load('Socialites.providers');
} else {
CakeLog::critical('Socialites provider config not found');
}