Initialize pagination config
@param array $config
763892
public function init($config)
    {
        // init init error
        //default
        $this->config['per_page']       = 10;
        $this->config['item_to_show']   = 2;
        $this->config['skip_item']      = true;
        
        $this->config['first_tag_open'] = "<li>";
        $this->config['first_tag_close']= "</li>";
        
        $this->config['last_tag_open']  = "<li>";
        $this->config['last_tag_close'] = "</li>";
        
        $this->config['prev_tag_open']  = "<li>";
        $this->config['prev_tag_close'] = "</li>";
        $this->config['prev_tag_text']  = "Prev";
        
        $this->config['next_tag_open']  = "<li>";
        $this->config['next_tag_close'] = "</li>";
        $this->config['next_tag_text']  = "Next";
        
        $this->config['cur_tag_open']   = "<li class='active'>";
        $this->config['cur_tag_close']  = "</li>";

        $this->config['link_attribute'] = "class=''";
        $this->config['link_attribute_active'] = "class='active'";
        
        $this->config['num_tag_open']   = "<li>";
        $this->config['num_tag_close']  = "</li>";

        $this->config['skip_tag_open']  = "<li>";
        $this->config['skip_tag_close'] = "</li>";
        $this->config['skip_tag_text']  = "<a href='#'>....</a>";
        $this->config['start_page']     = 0;

        //merge options
        foreach ($config as $key => $value) {
            $this->config[$key]=$value;
        }
        if($this->config['item_to_show']<2)
            $this->config['item_to_show']=2;

        $this->total = intval($config['rows']);
        $this->per_page = intval($config['per_page']);
        $this->current_page = intval($config['current_page']) ;
        $this->base_url = urldecode($config['base_url']);
    }
1064747
protected function _initialize(ObjectConfig $config)
    {
        $config->append(array(
            'users' => array($this->getObject('user')),
        ));

        parent::_initialize($config);
    }
1082635
public function initialize(array $config)
    {
        $table = Configure::check('CakephpBlueimpUpload.upload_table') ? Configure::read('CakephpBlueimpUpload.upload_table') : 'uploads';

        $this->setTable($table);
        $this->setDisplayField('id');
        $this->setPrimaryKey('id');
        $this->addBehavior('Timestamp');
        $this->addBehavior('Alaxos.UserLink');
    }
878392
protected function initializeConfig(array $config = null)
    {
        $default = $this->defaultConfigurations();

        $this->config = $config ? array_replace_recursive($default, $config) : $default;
    }
469559
public function initialize(array $config) {
		$controller = $this->_registry->getController();
		$this->setEventManager($controller->getEventManager());

		$this->Captchas = $controller->Captchas;
	}
50265
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->setTable('tags');
        $this->setDisplayField('tag');
        $this->setPrimaryKey('id');

        $this->belongsToMany('Posts', ['className' => 'MeCms.Posts', 'joinTable' => 'posts_tags'])
            ->setForeignKey('tag_id')
            ->setTargetForeignKey('post_id')
            ->setThrough('MeCms.PostsTags');

        $this->addBehavior('Timestamp');

        $this->_validatorClass = TagValidator::class;
    }
671960
public function initialize(array $config = []) {
		if (empty($this->_config['fields'])) {
			$schema = $this->getTable()->getSchema();

			$fields = [];
			foreach ($schema->columns() as $field) {
				$v = $schema->getColumn($field);
				if (!in_array($v['type'], ['string', 'text'])) {
					continue;
				}
				if (!empty($v['key'])) {
					continue;
				}
				if (isset($v['length']) && $v['length'] === 1) { // TODO: also skip UUID (lenght 36)?
					continue;
				}
				$fields[] = $field;
			}
			$this->_config['fields'] = $fields;
		}
		if ($this->_config['mergeQuotes'] === true) {
			$this->_config['mergeQuotes'] = '"';
		}
	}
493024
private function init($config = array())
    {
        $this->getCore()->open($this->getFilename(), $config);
        if ($this->currentSheet !== null) {
            $this->getCore()->setSheet($this->currentSheet);
        }
    }
