当前位置: 首页>>代码示例>>PHP>>正文


PHP assets_path函数代码示例

本文整理汇总了PHP中assets_path函数的典型用法代码示例。如果您正苦于以下问题:PHP assets_path函数的具体用法?PHP assets_path怎么用?PHP assets_path使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了assets_path函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: portfolio

 public function portfolio()
 {
     if ($_FILES) {
         $config['upload_path'] = './assets/uploads/portfolio/';
         $config['allowed_types'] = 'gif|jpg|png';
         $config['max_size'] = '2024';
         $this->load->library('upload', $config);
         if (!$this->upload->do_upload('image')) {
             echo json_encode(array('error' => $this->upload->display_errors()));
         } else {
             $data = $this->upload->data();
             $this->global_m->insert('portfolio', array('user_id' => user_meta('id'), 'image' => $data['file_name'], 'description' => $_POST['description']));
             echo json_encode(array('img' => './assets/uploads/portfolio/' . $data['file_name'], 'des' => $_POST['description']));
         }
     } else {
         $data = $this->global_m->get('portfolio', 'user_id', user_meta('id'));
         $html = '';
         if (!empty($data)) {
             foreach ($data as $key => $value) {
                 $html .= '<a rel="prettyPhoto" href="' . assets_path('uploads/portfolio') . '/' . $value->image . '" class="preview">
                              <img alt="' . $value->description . '" src="' . assets_path('uploads/portfolio') . '/' . $value->image . '" width="230" style="padding-bottom: 5px">
                          </a>';
             }
         } else {
         }
         echo $html;
     }
 }
开发者ID:Hussu,项目名称:jobdesk,代码行数:28,代码来源:Profile.php

示例2: _get_tpl_admin

 function _get_tpl_admin()
 {
     $data['config'] = $this->config->item('site');
     $data['img_path'] = assets_path();
     $data['modules'] = $this->scheme->get_modules();
     $data['uri']['admin'] = $this->control_uri->get_full_segment(__CLASS__);
     $data['uri']['mod'] = $this->control_uri->get_segment(__CLASS__, 'mod');
     $date_menu['lang']['admin']['modules'] = $this->lang->line('admin_modules');
     //echo $data['uri']['mod'];
     return $data;
 }
开发者ID:Moro3,项目名称:duc,代码行数:11,代码来源:admin.php

示例3: generateURL

 private function generateURL($data)
 {
     for ($i = 0; $i < count($data); $i++) {
         if ($data[$i]['image_extension']) {
             $data[$i]['image'] = stripos(get_headers(assets_path('img/article/' . $data[$i]['id'] . '.' . $data[$i]['image_extension']))[0], "200 OK") ? assets_path('img/article/' . $data[$i]['id'] . '.' . $data[$i]['image_extension']) : FALSE;
         } else {
             $data[$i]['image'] = FALSE;
         }
         $data[$i]['link'] = site_url(date("Y", strtotime($data[$i]['datetime'])) . DS . date("m", strtotime($data[$i]['datetime'])) . DS . urlencode($data[$i]['title']));
     }
     return $data;
 }
开发者ID:haydarmiftahul,项目名称:omahbocah,代码行数:12,代码来源:Home.php

示例4: form_fields

 function form_fields($values = array())
 {
     $fields = parent::form_fields();
     $CI =& get_instance();
     $CI->load->module_model(FUEL_FOLDER, 'users_model');
     $CI->load->module_library(BLOG_FOLDER, 'fuel_blog');
     $options = $CI->users_model->options_list();
     $upload_image_path = assets_server_path($CI->fuel_blog->settings('asset_upload_path'));
     $fields['fuel_user_id'] = array('label' => 'User', 'type' => 'select', 'options' => $options);
     // put all project images into a projects suboflder.
     $fields['avatar_image_upload']['upload_path'] = assets_server_path($CI->fuel_blog->settings('asset_upload_path'));
     // fix the preview by adding projects in front of the image path since we are saving it in a subfolder
     if (!empty($values['avatar_image'])) {
         $fields['avatar_image_upload']['before_html'] = '<img src="' . assets_path($CI->fuel_blog->settings('asset_upload_path') . $values['avatar_image']) . '" style="float: right;"/>';
     }
     return $fields;
 }
开发者ID:randombrad,项目名称:FUEL-CMS,代码行数:17,代码来源:blog_users_model.php

