本文整理汇总了PHP中Cake\Routing\Router::fullbaseUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Router::fullbaseUrl方法的具体用法?PHP Router::fullbaseUrl怎么用?PHP Router::fullbaseUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cake\Routing\Router
的用法示例。
在下文中一共展示了Router::fullbaseUrl方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testfullBaseURL
/**
* Tests that the base URL can be changed at runtime.
*
* @return void
*/
public function testfullBaseURL()
{
Router::fullbaseUrl('http://example.com');
$this->assertEquals('http://example.com/', Router::url('/', true));
$this->assertEquals('http://example.com', Configure::read('App.fullBaseUrl'));
Router::fullBaseUrl('https://example.com');
$this->assertEquals('https://example.com/', Router::url('/', true));
$this->assertEquals('https://example.com', Configure::read('App.fullBaseUrl'));
}
示例2: array
*
*/
Plugin::load('Migrations');
// Only try to load DebugKit in development mode
// Debug Kit should not be installed on a production system
if (Configure::read('debug')) {
Plugin::load('DebugKit', ['bootstrap' => true]);
}
/**
* Connect middleware/dispatcher filters.
*/
DispatcherFactory::add('Asset');
DispatcherFactory::add('Routing');
DispatcherFactory::add('ControllerFactory');
/**
* CUSTOM GLOBAL VARS GO BELOW
*
*/
Configure::write('TIMEZONE_OFFSET', '-4');
Configure::write('UPLOAD_ROOT', 'file_library');
// this is where all uploaded files will go
Configure::write('UPLOAD_TEMP_DIR', '_tmp');
// this will be created within each file directory per job
Configure::write('UPLOAD_VERSION_DIR', '_versions');
// this will be created within each file directory per job
Configure::write('UPLOAD_ROOT_OFFSET', '../');
// this is necessary for upload folders placed outside the app root
Configure::write('SITE_ROOT', Router::fullbaseUrl());
// this points to the root of the site, independent from the cake folder structure
// list of allowed upload formats
Configure::write('EXT_LIST', array('jpg', 'png', 'gif', 'swf', 'mp4', 'mov', 'pdf', 'zip'));
示例3: forgot
public function forgot()
{
$message_sent = false;
$msg = false;
if ($this->request->is('post') && isset($this->request->data['email'])) {
$Users = TableRegistry::get('Users');
if ($user = $Users->find('all', ['conditions' => ['email' => $this->request->data['email']]])->first()) {
$user = $user->toArray();
// generate temp password and save to user
$tmp_pw = substr(md5(uniqid(rand(), true)), 0, 8);
$hashed = $this->create_hash($tmp_pw);
if ($Users->save($Users->newEntity(['id' => $user['id'], 'salt' => $hashed['salt'], 'hash' => $hashed['hash'], 'require_pw_change' => 1]))) {
// send email
$message = file_get_contents(Router::fullbaseUrl() . DS . 'email/forgot.html');
$message = str_replace("%name%", $user['first_name'], $message);
$message = str_replace("%email%", $user['email'], $message);
$message = str_replace("%password%", $tmp_pw, $message);
//send the message, check for errors
if (AppController::sendEmail(array('to' => $user['email'], 'bcc' => 'dlowetz@tagworldwide.com', 'subject' => 'TDI Preview Password Reset', 'body' => $message))) {
$message_sent = true;
}
}
} else {
$msg = 'Email address not on record';
}
}
$this->set(compact('msg', 'message_sent'));
}