本文整理汇总了PHP中asset_url函数的典型用法代码示例。如果您正苦于以下问题:PHP asset_url函数的具体用法?PHP asset_url怎么用?PHP asset_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了asset_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: enable_login
/**
* Enables custom login.
* @since 1.0
*/
public function enable_login()
{
// Check on additional unwanted runs.
if (defined('DOING_AJAX') && DOING_AJAX || Request::input('wc-ajax') || Request::input('error')) {
return;
}
// Register script
wp_register_script('addon-loginpage', asset_url('../assets/dist/wp-loginpage.min.js', __FILE__), ['jquery'], '1.0.0', true);
// Enable pages
global $pagenow;
switch ($pagenow) {
case 'wp-register.php':
$this->mvc->call('SignupController@register');
die;
case 'wp-login.php':
switch (Request::input('action')) {
case 'register':
$this->mvc->call('SignupController@register');
die;
case 'lostpassword':
$this->mvc->call('PasswordController@lost');
die;
case 'rp':
$this->mvc->call('PasswordController@reset');
die;
}
$this->mvc->call('LoginController@login');
die;
}
}
示例2: run_test
/**
* @author Minh Duc Nguyen <minh.nguyen@ands.org.au>
*/
function run_test()
{
/* Set up variables to pass to the test functions to stimulate good and faulty DOI API calls */
$app_id = $this->config->item('gDOIS_TEST_APP_ID');
$incorrect_app_id = 'mvivnnvnjvn4tjvmve2432nvbthth';
$shared_secret = $this->config->item('gDOIS_TEST_SHARED_SECRET');
$incorrect_shared_secret = 'gmpryonty';
$url = 'http://devl.ands.org.au/example1.php';
$incorrect_url = 'http;//no.domain.exists/example.php';
$doiversion_service_points = array('v1.0' => 'https://services.ands.org.au/home/dois/doi_', 'v1.1' => 'https://services.ands.org.au/doi/1.1/', 'test' => apps_url() . '/mydois/');
$validxml = 'xml=' . file_get_contents(asset_url('test_cases/doi/validxml.xml'), 'test_suite');
$invalidxml = 'xml=' . file_get_contents(asset_url('test_cases/doi/invalidxml.xml'), 'test_suite');
$requestURI = $doiversion_service_points['v1.1'];
$requestURI = $doiversion_service_points['test'];
$v1_service_url = $doiversion_service_points['v1.0'];
/* first we mint a DOI using the latest version of the CMD API*/
$testDOI = $this->test_mint($app_id, $shared_secret, $url, $requestURI, 'mint', 'json', $validxml);
$this->unit->run(is_string($testDOI), true, 'Test Mint returns DOI: ' . $testDOI);
if ($testDOI) {
$validxml = str_replace('<identifier identifierType="DOI"></identifier>', '<identifier identifierType="DOI">' . $testDOI . '</identifier>', $validxml);
$this->test_doi_api_functions($app_id, $shared_secret, $url, $testDOI, $validxml, $requestURI);
$this->test_doi_authentication($app_id, $incorrect_app_id, $shared_secret, $incorrect_shared_secret, $url, $testDOI, $requestURI);
$this->test_doi_xml($app_id, $shared_secret, $url, $testDOI, $validxml, $invalidxml, $requestURI);
$this->test_doi_service_point($app_id, $shared_secret, $url, $testDOI, $validxml, $v1_service_url, $requestURI);
$this->test_response_type($app_id, $shared_secret, $url, $testDOI, $validxml, $requestURI);
} else {
return;
}
}
示例3: fetchLogo
function fetchLogo($group)
{
$slug = url_title($group, '-', true);
//check for custom logo that is published
$data = $this->fetchData($group);
if ($data) {
$data = json_decode($data->{'data'}, true);
if (isset($data['hide_logo']) && $data['hide_logo']) {
return false;
}
if (isset($data['logo'])) {
return $data['logo'];
}
}
//check for default path
$path = 'applications/portal/group/assets/logos/' . $slug . '.jpg';
$path2 = 'applications/portal/group/assets/logos/' . $slug . '.png';
if (file_exists($path)) {
return asset_url('group/logos/' . $slug . '.jpg', 'full_base_path');
} elseif (file_exists($path2)) {
return asset_url('group/logos/' . $slug . '.png', 'full_base_path');
} else {
return false;
}
return false;
}
示例4: get_child
function get_child($member_id)
{
$network = $this->network_model->get_network($member_id);
$html = "";
$html .= "<ul class='child_genealogy network'>";
foreach ($network as $item) {
$content = '<div>
<strong>Name : ' . strtoupper($item['lastname']) . ', ' . strtoupper($item['firstname']) . '</strong><br>
<strong>Member ID : ' . $item['member_code'] . '</strong><br>
<p>Email : ' . $item['email'] . '<br>
Date Registered: ' . $item['date_registered'] . '</p>
</div>';
$html .= '<li>
<div class="timeline-icon">
<a href="javascript:void" data-source="' . base_url('genealogy/get-child/' . $item['id']) . '" data-memberid="' . $item['id'] . '" id="child_degree" class="pophover" class="btn btn-default" data-container="body" data-toggle="popover" data-html="true" data-placement="top" data-content="' . $content . '">
<img src="' . asset_url() . 'img/logo-big.png" width="30" />
</a>
</div>
</li>
';
}
$html .= "</ul>";
echo $html;
}
示例5: postBycategory
function postBycategory()
{
//code to load smileys on page....
$image_array = get_clickable_smileys(asset_url() . 'smileys/', 'postContent');
$col_array = $this->table->make_columns($image_array, 8);
$data['smiley_table'] = $this->table->generate($col_array);
$categoryId = $this->uri->segment(3, 0);
$data['get_category_By_Id'] = $this->category_model->get_category_By_Id($categoryId);
if (count($data['get_category_By_Id']) == 0) {
redirect('');
} else {
$data['user_id'] = $this->tank_auth->get_user_id();
$data['username'] = $this->tank_auth->get_username();
$data['categories'] = $this->category_model->categories_list();
$userId = $this->tank_auth->get_user_id();
$data['getUserdetailsById'] = $this->user_model->getUserdetailsById($userId);
$data['postContent'] = $this->post_model->getPostByCategoryId($categoryId);
$data['categories'] = $this->category_model->categories_list();
$data['get_category_By_Id'] = $this->category_model->get_category_By_Id($categoryId);
$data['getAllLikeTypes'] = $this->like_model->getAllLikeTypes();
$likecount = count($data['getAllLikeTypes']);
if (count($data['postContent']) != 0) {
for ($i = 0; $i < $likecount; $i++) {
foreach ($data['postContent'] as $postid) {
$count[$postid->postId] = $this->like_model->getCountLikeByPost($postid->postId, $i + 1);
$countcomments[$postid->postId] = $this->post_model->get_Nocomment_by_Postid($postid->postId);
}
$data['getLikeByPost'][$i] = $count;
$data['countComments'] = $countcomments;
}
}
$this->load->view('home', $data);
}
}
示例6: get_members_lit
function get_members_lit($member_id, $position)
{
$network = $this->network_model->get_network($member_id);
$html = '';
$member_total = count($network);
if ($member_total > 0) {
$html .= '
<div class="child" data-counter="' . $member_total . '">
<!-- CHILD GENEALOGY -->
<ul class="child_genealogy" id="' . $position . '-child_' . $member_id . '" >';
foreach ($network as $member) {
$html .= '<li id="gen_' . $member['id'] . '" class="first-net">
<a href="javascript:void(0)" id="genealogy_' . $position . '" class="id_' . $member['id'] . '" data-gen_id="' . $member['id'] . '">
<div class="timeline-icon">
<img src="' . asset_url() . 'img/logo-big.png" width="30" />
</div>
</a>';
if ($member['members'] > 0) {
$html .= '<div id="' . $position . '_hiddenDiv" class="members_container">
<div id="' . $position . '_verticalDiv">
</div>
</div>';
}
$html .= '</li>';
}
$html .= '</ul>
</div>';
}
echo $html;
}
示例7: create_application
function create_application($name, $tenant_id)
{
$ci =& get_instance();
$ci->load->model('vbx_settings');
$app_name = "OpenVBX :: {$name}";
$twilio_sid = $ci->vbx_settings->get('twilio_sid', $tenant_id);
$twilio_token = $ci->vbx_settings->get('twilio_token', $tenant_id);
// Rare event, sid and/or token may be empty
if (!empty($twilio_sid) && !empty($twilio_token)) {
error_log('Processing tenant: ' . $tenant_id);
$account = OpenVBX::getAccount($twilio_sid, $twilio_token);
$applications = $account->applications->getIterator(0, 1, array('FriendlyName' => $app_name));
$application = false;
foreach ($applications as $_application) {
if ($_application->friendly_name == $app_name) {
$application = $_application;
}
}
$params = array('FriendlyName' => $app_name, 'VoiceUrl' => tenant_url('twiml/dial', $tenant_id), 'VoiceFallbackUrl' => asset_url('fallback/voice.php'), 'VoiceMethod' => 'POST', 'SmsUrl' => '', 'SmsFallbackUrl' => '', 'SmsMethod' => 'POST');
if (!empty($application)) {
error_log('Modifying app: ' . $app_name);
$application->update($params);
} else {
error_log('Creating app: ' . $app_name);
$application = $account->applications->create($app_name, $params);
}
error_log('Created/Updated app for tenant id: ' . $tenant_id . ' - Application Sid: ' . $application->sid);
$ci->vbx_settings->add('application_sid', $application->sid, $tenant_id);
} else {
error_log('Skipped app creation for tenant "' . $tenant_id . '" - incomplete account Sid/Token pair.');
}
}
示例8: register
public function register()
{
if ($this->session->userdata('logged_in') == false) {
$data['view'] = 'register/register';
$data['title'] = 'Đăng kí tài khoản';
$data['left_hidden'] = true;
$data['right_hidden'] = true;
/////////////////
$this->load->helper('captcha');
$vals = array('word' => '', 'img_path' => './asset/captcha/', 'img_url' => asset_url() . 'captcha', 'img_width' => '200', 'img_height' => 40, 'expiration' => 600, 'word_length' => 8, 'font_size' => 16, 'img_id' => 'Imageid', 'pool' => '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'colors' => array('background' => array(255, 255, 255), 'border' => array(255, 255, 255), 'text' => array(0, 0, 0), 'grid' => array(255, 40, 40)));
$cap = create_captcha($vals);
$data['content']['cap'] = $cap;
$data_captcha = array('captcha_time' => $cap['time'], 'ip_address' => $this->input->ip_address(), 'word' => $cap['word']);
$this->muser->save_captcha($data_captcha);
////////////////////
$rules = array(array('field' => 'register-username', 'rules' => 'trim|required|min_length[3]|callback_check_username'), array('field' => 'register-password', 'rules' => 'trim|required|min_length[5]'), array('field' => 'register-repassword', 'rules' => 'trim|required|min_length[5]|matches[register-password]'), array('field' => 'register-email', 'rules' => 'trim|required|valid_email|callback_check_email'), array('field' => 'captcha', 'rules' => 'trim|required|callback_check_captcha'));
$this->form_validation->set_rules($rules);
if ($this->input->post('register')) {
if ($this->form_validation->run()) {
$info = array('register' => array('username' => $this->input->post('register-username'), 'email' => $this->input->post('register-email'), 'password' => md5($this->input->post('register-password')), 'role' => 'ROLE_USER'), 'avatar' => $_FILES);
$id = $this->muser->create_user($info);
$data['view'] = 'register/success';
$data['content']['test'] = $_FILES;
}
}
$this->load->view(LAYOUT, $data);
} else {
redirect('', 'refresh');
}
}
示例9: send_email
public function send_email($id)
{
$data = array();
$this->stencil->title('Send email');
if ($id != NULL) {
$data['user'] = $this->user_model->get($id);
}
$this->stencil->data($data);
if ($this->input->method() != 'post') {
$this->stencil->js(asset_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js'));
$this->stencil->css(asset_url('plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css'));
$this->stencil->paint('admin/user-send-email');
} else {
$user = $this->kulkul_auth->user();
$this->load->library('email');
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';
$this->email->initialize($config);
$this->email->from($user->email, $user->full_name);
$this->email->to($this->input->post('to'));
$this->email->cc($this->input->post('cc'));
$this->email->bcc($this->input->post('bcc'));
$this->email->subject($this->input->post('subject'));
$this->email->message($this->input->post('body'));
$this->email->send();
$this->session->set_flashdata('success', 'Your email has been sent');
redirect('admin/user');
}
}
示例10: __construct
public function __construct()
{
parent::__construct();
$this->_authenticate('login', array(1));
$this->load->model('common_model');
$this->dynamic_load->add_js('footer', array('src' => asset_url('js', 'admin/leadtemplates.js'), 'type' => 'text/javascript'));
}
示例11: index
function index()
{
$image_array = get_clickable_smileys(asset_url() . 'smileys/', 'comments');
$col_array = $this->table->make_columns($image_array, 8);
$data['smiley_table'] = $this->table->generate($col_array);
$this->load->view('smiley_view', $data);
}
示例12: index
public function index()
{
$this->dynamic_load->add_js('footer', array('src' => asset_url('js', 'page/setting.js'), 'type' => 'text/javascript'));
$user_id = $this->session->userdata('user_id');
$user_data = getDbData('users', array('id' => $user_id));
$this->template->view('settings/index', array('user_data' => $user_data));
}
示例13: __construct
public function __construct()
{
parent::__construct();
$this->template->set_template('guest_template');
$this->load->model('common_model');
$this->dynamic_load->add_js('footer', array('src' => asset_url('js', 'guest.js'), 'type' => 'text/javascript'));
}
示例14: register
public function register()
{
$data['scripts'] = array(asset_url() . "js/workshop_register_onspot.js");
$this->load->view('menu/header');
$this->load->view('workshops/register');
$this->load->view('menu/footer', $data);
}
示例15: __construct
public function __construct($table)
{
$this->table = $table;
parent::__construct();
$this->images_path = asset_path() . "/images/{$this->entity_name}/";
$this->images_url = asset_url() . "/images/{$this->entity_name}/";
$this->table_fields = array_flip($this->db->list_fields($table));
}