示例5: fire

 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     $name = explode("/", $this->argument('name'));
     if (count($name) > 1) {
         // If the array have more than 1 key/value
         $path = $name[0] . DIRECTORY_SEPARATOR . $name[1];
         if ($this->filesystem->exists($this->directory['vendor'] . DIRECTORY_SEPARATOR . $path)) {
             $this->filesystem->copyDirectory($this->directory['vendor'] . DIRECTORY_SEPARATOR . $path, assets_path('libraries' . DIRECTORY_SEPARATOR . $name[1]));
             $this->info('[' . $name[0] . '/' . $name[1] . '] is successfully imported into the assets libraries');
         } else {
             throw new \InvalidArgumentException('Sorry, we can not import because the path [' . $path . '] does not exists');
         }
     } else {
         // If the array only have 1 key/value
         $path = $name[0];
         if ($this->filesystem->exists($this->directory['vendor'] . DIRECTORY_SEPARATOR . $path)) {
             $this->filesystem->copyDirectory($this->directory['vendor'] . DIRECTORY_SEPARATOR . $path, assets_path('libraries' . DIRECTORY_SEPARATOR . $path));
             $this->info('[' . $path . '] is successfully imported into the assets libraries');
         } else {
             throw new \InvalidArgumentException('Sorry, we can not import because the path [' . $path . '] does not exists');
         }
     }
 }
开发者ID:walisph,项目名称:assets,代码行数:28,代码来源:AssetsImportCommand.php

示例6: assets_path

<img class="loading" src="<?php 
echo assets_path('images/loading.gif');
?>
" style="bottom: 0;left: 0;margin: auto;position: absolute;right: 0;top: 0;z-index: 9999; display:none" >
<div class="main-wrapper" style=" background-color: rgba(0, 0, 0, 0.6);">
    <div class="container">
        <h2>.</h2>
        <div class="media services-wrap wow fadeInDown animated" style=" padding-top:30px;visibility: visible; animation-name: fadeInDown;">
            <div class="col-md-12">
                <div class="col-md-9">
                <?php 
if ($this->session->flashdata('proposal_success')) {
    ?>
                    <div class="alert alert-<?php 
    echo $this->session->flashdata('class');
    ?>
 col-md-12"> <?php 
    echo $this->session->flashdata('proposal_success');
    ?>
</div>
               <?php 
}
?>
                <h1 style="color:#4e4e4e"><?php 
echo $job->title;
?>
</h1>
                </div>
                <div class="col-md-3">
                     <div class="col-md-7">
                        <strong>End In(Days)</strong>
开发者ID:Hussu,项目名称:jobdesk,代码行数:31,代码来源:detail.php

示例7: foreach

    ?>
                        <h3 id="send_proposal">Workstream With <?php 
    echo $userDtata->first_name;
    ?>
