本文整理汇总了PHP中Solar_Base类的典型用法代码示例。如果您正苦于以下问题:PHP Solar_Base类的具体用法?PHP Solar_Base怎么用?PHP Solar_Base使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Solar_Base类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _postConstruct
/**
*
* Post-construction tasks to complete object construction.
*
* @return void
*
*/
protected function _postConstruct()
{
parent::_postConstruct();
if (!empty($this->_config['events'])) {
$this->setEvents($this->_config['events']);
}
}
示例2: _postConstruct
/**
*
* Post-construction tasks to complete object construction.
*
* @return void
*
*/
protected function _postConstruct()
{
parent::_postConstruct();
// inflection dependency
$this->_inflect = Solar::dependency('Solar_Inflect', 'inflect');
// model stack
$this->_setStack($this->_config['classes']);
}
示例3: _postConfig
/**
*
* Modifies $this->_config after it has been built.
*
* @return void
*
*/
protected function _postConfig()
{
parent::_postConfig();
if (empty($this->_config['output'])) {
$mode = PHP_SAPI == 'cli' ? 'text' : 'html';
$this->_config['output'] = $mode;
}
}
示例4: _postConstruct
/**
* _postConstruct
*
* @param $model
*/
protected function _postConstruct()
{
parent::_postConstruct();
$this->_model = $this->_config['model'];
$this->_view_path = Solar_Class::dir($this, 'View');
$this->_view_file = 'index.php';
$this->_view = Solar::factory('Solar_View', array('template_path' => $this->_view_path));
}
示例5: _postConstruct
/**
* _postConstruct
*
* @param $model
*/
protected function _postConstruct()
{
parent::_postConstruct();
$this->_model = $this->_config['model'];
$this->_view_path = Solar_Class::dir($this, 'View');
$this->_view_file = 'index.php';
$this->_view = Solar::factory('Solar_View', array('template_path' => $this->_view_path));
$this->register = array('_preRender' => array('index' => array('main' => 'preRender')), '_postRender' => array('index' => array('main' => 'postRender')), '_preRun' => array('index' => array('main' => 'preRun')), '_postRun' => array('index' => array('main' => 'postRun')), '_postAction' => array('index' => array('main' => 'postAction')));
}
示例6: _postConstruct
/**
*
* Post-construction tasks to complete object construction.
*
* @return void
*
*/
protected function _postConstruct()
{
parent::_postConstruct();
if (empty($this->_config['_view']) || !$this->_config['_view'] instanceof Solar_View) {
// we need the parent view object
throw Solar::exception(get_class($this), 'ERR_VIEW_NOT_SET', "Config key '_view' not set, or not Solar_View object");
}
$this->_view = $this->_config['_view'];
unset($this->_config['_view']);
}
示例7: _postConstruct
/**
*
* Post-construction tasks to complete object construction.
*
* @return void
*
*/
protected function _postConstruct()
{
parent::_postConstruct();
// keep the cache active flag
$this->_active = (bool) $this->_config['active'];
// keep the cache lifetime value
$this->_life = (int) $this->_config['life'];
// keep the cache entry prefix
$this->_prefix = (string) $this->_config['prefix'];
}
示例8: _postConstruct
/**
*
* Post-construction tasks to complete object construction.
*
* @return void
*
*/
protected function _postConstruct()
{
parent::_postConstruct();
if ($this->_config['base']) {
$this->setBase($base);
} else {
$base = $this->_findBaseByClass(__CLASS__);
$this->setBase($base);
}
}
示例9: _postConstruct
/**
* _postConstruct
*
* @param $model
*/
protected function _postConstruct()
{
parent::_postConstruct();
$this->_model = $this->_config['model'];
if (isset($_SERVER['DOCUMENT_ROOT'])) {
$web_root = $_SERVER['DOCUMENT_ROOT'];
} else {
$web_root = Solar::$system . '/docroot/';
}
$this->_view_path = $web_root . 'modules/' . $this->name . '/View';
$this->_view_file = 'index.php';
$this->_view = Solar::factory('Solar_View', array('template_path' => $this->_view_path));
}
示例10: _postConstruct
/**
*
* Post-construction tasks to complete object construction.
*
* @return void
*
*/
protected function _postConstruct()
{
parent::_postConstruct();
// stdout and stderr
$this->_stdout = fopen('php://stdout', 'w');
$this->_stderr = fopen('php://stderr', 'w');
// set the recognized options
$options = $this->_fetchGetoptOptions();
$this->_getopt = Solar::factory('Solar_Getopt');
$this->_getopt->setOptions($options);
// follow-on setup
$this->_setup();
}
示例11: _postConstruct
/**
* _postConstruct
*
* @param $model
*/
protected function _postConstruct()
{
parent::_postConstruct();
$this->_model = $this->_config['model'];
$this->web_root = isset($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : Solar::$system . DIRECTORY_SEPARATOR . 'docroot' . DIRECTORY_SEPARATOR;
$this->web_root = Solar_Dir::fix($this->web_root);
$class_arr = explode('_', get_class($this));
$this->_module_name = end($class_arr);
$this->_module_info = $this->_model->modules->fetchModuleInfoByName($this->_module_name);
$this->_setViewPath();
$this->_setViewFile();
$this->_setView();
$this->_view->addHelperClass('Foresmo_View_Helper');
}
示例12: _postConstruct
/**
*
* Post-construction tasks to complete object construction.
*
* @return void
*
*/
protected function _postConstruct()
{
parent::_postConstruct();
// get the current request environment
$this->_request = Solar_Registry::get('request');
// set convenience vars from config
$this->_routing = $this->_config['routing'];
$this->_default = $this->_config['default'];
$this->_disable = (array) $this->_config['disable'];
// set up a class stack for finding commands
$this->_stack = Solar::factory('Solar_Class_Stack');
$this->_stack->add($this->_config['classes']);
// extended setup
$this->_setup();
}
示例13: _postConstruct
/**
*
* Post-construction tasks to complete object construction.
*
* @return void
*
*/
protected function _postConstruct()
{
parent::_postConstruct();
// setup
$this->_setup();
// start up authentication
$this->_authStart();
// is this a valid authenticated user?
if ($this->auth->isValid()) {
$this->_loadRoles();
} else {
// no, user is not valid.
// clear out any previous roles.
$this->role->reset();
$this->access->reset();
}
// load up the access list for the handle and roles
$this->_loadAccess();
}
示例14: _chainLocale
/**
*
* Uses the chain locale object to get translations before falling back
* to this object for locale.
*
* @param string $key The translation key, typically a validation method
* name.
*
* @return string
*
*/
protected function _chainLocale($key)
{
// the translated message; default to the translation key.
$msg = $key;
// if we have a locale object, get a message from it
if ($this->_chain_locale_object) {
// try to translate
$msg = $this->_chain_locale_object->locale($key);
// if the key failed to translate, fall back to the
// translations from $this, but only if $this wasn't
// the source to begin with.
$failed = $msg === null || $msg == $key;
if ($failed && $this != $this->_chain_locale_object) {
$msg = $this->locale($key);
}
}
// done
return $msg;
}
示例15: _postConstruct
/**
*
* Post-construction tasks to complete object construction.
*
* @return void
*
*/
protected function _postConstruct()
{
parent::_postConstruct();
// get the current request environment
$this->_request = Solar_Registry::get('request');
}