本文整理汇总了PHP中C_Component类的典型用法代码示例。如果您正苦于以下问题:PHP C_Component类的具体用法?PHP C_Component怎么用?PHP C_Component使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了C_Component类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
/**
* Apply adapters registered for the component
* @param C_Component $component
* @return C_Component
*/
function &apply_adapters(C_Component &$component)
{
// Iterate through each adapted interface. If the component implements
// the interface, then apply the adapters
foreach ($this->_adapters as $interface => $contexts) {
if ($component->implements_interface($interface)) {
// Determine what context apply to the current component
$applied_contexts = array('all');
if ($component->context) {
$applied_contexts[] = $component->context;
$applied_contexts = $this->_flatten_array($applied_contexts);
}
// Iterate through each of the components contexts and apply the
// registered adapters
foreach ($applied_contexts as $context) {
if (isset($contexts[$context])) {
foreach ($contexts[$context] as $adapter) {
$component->add_mixin($adapter, TRUE);
}
}
}
}
}
return $component;
}
示例2: initialize
/**
* Initialize the view with some parameters
* @param array $params
* @param context $context
*/
function initialize($template, $params = array(), $engine = 'php', $context = FALSE)
{
parent::initialize($context);
$this->_template = $template;
$this->_params = (array) $params;
$this->_engine = $engine;
}
示例3: define
function define($context = FALSE)
{
parent::define($context);
$this->implement('I_Security_Manager');
$this->add_mixin('Mixin_Security_Manager');
$this->add_mixin('Mixin_Security_Manager_Request');
}
示例4: define
function define($context = FALSE)
{
parent::define($context);
$this->add_mixin('Mixin_MVC_Controller_Defaults');
$this->add_mixin('Mixin_MVC_Controller_Instance_Methods');
$this->implement('I_MVC_Controller');
}
示例5: initialize
/**
* Creates a new entity for the specified mapper
* @param C_DataMapper_Driver_Base $mapper
* @param array|stdClass $properties
* @param string $context
*/
function initialize($mapper = NULL, $properties = FALSE)
{
$this->_mapper = $mapper;
$this->_stdObject = $properties ? (object) $properties : new stdClass();
parent::initialize();
$this->set_defaults();
}
示例6:
function __call($method, $args)
{
if (!$this->get_mixin_providing($method)) {
return call_user_func_array(array(&$this->wrapper, $method), $args);
} else {
return parent::__call($method, $args);
}
}
示例7:
/**
* Gets the url or path of an image of a particular size
* @param string $method
* @param array $args
*/
function __call($method, $args)
{
if (preg_match("/^get_(\\w+)_(abspath|url|dimensions|html|size_params)\$/", $method, $match)) {
if (isset($match[1]) && isset($match[2]) && !$this->has_method($method)) {
$method = 'get_image_' . $match[2];
$args[] = $match[1];
// array($image, $size)
return parent::__call($method, $args);
}
}
return parent::__call($method, $args);
}
示例8: define
/**
* Defines the module
*/
function define($id = 'pope-module', $name = 'Pope Module', $description = '', $version = '', $uri = '', $author = '', $author_uri = '', $context = FALSE)
{
parent::define($context);
$this->implement('I_Pope_Module');
$this->module_id = $id;
$this->module_name = $name;
$this->module_description = $description;
$this->module_version = $version;
$this->module_uri = $uri;
$this->module_author = $author;
$this->module_author_uri = $author_uri;
$this->get_registry()->add_module($this->module_id, $this);
$this->_register_utilities();
$this->_register_adapters();
$this->_register_hooks();
}
示例9: initialize
/**
* Creates a new entity for the specified mapper
* @param C_DataMapper_Driver_Base $mapper
* @param array|stdClass $properties
* @param string $context
*/
function initialize($mapper = NULL, $properties = FALSE)
{
$this->_mapper = $mapper;
$this->_stdObject = $properties ? (object) $properties : new stdClass();
parent::initialize();
if (!$this->has_default_values()) {
$this->set_defaults();
$this->_stdObject->__defaults_set = TRUE;
}
}
示例10: define
function define($context = false)
{
parent::define($context);
$this->implement('I_NextGen_API_XMLRPC');
}
示例11: define
function define($context = FALSE)
{
parent::define($context);
$this->add_mixin('Mixin_Cache');
$this->implement('I_Cache');
}
示例12: define
/**
* Defines the object
* @param bool $context
*/
function define($context = FALSE)
{
parent::define($context);
$this->add_mixin('Mixin_Displayed_Gallery_Renderer');
$this->implement('I_Displayed_Gallery_Renderer');
}
示例13: initialize
function initialize()
{
parent::initialize();
$this->_request_method = $_SERVER['REQUEST_METHOD'];
}
示例14: define
public function define($context = FALSE)
{
parent::define($context);
$this->implement('I_Dynamic_Thumbnails_Manager');
$this->add_mixin('Mixin_Dynamic_Thumbnails_Manager');
}
示例15: initialize
function initialize()
{
parent::initialize();
$this->lookup_columns();
}