</h3>
                        <hr>
                        
                        <div class="col-md-12" id="workstream_thread" style="">
                            <?php 
    if (!empty($workstream)) {
        foreach ($workstream as $key => $value) {
            ?>
                                <div class="row">
                                    <div class="col-md-1">
                                        <img class="browse_job_user_img" style="margin-top: 33px;" src="<?php 
            echo assets_path('uploads/profile/' . $value->profile_image);
            ?>
">
                                    </div>
                                    <div class="col-md-11">
                                        <h6><?php 
            echo nice_date($value->time, 'd M Y');
            ?>
</h6>
                                         <p class="alert alert-success" id="othermsg" ><?php 
            echo $value->message;
            ?>
</p>
                                    </div>
                                </div>
                            <?php 
开发者ID:Hussu,项目名称:jobdesk,代码行数:31,代码来源:view.php

示例8: fuelify

 function fuelify($output)
 {
     // if not logged in then we remove the markers
     if (!$this->_CI->config->item('admin_enabled', 'fuel') or $this->variables('fuelified') === FALSE or !$this->_fuelified or empty($output) or defined('FUELIFY') and FUELIFY === FALSE) {
         return $this->remove_markers($output);
     }
     $this->_CI->load->library('session');
     // add top edit bar for fuel
     $this->_CI->config->module_load('fuel', 'fuel', TRUE);
     // render the markers to the proper html
     $output = $this->render_all_markers($output);
     // set main image and assets path before switching to fuel assets path
     $vars['init_params'] = array('assetsImgPath' => img_path(''), 'assetsPath' => assets_path(''));
     $this->_CI->asset->assets_path = $this->_CI->config->item('fuel_assets_path', 'fuel');
     $this->_CI->load->helper('ajax');
     $this->_CI->load->library('form');
     $vars['page'] = $this->properties();
     $vars['layouts'] = $this->_CI->fuel_layouts->layouts_list(TRUE);
     $editable_asset_types = $this->_CI->config->item('editable_asset_filetypes', 'fuel');
     // add javascript
     $vars['init_params']['pageId'] = !empty($vars['page']['id']) ? $vars['page']['id'] : 0;
     $vars['init_params']['basePath'] = WEB_PATH;
     $vars['init_params']['imgPath'] = img_path('', 'fuel');
     $vars['init_params']['cssPath'] = css_path('', 'fuel');
     $vars['init_params']['jsPath'] = js_path('', 'fuel');
     $vars['assetsAccept']['assetsAccept'] = !empty($editable_asset_types['media']) ? $editable_asset_types['media'] : 'jpg|gif|png';
     // database specific... so we must check the fuel mode to see if we actually need to make a call to the database.
     // otherwise we get an error when the mode is set to views
     if ($this->_CI->config->item('fuel_mode', 'fuel') == 'views') {
         $vars['others'] = array();
     } else {
         $this->_CI->load->module_model(FUEL_FOLDER, 'pages_model');
         $vars['others'] = $this->_CI->pages_model->get_others('location', $this->location, 'location');
     }
     if (!$this->_fuelified_processed) {
         $inline_edit_bar = $this->_CI->load->module_view(FUEL_FOLDER, '_blocks/inline_edit_bar', $vars, TRUE);
         $output = str_replace('</head>', css('fuel_inline', 'fuel') . "\n</head>", $output);
         $output = str_replace('</body>', $inline_edit_bar . "\n</body>", $output);
         $this->_CI->config->set_item('assets_path', $this->_CI->config->item('assets_path'));
     }
     $this->_fuelified_processed = TRUE;
     return $output;
 }
开发者ID:reith2004,项目名称:FUEL-CMS,代码行数:43,代码来源:Fuel_page.php

示例9: fuelify

 /**
  * Renders the inline editing markers before final output
  *
  * @access	public
  * @param	string	The output to be rendered
  * @return	string
  */
 public function fuelify($output)
 {
     // if not logged in then we remove the markers
     if (!$this->fuel->config('admin_enabled') or $this->variables('fuelified') === FALSE or !$this->_fuelified or empty($output) or defined('FUELIFY') and FUELIFY === FALSE) {
         return $this->remove_markers($output);
     }
     $this->CI->load->helper('convert');
     // add top edit bar for fuel
     $this->CI->config->module_load('fuel', 'fuel', TRUE);
     // render the markers to the proper html
     $output = $this->render_all_markers($output);
     // set main image and assets path before switching to fuel assets path
     $vars['init_params'] = array('assetsImgPath' => img_path(''), 'assetsPath' => assets_path(''));
     $orig_asset_path = $this->CI->asset->assets_path;
     $this->CI->asset->assets_path = $this->fuel->config('fuel_assets_path');
     $this->CI->load->helper('ajax');
     $this->CI->load->library('form');
     $last_page = uri_path();
     if (empty($last_page)) {
         $last_page = $this->fuel->config('default_home_view');
     }
     $vars['last_page'] = uri_safe_encode($last_page);
     if (!$this->_fuelified_processed) {
         // create the inline edit toolbar
         $inline_edit_bar = $this->fuel->admin->toolbar();
         $fuel_js_obj = "<script>if (typeof fuel == 'undefined') fuel = {}</script>\n";
         $inline_css = css('fuel_inline', 'fuel', array('output' => $this->fuel->config('fuel_assets_output')));
         $output = preg_replace('#(</head>)#i', $fuel_js_obj . $inline_css . "\n\$1", $output);
         $output = preg_replace('#(</body>)#i', $inline_edit_bar . "\n\$1", $output);
         $this->CI->config->set_item('assets_path', $this->CI->config->item('assets_path'));
     }
     $this->_fuelified_processed = TRUE;
     $this->CI->asset->assets_path = $orig_asset_path;
     return $output;
 }
开发者ID:prgoncalves,项目名称:Beatcrumb-web,代码行数:42,代码来源:Fuel_pages.php

示例10: assets_path

                                            <img src="<?php 
        echo $image_path;
        ?>
"  width="20" style="border-radius: 50%; margin: 2px 4px 0 -10px; float: left">
                                            <h3 class="panel-title" style="margin:0; float: left"><?php 
        echo $value->first_name;
        ?>
</h3>
                                            <h3 class="pull-right" style="margin:0; ">$<?php 
        echo $value->price;
        ?>
</h3>
                                        </div>
                                        <div class="panel-body">
                                            <img class="responsive" height="160" style="width: 100%" src="<?php 
        echo assets_path('/uploads/hourlies/' . $value->media);
        ?>
" width="197">
                                             <P style="margin-top:5px; min-height: 44px">
                                                 <?php 
        echo character_limiter($value->description, 40);
        ?>
                                             </P>
                                        </div>
                                    </div>
                                </div>
                            <?php 
    }
    ?>
                            <?php 
}
开发者ID:Hussu,项目名称:jobdesk,代码行数:31,代码来源:dashboard.php

