本文整理汇总了PHP中AbstractController类的典型用法代码示例。如果您正苦于以下问题:PHP AbstractController类的具体用法?PHP AbstractController怎么用?PHP AbstractController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AbstractController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public function add(AbstractController $controller, $redirect)
{
try {
$fo = FOFactory::build('comment');
if (!$fo->isSent()) {
$this->redirectToCaller($redirect);
}
$this->model->add($fo, $fo->getType(), $fo->getId());
$this->redirectToCaller($redirect);
} catch (FormValidationException $e) {
$this->values->error = Bundle::get('form.validation.invalid.value', $e->getMessage());
$controller->setAction($redirect);
}
}
示例2: init
/**
* 初始化
* (non-PHPdoc)
* @see AbstractController#init()
*/
public function init()
{
parent::init();
$this->oUser = new Lm_User();
$this->oLoto = new Loto_Loto();
$this->oPrize = new Loto_Prize();
}
示例3: init
/**
* 初始化
* (non-PHPdoc)
* @see AbstractController#init()
*/
public function init()
{
parent::init();
$this->oUser = new Lm_User();
$this->oResearch = new Config_Research();
$this->oQuestion = new Config_Research_Question();
}
示例4: init
/**
* 初始化
* (non-PHPdoc)
* @see AbstractController#init()
*/
public function init()
{
parent::init();
$this->oApp = new Config_App();
$this->oClass = new Config_Class();
$this->oPartner = new Config_Partner();
}
示例5: init
/**
* 初始化
* (non-PHPdoc)
* @see AbstractController#init()
*/
public function init()
{
parent::init();
$this->oMachine = new Config_Machine();
$this->oDepot = new Config_Depot();
$this->oCage = new Config_Cage();
$this->oPermission = new Config_Permission();
//新添
$this->oArea = new Config_Area();
//新添
$this->oApp = new Config_App();
$this->oPartner = new Config_Partner();
$this->oPartnerApp = new Config_Partner_App();
$this->oServer = new Config_Server();
$this->DepotList = $this->oDepot->getAll();
$this->CageList = $this->oCage->getAll();
$this->AppList = $this->oApp->getAll();
$this->PartnerList = $this->oPartner->getAll();
$this->ServerList = $this->oServer->getAll();
//新添
//获取用户可以查看的游戏列表
$this->permitted_app = $this->oPermission->getApp($this->manager->data_groups, 'AppId,name');
//预处理地区信息
$this->AreaList = $this->oArea->getAll();
}
示例6: setUp
/**
* Setup
*/
public function setUp()
{
$this->setFormManager(new \StrokerForm\FormManager());
$this->controller = new AjaxController($this->getFormManager());
$this->request = new Request();
$this->response = new Response();
$controllerName = strtolower(str_replace('Controller', '', get_class($this->controller)));
$this->routeMatch = new RouteMatch(array('controller' => $controllerName));
$this->event = new MvcEvent();
$this->event->setRouteMatch($this->routeMatch);
$this->controller->setEvent($this->event);
}
示例7: init
function init()
{
parent::init();
$email_settings = $this->add('xepan\\communication\\Model_Communication_EmailSetting')->addCondition('is_imap_enabled', true)->addCondition('is_active', true);
$total_email_to_fetch = $email_settings->count()->getOne();
$total_email_to_fetch_per_minute = ceil($total_email_to_fetch / $this->loop_time_duration);
$time_before_five_minute = date("Y-m-d H:i:s", strtotime("-" . $this->loop_time_duration . " minutes", strtotime($this->app->now)));
$email_settings->addCondition('last_email_fetched_at', '<', $time_before_five_minute);
$email_settings->setOrder('last_email_fetched_at', 'asc');
$email_settings->setLimit($total_email_to_fetch_per_minute);
foreach ($email_settings as $email_setting) {
if ($this->debug) {
echo "<br/> Fetching from " . $email_setting['name'] . '<br/>';
}
$cont = $this->add('xepan\\communication\\Controller_ReadEmail', ['email_setting' => $email_setting, 'debug' => $this->debug]);
$mbs = ['INBOX'];
// $cont->getMailBoxes();
foreach ($mbs as $mb) {
$emails_return = $cont->fetch($mb, 'UNSEEN');
$this->app->hook('emails_fetched', [$emails_return]);
}
$email_setting['last_email_fetched_at'] = $this->app->now;
$email_setting->saveAndUnload();
}
}
示例8: HTTPRequest
public function HTTPRequest()
{
if (self::$_HTTPRequest == null) {
self::$_HTTPRequest = HTTPRequest::sharedRequest();
}
return self::$_HTTPRequest;
}
示例9: init
function init()
{
parent::init();
if (!$this->email_setting or !$this->email_setting instanceof \xepan\communication\Model_Communication_EmailSetting) {
throw $this->exception('Please provide email_setting value as loaded xepan\\communication\\Model_Communication_EmailSetting instance');
}
}
示例10: init
function init()
{
parent::init();
$this->headers['Mime-Version'] = "1.0";
$this->headers['Content-Transfer-Encoding'] = "8bit";
$this->setBodyType('text');
}
示例11: init
function init()
{
parent::init();
// $this->setCallbackURL($this->api->getDestinationURL(null,
// array('oauth'=>$this->name)));
// Default URL :)
}
示例12: init
function init()
{
parent::init();
$this->app->jquery = $this;
if (!$this->app->template) {
return;
}
if (!$this->app->template->is_set('js_include')) {
throw $this->exception('Tag js_include must be defined in shared.html');
}
if (!$this->app->template->is_set('document_ready')) {
throw $this->exception('Tag document_ready must be defined in shared.html');
}
$this->app->template->del('js_include');
/* $config['js']['jquery']='https://code.jquery.com/jquery-2.1.4.min.js'; // to use CDN */
if ($v = $this->app->getConfig('js/versions/jquery', null)) {
$v = 'jquery-' . $v;
} else {
$v = $this->app->getConfig('js/jquery', 'jquery-2.0.3.min');
}
// bundled jQuery version
$this->addInclude($v);
// Controllers are not rendered, but we need to do some stuff manually
$this->app->addHook('pre-render-output', array($this, 'postRender'));
$this->app->addHook('cut-output', array($this, 'cutRender'));
}
示例13: init
function init()
{
parent::init();
$this->api->requires('atk', '4.2');
$symbols = $this->owner->model->_dsql()->field($this->owner->model->_dsql()->expr("DISTINCT LEFT({$this->field},1) as symbol"))->order($this->field);
$ul = $this->api->add('View', null, 'Content')->setElement('ul')->addClass('gridqsearch');
$li = $ul->add('View', 'c')->setElement('li')->addClass('refresh')->addStyle('cursor', 'pointer');
$li->add('View')->setElement('span')->addClass('qsearch-refresh')->set("clear");
$li->js('click', array($this->owner->js()->reload(array('filter' => 'clear'))));
foreach ($symbols as $symbol) {
$li = $ul->add('View', 'c' . $this->count++)->setElement('li')->addClass('ui-corner-all')->addStyle('cursor', 'pointer');
$li->add('View')->setElement('span')->addClass('qsearch-value')->set($symbol['symbol']);
$li->js('click', array($this->owner->js()->reload(array('filter' => $li->js()->text()))));
}
if ($_GET['filter'] != '') {
if ($_GET['filter'] == 'clear') {
$this->api->forget('filter');
} else {
$this->api->memorize('filter', $_GET['filter']);
}
}
if ($this->api->recall('filter') != '') {
$this->owner->model->addCondition($this->field, 'like', trim($this->api->recall('filter')) . '%');
}
}
示例14: __construct
public function __construct()
{
parent::__construct();
$this->model = new UploadModel();
$this->view = new UploadView();
$this->allowedExts = array('c', 'cpp', 'java', 'py', 'php', 'cs', 'js', 'xml', 'json', 'rb', 'scala', 'go');
}
示例15: getMandantName
protected function getMandantName()
{
if (!$this->mandantName) {
return parent::getMandantName();
}
return $this->mandantName;
}