本文整理汇总了PHP中JController::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP JController::__construct方法的具体用法?PHP JController::__construct怎么用?PHP JController::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JController
的用法示例。
在下文中一共展示了JController::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
/**
* constructor (registers additional tasks to methods)
* @return void
*/
function __construct()
{
parent::__construct();
// Register Extra tasks
$this->registerTask('add', 'edit');
$this->registerTask('unpublish', 'publish');
}
示例2: __construct
/**
* Constructor.
*
* @param array An optional associative array of configuration settings.
* @see JController
*/
public function __construct($config = array())
{
parent::__construct($config);
$this->registerTask('unpublish', 'publish');
$this->registerTask('orderup', 'reorder');
$this->registerTask('orderdown', 'reorder');
}
示例3: array
/**
* Constructor
*/
function __construct($config = array())
{
parent::__construct($config);
// Register Extra tasks
$this->registerTask('add', 'edit');
$this->registerTask('apply', 'save');
}
示例4: __construct
/**
* Constructor
*/
public function __construct($config = array())
{
parent::__construct($config);
$this->registerTask('apply', 'save');
$this->registerTask('save2new', 'save');
$this->registerTask('save2copy', 'save');
}
示例5:
function __construct()
{
parent::__construct();
$this->registerTask('unpublish', 'publish');
$this->registerTask('feature', 'toggleFeature');
$this->registerTask('unfeature', 'toggleFeature');
}
示例6: __construct
/**
* Constructor.
*
* @param array $config An optional associative array of configuration settings.
*
* @see JController
* @since 11.1
* @throws Exception
*/
public function __construct($config = array())
{
parent::__construct($config);
// Define standard task mappings.
// Value = 0
$this->registerTask('unpublish', 'publish');
// Value = 2
$this->registerTask('archive', 'publish');
// Value = -2
$this->registerTask('trash', 'publish');
// Value = -3
$this->registerTask('report', 'publish');
$this->registerTask('orderup', 'reorder');
$this->registerTask('orderdown', 'reorder');
// Guess the option as com_NameOfController.
if (empty($this->option)) {
$this->option = 'com_' . strtolower($this->getName());
}
// Guess the JText message prefix. Defaults to the option.
if (empty($this->text_prefix)) {
$this->text_prefix = strtoupper($this->option);
}
// Guess the list view as the suffix, eg: OptionControllerSuffix.
if (empty($this->view_list)) {
$r = null;
if (!preg_match('/(.*)Controller(.*)/i', get_class($this), $r)) {
throw new Exception(JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500);
}
$this->view_list = strtolower($r[2]);
}
}
示例7: __construct
public function __construct($config = array())
{
if (empty($config['default_task'])) {
$config['default_task'] = 'index';
}
parent::__construct($config);
}
示例8: __construct
public function __construct($default = array())
{
parent::__construct($default);
JRequest::setVar('view', 'sample_catalog');
JRequest::setVar('layout', 'default');
JRequest::setVar('hidemainmenu', 1);
}
示例9: LinkrController
function LinkrController()
{
parent::__construct();
// Include paths
$this->addViewPath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'views');
$this->addModelPath(JPATH_COMPONENT_ADMINISTRATOR . DS . 'models');
}
示例10: array
function __construct($config = array())
{
parent::__construct($config);
$this->registerTask('installcore', 'display');
$this->registerTask('installtheme', 'display');
$this->registerTask('installsuccessfully', 'display');
}
示例11: array
/**
* Custom Constructor
*/
function __construct($default = array())
{
// Set a default view if none exists
if (!JRequest::getCmd('view')) {
JRequest::setVar('view', 'projects');
}
$task = JRequest::getVar('task');
$searchType = JRequest::getVar('searchType', '');
$id = JRequest::getInt('id', 0);
parent::__construct($default);
/*if ( $id )
{
// view property detail
$this->viewDetail($id );
}
else
{
if ( $task == 'search' && $searchType != 'filter')
{
// remove session of before search
unset( $_SESSION['projectSearch'] );
}
$this->searchProject();
}*/
}
示例12: __construct
/**
* Constructor for the tasker
*
* @return joomfishTasker
*/
public function __construct()
{
parent::__construct();
$this->registerDefaultTask('show');
$this->act = JRequest::getVar('act', '');
$this->task = JRequest::getVar('task', '');
$this->cid = JRequest::getVar('cid', array(0));
if (!is_array($this->cid)) {
$this->cid = array(0);
}
$this->fileCode = JRequest::getVar('fileCode', '');
$this->_joomfishManager = JoomFishManager::getInstance();
$this->registerTask('show', 'showCElementConfig');
$this->registerTask('detail', 'showElementConfiguration');
$this->registerTask('remove', 'removeContentElement');
$this->registerTask('remove_install', 'removeContentElement');
$this->registerTask('installer', 'showContentElementsInstaller');
$this->registerTask('uploadfile', 'installContentElement');
// Populate data used by controller
global $mainframe;
$this->_catid = $mainframe->getUserStateFromRequest('selected_catid', 'catid', '');
$this->_select_language_id = $mainframe->getUserStateFromRequest('selected_lang', 'select_language_id', '-1');
$this->_language_id = JRequest::getVar('language_id', $this->_select_language_id);
$this->_select_language_id = $this->_select_language_id == -1 && $this->_language_id != -1 ? $this->_language_id : $this->_select_language_id;
// Populate common data used by view
// get the view
$this->view = $this->getView("elements");
// Assign data for view
$this->view->assignRef('catid', $this->_catid);
$this->view->assignRef('select_language_id', $this->_select_language_id);
$this->view->assignRef('task', $this->task);
$this->view->assignRef('act', $this->act);
}
示例13: __construct
public function __construct($default = array())
{
parent::__construct($default);
// init vars
$this->joomla = JFactory::getApplication();
$this->user = JFactory::getUser();
$this->session = JFactory::getSession();
$this->document = JFactory::getDocument();
$this->dispatcher = JDispatcher::getInstance();
$this->option = YRequest::getCmd('option');
$this->link_base = 'index.php?option=' . $this->option;
$this->controller = $this->getName();
// add super administrator var to user
$this->user->superadmin = UserHelper::isJoomlaSuperAdmin($this->user);
// init additional admin vars
if ($this->joomla->isAdmin()) {
$this->baseurl = 'index.php?option=' . $this->option . '&controller=' . $this->getName();
}
// init additional site vars
if ($this->joomla->isSite()) {
$this->itemid = (int) $GLOBALS['Itemid'];
$this->params = $this->joomla->getParams();
$this->pathway = $this->joomla->getPathway();
}
}
示例14:
function __construct()
{
global $mainframe;
parent::__construct();
$this->registerDefaultTask('display');
$this->registerTask('clearCache', 'clearCache');
}
示例15: __construct
/**
* Base Controller Constructor
*
* @param array $config Controller initialization configuration parameters
* @return void
* @since 0.1
*/
public function __construct($config = array())
{
parent::__construct($config);
$this->set('option', JRequest::getCmd('option'));
JModel::addIncludePath(JPATH_SITE . '/components/com_api/models');
JTable::addIncludePath(JPATH_SITE . '/components/com_api/tables');
}