示例11: assets_path

        }
        ?>
 </span>
                                    </div>
                                    <div class="col-md-6">
                                        <span class=" job_price" >$<?php 
        echo $value->rate;
        ?>
</span>
                                    </div>
                                </div>
                                <div class="col-md-12" style="padding-top: 20px  ">
                                    <div class="col-md-3">
                                        <div class="col-md-3" style="padding-left: 0">
                                            <?php 
        $image_path = !empty($value->profile_image) ? assets_path('uploads/profile/' . $value->profile_image) : assets_path('images/default_profile.jpg');
        ?>
                                            <img src="<?php 
        echo $image_path;
        ?>
" class="browse_job_user_img">
                                        </div>
                                        <div class="col-md-9">
                                            <p style="margin-bottom:0; margin-left: 10px"><?php 
        echo $value->first_name;
        ?>
 </p>
                                            <p style="margin-left: 10px"><strong><?php 
        $addressArray = explode(',', $value->address);
        echo end($addressArray);
        ?>
开发者ID:Hussu,项目名称:jobdesk,代码行数:31,代码来源:browse.php

示例12: boot

 /**
  * Bootstrap the application events.
  *
  * @return void
  */
 public function boot()
 {
     $this->publishes([__DIR__ . '/config/form.php' => config_path('form.php'), __DIR__ . '/assets' => assets_path('regulus/formation')]);
     $this->loadTranslationsFrom(__DIR__ . '/lang', 'formation');
     $this->loadViewsFrom(__DIR__ . '/views', 'formation');
 }
开发者ID:aquanode,项目名称:formation,代码行数:11,代码来源:FormationServiceProvider.php

示例13: assets_path

<h4><strong>These are the steps in the following tutorial:</strong></h4>
<ol>
  <li><a href="#setup">Download and Setup</a></li>
  <li><a href="#authors_module">The Authors Module</a></li>
  <li><a href="#articles_module">The Articles Module</a></li>
  <li><a href="#categories_module">The FUEL Tags Module</a></li>
  <li><a href="#permissions">Setting Up Permissions</a></li>
  <li><a href="#polishing">A Little Polishing</a></li>
  <li><a href="#views">Bringing it All Into View</a></li>
</ol>

<h2 id="setup">Download and Setup</h2>

<p>Before we get started with this tutorial, it is recommended that you <a href="<?php 
echo assets_path('fuel_modules_example.zip', 'docs', FUEL_FOLDER);
?>
"><strong>download the final files of the example</strong></a> and look them over briefly so it is easier to follow along.</p>

<p>You will need to <a href="<?php 
echo user_guide_url('installation/db-setup');
?>
">setup an instance of FUEL including the database</a> with a working admin login.
We will use that FUEL database to store the additional tables required for our models in this tutorial.</p>

<p>We will be creating two database tables to support the 2 modules &mdash; an authors table and an articles table. The fuel_tags table is already created for us.</p>


<h2 id="authors_module">The Authors Module</h2>
<p>We will start this tutorial by creating the authors module first. The authors module will be used to contain the list of article's authors.</p>
<p>In many cases, to get started creating a simple module, you will want to use the <a href="<?php 
开发者ID:nonconforme,项目名称:FUEL-CMS,代码行数:30,代码来源:tutorial.php

示例14: defined

<?php

defined('BASEPATH') or exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Omah Bocah</title>
  <link rel="shortcut icon" href="<?php 
echo assets_path('img/favicon.ico');
?>
">
  <link id="basePath" href="<?php 
echo site_url();
?>
" />
  <?php 
echo assets_js('angular/angular.min.js');
?>
  <?php 