592682
public function initialize(array $config)
    {
        parent::initialize($config);

        if (isset($config['emptyValues'])) {
            $this->setConfig('emptyValues', $config['emptyValues'], false);
        }

        $collectionClass = $this->getConfig('collectionClass');
        if ($collectionClass) {
            $this->_collectionClass = $collectionClass;

            return;
        }

        $defaultCollectionClass = sprintf(
            '%s\Model\Filter\%sCollection',
            Configure::read('App.namespace'),
            $this->getTable()->getAlias()
        );
        if (class_exists($defaultCollectionClass)) {
            $this->_collectionClass = $defaultCollectionClass;
        }
    }
715199
public function initialize(array $config)
    {
        $controller = $this->_registry->getController();
        $this->request = $controller->request;
        $this->response = $controller->response;
        $this->session = $controller->request->session();

        $this->eventManager($controller->eventManager());
        $this->eventManager()->dispatch(new Event('Guardian.getGuestActions', $this));

        if (!self::$_instance) {
            self::$_instance = &$this;
        }
    }
316406
public function initialize(array $config)
    {
        $corePath  = Plugin::path('Core') . Configure::read('App.webroot') . '/' . Configure::read('App.lessBaseUrl');
        $cachePath = WWW_ROOT . Configure::read('App.cssBaseUrl') . Configure::read('App.cacheDir');

        $this
            ->setConfig('root_path', APP_ROOT)
            ->setConfig('cache_path', $cachePath)
            ->setConfig('root_url', Router::fullBaseUrl())
            ->setConfig('debug', Configure::read('debug'))
            ->setConfig('import_paths', [realpath($corePath) => realpath($corePath)]);

        parent::initialize($config);
    }
213875
protected function initialize(array $config = [])
    {
        // Create a resolve and configure the defaults
        $resolver = new OptionsResolver();
        $this->configureDefaults($resolver);

        try
        {
            // Parse the config in avanzu_admin_theme.options as array object in avanzu_admin_context.options
            $newConfig = $resolver->resolve($config);
            // Change the internal storage array in the ArrayObject
            $this->exchangeArray($newConfig);
        }
        catch(UndefinedOptionsException $e)
        {
            echo $e->getMessage() . PHP_EOL;
            print_r($config, TRUE);
        }
    }
825028
public function pagination($config = array())
    {
        $config = new KObjectConfigJson($config);
        $config->append(array(
            'total'      => 0,
            'display'    => 2,
            'offset'     => 0,
            'limit'      => 0,
            'show_limit' => true,
            'show_count' => false
        ))->append(array(
            'show_pages' => $config->count !== 1
        ));

        $this->_initialize($config);

        $html = '<div class="k-pagination">';

        if($config->show_limit) {
            $html .= '<div class="k-pagination__limit">'.$this->limit($config).'</div>';
        }

        if ($config->show_pages)
        {
            $html .= '<ul class="k-pagination__pages">';
            $html .=  $this->_pages($this->_items($config));
            $html .= '</ul>';
        }

        if($config->show_count)
        {
            $current = '<strong class="page-current">'.$config->current.'</strong>';
            $total   = '<strong class="page-total">'.$config->count.'</strong>';

            $html .= '<div class="k-pagination-pages">';
            $html .= sprintf($this->getObject('translator')->translate('Page %s of %s'), $current, $total);
            $html .= '</div>';
        }

        $html .= '</div>';

        return $html;
    }
432678
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->setTable('banners_positions');
        $this->setDisplayField('title');
        $this->setPrimaryKey('id');

        $this->hasMany('Banners', ['className' => 'MeCms.Banners'])
            ->setForeignKey('position_id');

        $this->addBehavior('Timestamp');

        $this->_validatorClass = BannersPositionValidator::class;
    }
998487
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->table('profiles');
        $this->displayField('name');
        $this->primaryKey('id');

        $this->belongsTo('Users', [
            'foreignKey' => 'user_id',
            'joinType' => 'INNER',
            'className' => 'CakeAuth.Users'
        ]);
    }
72883
public function initTasks(array $config)
    {
        foreach ($config as $taskName => $taskConfig) {
            $this->initTask($taskName, $taskConfig);
        }
    }
197528
public function initialize(array $config)
    {
        parent::initialize($config);

        $this->dir     = Configure::read('Cms.docDir');
        $this->locale  = Configure::read('App.defaultLocale');
        $this->charset = Str::low(Configure::read('App.encoding'));
        $this->eol     = (Configure::read('debug')) ? PHP_EOL : '';
        $this->tab     = (Configure::read('debug')) ? Configure::read('Cms.lineTab') : '';
    }