echo assets_js('angular/angular-route.min.js');
?>
  <?php 
echo assets_js('jquery.min.js');
?>
  <?php 
echo assets_js('bootstrap.min.js');
?>
  <?php 
echo assets_js('date.js');
开发者ID:haydarmiftahul,项目名称:omahbocah,代码行数:31,代码来源:v_dashboard_teacher.php

示例15: asset

    /**
     * Creates an asset select/upload field
     *
     * @access	public
     * @param	array Fields parameters
     * @return	string
     */
    public function asset($params)
    {
        $this->CI->load->helper('file');
        $this->CI->load->helper('html');
        $form_builder =& $params['instance'];
        if (empty($params['folder'])) {
            $params['folder'] = 'images';
        }
        $asset_class = '';
        if (!isset($params['select']) or isset($params['select']) and $params['select'] !== FALSE) {
            $asset_class .= ' asset_select';
        }
        if (!isset($params['upload']) or isset($params['upload']) and $params['upload'] !== FALSE) {
            $asset_class .= ' asset_upload';
        }
        $asset_class .= ' ' . $params['folder'];
        $params['class'] = !empty($params['class']) ? $params['class'] . ' ' . $asset_class : $asset_class;
        // set the image preview containing class
        if (empty($params['img_container_styles'])) {
            $params['img_container_styles'] = 'overflow: auto; height: 200px; width: 400px; margin-top: 5px;';
        }
        // set the styles specific to the image
        if (!isset($params['img_styles'])) {
            $params['img_styles'] = 'float: left; width: 100px;';
        }
        // folders and intended contents
        $editable_filetypes = $this->fuel->config('editable_asset_filetypes');
        // set data parameters so that we can use them with the JS
        // set multiple and separator data attributes so can be used by javascript
        if (!isset($params['multiple'])) {
            $multiple = !empty($params['multiple']) or strpos($params['value'], ',') !== FALSE;
        } else {
            $multiple = $params['multiple'];
        }
        // set the separator based on if it is multiple lines or just a single line
        $separator = (isset($params['multiline']) and $params['multiline'] === TRUE) ? "\n" : ', ';
        $params['data'] = array('multiple' => $multiple, 'separator' => $separator, 'folder' => $params['folder']);
        if (!empty($params['value'])) {
            if (is_string($params['value'])) {
                // unserialize if it is a serialized string
                if (is_json_str($params['value'])) {
                    $assets = json_decode($params['value'], TRUE);
                    //$assets = unserialize($params['value']);
                } else {
                    if ($multiple) {
                        // create assoc array with key being the image and the value being either the image name again or the caption
                        $assets = preg_split('#\\s*,\\s*|\\n#', $params['value']);
                    } else {
                        $assets = array($params['value']);
                    }
                }
                $preview_str = '';
                // loop through all the assets and concatenate them
                foreach ($assets as $asset) {
                    if (!empty($asset)) {
                        $asset_path = '';
                        foreach ($editable_filetypes as $folder => $regex) {
                            if (!is_http_path($asset)) {
                                if (preg_match('#' . $regex . '#i', $asset)) {
                                    $path = trim($params['folder'], '/') . '/' . $asset;
                                    $asset_path = assets_path($path);
                                    break;
                                }
                            } else {
                                $asset_path = $asset;
                            }
                        }
                        if (!empty($asset_path)) {
                            $preview_str .= '<a href="' . $asset_path . '" target="_blank">';
                            if (isset($params['is_image']) or !isset($params['is_image']) and is_image_file($asset)) {
                                $preview_str .= '<img src="' . $asset_path . '" style="' . $params['img_styles'] . '"/>';
                            } else {
                                $preview_str .= $asset;
                            }
                            $preview_str .= '</a>';
                        }
                    }
                }
            }
            $preview = '';
            if (!empty($preview_str)) {
                $img_container_styles = $params['img_container_styles'];
                if ($multiple == FALSE and !empty($params['img_styles'])) {
                    $img_container_styles = $params['img_styles'];
                }
                $preview = '<br /><div class="noclone" style="' . $img_container_styles . '">';
                $preview .= $preview_str;
                $preview .= '</div><div class="clear"></div>';
            }
            $params['after_html'] = $preview;
        }
        $params['type'] = '';
        if ($multiple) {
//.........这里部分代码省略.........
开发者ID:ressphere,项目名称:cb_iloveproperty,代码行数:101,代码来源:Fuel_custom_fields.php


注:本文中的assets_path函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。