• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP public_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testCanBrowseOtherUsersPrivateExhibits

 /**
  * Contributors should be able to browse other users' private exhibits.
  */
 public function testCanBrowseOtherUsersPrivateExhibits()
 {
     $this->dispatch('neatline');
     $this->assertNotAction('forbidden');
     // Should list other user's private exhibit.
     $this->assertXpath('//a[@class="neatline"][@href="' . public_url('neatline/show/slug1') . '"]');
 }
开发者ID:saden1,项目名称:Neatline,代码行数:10,代码来源:AllowTest.php


示例2: getRecordUrl

 public function getRecordUrl($action = 'show')
 {
     if ('show' == $action) {
         return public_url($this->slug);
     }
     return array('module' => 'catalog-search', 'controller' => 'index', 'action' => $action, 'id' => $this->id);
 }
开发者ID:amandafrench,项目名称:plugin-CatalogSearch,代码行数:7,代码来源:CatalogSearchSearch.php


示例3: link_to

 public static function link_to($args, $attributes)
 {
     $text = isset($args[1]) ? $args[1] : $args[0];
     $app_key = \Hook\Application\Context::getKey();
     $public_url = public_url($args[0]) . '?X-App-Id=' . $app_key->app_id . '&X-App-Key=' . $app_key->key;
     return array('<a href="' . $public_url . '"' . html_attributes($attributes) . '>' . $text . '</a>', 'raw');
 }
开发者ID:CFLOVEYR,项目名称:hook,代码行数:7,代码来源:Helper.php


示例4: testCanBrowsePublicExhibits

 /**
  * Anonymous users should be able to browse public exhibits.
  */
 public function testCanBrowsePublicExhibits()
 {
     $this->dispatch('neatline');
     $this->assertNotAction('login');
     // Should list public exhibit.
     $this->assertXpath('//a[@class="neatline"][@href="' . public_url('neatline/show/slug') . '"]');
 }
开发者ID:saden1,项目名称:Neatline,代码行数:10,代码来源:AllowTest.php


示例5: testOverrideSearchFormAction

 /**
  * The simple search form should point to the Solr Search interceptor.
  */
 public function testOverrideSearchFormAction()
 {
     $this->dispatch('');
     // Get the interceptor URL.
     $url = public_url('solr-search/results/interceptor');
     // Should override the default search action.
     $this->assertXpath("//form[@id='search-form'][@action='{$url}']");
 }
开发者ID:fitnycdigitalinitiatives,项目名称:SolrSearch,代码行数:11,代码来源:InterceptSearchTest.php


示例6: testPagination

 /**
  * When the number of results exceeds the page length, the maximum number
  * of results and the pagination should be displayed.
  */
 public function testPagination()
 {
     // Set public page length to 2.
     set_option('per_page_public', 2);
     $item1 = $this->_item(true, 'Item 1');
     $item2 = $this->_item(true, 'Item 2');
     $item3 = $this->_item(true, 'Item 3');
     $item4 = $this->_item(true, 'Item 4');
     $item5 = $this->_item(true, 'Item 5');
     $item6 = $this->_item(true, 'Item 6');
     // --------------------------------------------------------------------
     // Page 1.
     $this->dispatch('solr-search');
     // Should just list items 1-2.
     $this->assertXpath('//a[@href="' . record_url($item1) . '"]');
     $this->assertXpath('//a[@href="' . record_url($item2) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item3) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item4) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item5) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item6) . '"]');
     // Should link to page 2.
     $next = public_url('solr-search?page=2');
     $this->assertXpath('//a[@href="' . $next . '"]');
     $this->resetResponse();
     $this->resetRequest();
     // --------------------------------------------------------------------
     // Page 2.
     $_GET['page'] = '2';
     $this->dispatch('solr-search');
     // Should just list items 3-4.
     $this->assertNotXpath('//a[@href="' . record_url($item1) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item2) . '"]');
     $this->assertXpath('//a[@href="' . record_url($item3) . '"]');
     $this->assertXpath('//a[@href="' . record_url($item4) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item5) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item6) . '"]');
     // Should link to page 3.
     $next = public_url('solr-search?page=3');
     $this->assertXpath('//a[@href="' . $next . '"]');
     $this->resetResponse();
     $this->resetRequest();
     // --------------------------------------------------------------------
     // Page 3.
     $_GET['page'] = '3';
     $this->dispatch('solr-search');
     // Should just list items 5-6.
     $this->assertNotXpath('//a[@href="' . record_url($item1) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item2) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item3) . '"]');
     $this->assertNotXpath('//a[@href="' . record_url($item4) . '"]');
     $this->assertXpath('//a[@href="' . record_url($item5) . '"]');
     $this->assertXpath('//a[@href="' . record_url($item6) . '"]');
     // Should link back to page 2.
     $prev = public_url('solr-search?page=2');
     $this->assertXpath('//a[@href="' . $prev . '"]');
     // --------------------------------------------------------------------
 }
开发者ID:fitnycdigitalinitiatives,项目名称:SolrSearch,代码行数:61,代码来源:PaginateResultsTest.php


示例7: nl_getExhibitUrl

/**
 * Returns a link to a Neatline exhibit.
 *
 * @param NeatlineExhibit|null $exhibit The exhibit record.
 * @param string $action The action for the link.
 * @return string The URL.
 */
function nl_getExhibitUrl($exhibit, $action, $public = true)
{
    $exhibit = $exhibit ? $exhibit : nl_getExhibit();
    if (in_array($action, array('show', 'fullscreen'))) {
        $identifier = $exhibit->slug;
    } else {
        $identifier = $exhibit->id;
    }
    $route = 'neatline/' . $action . '/' . $identifier;
    $href = $public ? public_url($route) : url($route);
    return $href;
}
开发者ID:saden1,项目名称:Neatline,代码行数:19,代码来源:Views.php


示例8: store

 public function store($filename, $data, $options = array())
 {
     $storage_dir = storage_dir(true);
     $public_dir = storage_dir(false);
     // create directory if it doesn't exists
     if (!is_dir($storage_dir)) {
         mkdir($storage_dir, 0777, true);
     }
     if (file_put_contents($storage_dir . $filename, $data)) {
         return public_url($public_dir . $filename);
     }
 }
开发者ID:hyhyxu,项目名称:hook,代码行数:12,代码来源:Filesystem.php


示例9: setUp

 public function setUp()
 {
     parent::setUp();
     $this->helper = new ExhibitBuilder_IntegrationHelper();
     $this->helper->setUpPlugin();
     $this->exhibit = $this->helper->createNewExhibit(true, false, 'Exhibit Title', 'Exhibit Description', 'Exhibit Credits', 'exhibit');
     $this->assertTrue($this->exhibit->exists());
     $maxPageCount = 3;
     $parentPage = null;
     for ($i = 1; $i <= $maxPageCount; $i++) {
         $exhibitPage = $this->helper->createNewExhibitPage($this->exhibit, $parentPage, 'Exhibit Page Title ' . $i, 'page' . $i, 1, 'text');
         $this->assertTrue($exhibitPage->exists());
         $parentPage = $exhibitPage;
     }
     $this->dispatch('exhibits/show/exhibit/page1/page2/page3');
     $this->basePageUrl = public_url('exhibits/show/exhibit');
 }
开发者ID:fitnycdigitalinitiatives,项目名称:plugin-ExhibitBuilder,代码行数:17,代码来源:ExhibitBuilderPageNavTest.php


示例10: nl_getExhibitLink

/**
 * Returns a link to a Neatline exhibit.
 *
 * @param NeatlineExhibit|null $exhibit The exhibit record.
 * @param string $action The action for the link.
 * @param string $text The link text.
 * @param array $props Array of properties for the element.
 * @return string The HTML link.
 */
function nl_getExhibitLink($exhibit, $action, $text, $props = array(), $public = true)
{
    // Get exhibit and link text.
    $exhibit = $exhibit ? $exhibit : nl_getExhibit();
    $text = $text ? $text : nl_getExhibitField('title');
    // Get the exhibit identifier (`id` or `slug`).
    if (in_array($action, array('show', 'fullscreen'))) {
        $identifier = $exhibit->slug;
    } else {
        $identifier = $exhibit->id;
    }
    // Construct the exhibit route.
    $route = 'neatline/' . $action . '/' . $identifier;
    $props['href'] = $public ? public_url($route) : url($route);
    // Return the anchor tag.
    return '<a ' . tag_attributes($props) . '>' . $text . '</a>';
}
开发者ID:sgbalogh,项目名称:peddler_clone5,代码行数:26,代码来源:Views.php


示例11: exhibit_builder_exhibit_uri

/**
 * Return a URI to an exhibit.
 *
 * @param Exhibit $exhibit If null, it uses the current exhibit.
 * @param ExhibitPage $exhibitPage A specific page to link to
 * @return string
 */
function exhibit_builder_exhibit_uri($exhibit = null, $exhibitPage = null)
{
    if (!$exhibit) {
        $exhibit = get_current_record('exhibit');
    }
    $exhibitSlug = $exhibit instanceof Exhibit ? $exhibit->slug : $exhibit;
    //If there is no page slug available, we want to build a URL for the summary page
    if (!$exhibitPage) {
        $uri = public_url(array('slug' => $exhibitSlug), 'exhibitSimple');
    } else {
        $pagesTrail = $exhibitPage->getAncestors();
        $pagesTrail[] = $exhibitPage;
        $options = array();
        $options['slug'] = $exhibitSlug;
        foreach ($pagesTrail as $index => $page) {
            $adjustedIndex = $index + 1;
            $options["page_slug_{$adjustedIndex}"] = $page->slug;
        }
        $uri = public_url($options, 'exhibitShow', array(), true);
    }
    return $uri;
}
开发者ID:rshiggin,项目名称:omeka-custom-exhibit,代码行数:29,代码来源:ExhibitFunctions.php


示例12: _update_robots

 private function _update_robots()
 {
     $serverUrlHelper = new Zend_View_Helper_ServerUrl();
     $serverUrl = $serverUrlHelper->serverUrl();
     $sitemap_uri = $serverUrl . public_url('sitemap.xml');
     //update the site robots.txt file so it lists the sitemap
     // options for robots file
     $mapdef = "\n#START XML-SITEMAP-PLUGIN\n";
     $mapdef .= "Sitemap: " . $sitemap_uri . "\n";
     $mapdef .= "#END XML-SITEMAP-PLUGIN\n";
     // open file
     $robotspath = BASE_DIR . "/robots.txt";
     if (is_writeable($robotspath)) {
         $robotsfile = fopen($robotspath, 'a');
         //write to file
         fwrite($robotsfile, $mapdef);
         //close file
         fclose($robotsfile);
     } else {
         echo "Robots.txt file is not writeable";
     }
 }
开发者ID:pyscajor,项目名称:Sitemap,代码行数:22,代码来源:SitemapPlugin.php


示例13: testGetPageLinksForPublishedPages

 public function testGetPageLinksForPublishedPages()
 {
     $pages = $this->db->getTable('SimplePagesPage')->findAll();
     $this->assertEquals(1, count($pages));
     $aboutPage = $pages[0];
     $testPage1 = $this->_addTestPage('Test Title 1', 'testslug1', 'testtext1');
     $testPage1->parent_id = $aboutPage->id;
     $testPage1->order = 1;
     $testPage1->is_published = 1;
     $testPage1->save();
     $testPage2 = $this->_addTestPage('Test Title 2', 'testslug2', 'testtext2');
     $testPage2->parent_id = $aboutPage->id;
     $testPage2->order = 2;
     $testPage2->is_published = 1;
     $testPage2->save();
     $testPage3 = $this->_addTestPage('Test Title 3', 'testslug3', 'testtext3');
     $testPage3->parent_id = $aboutPage->id;
     $testPage3->order = 3;
     $testPage3->is_published = 0;
     $testPage3->save();
     $testPage4 = $this->_addTestPage('Test Title 4', 'testslug4', 'testtext4');
     $testPage4->parent_id = $testPage2->id;
     $testPage4->order = 1;
     $testPage4->is_published = 0;
     $testPage4->save();
     $testPage5 = $this->_addTestPage('Test Title 5', 'testslug5', 'testtext5');
     $testPage5->parent_id = $testPage2->id;
     $testPage5->order = 2;
     $testPage5->is_published = 1;
     $testPage5->save();
     $this->dispatch('/');
     $actualNavLinks = simple_pages_get_links_for_children_pages($aboutPage->id, 'order', true);
     $this->assertEquals(2, count($actualNavLinks));
     $expectedNavLinks = array();
     $expectedNavLinks[] = array('label' => 'Test Title 1', 'uri' => public_url('testslug1'));
     $expectedNavLinks[] = array('label' => 'Test Title 2', 'uri' => public_url('testslug2'), 'pages' => array(array('label' => 'Test Title 5', 'uri' => public_url('testslug5'))));
     $this->assertEquals($expectedNavLinks, $actualNavLinks);
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:38,代码来源:GetLinksForChildrenPagesTest.php


示例14: generate

 public function generate($products)
 {
     $tpl = '';
     if (!$products) {
         return $tpl;
     }
     $tpl .= '<ul>';
     foreach ($products as $row) {
         $tpl .= '<li>';
         if (isset($row['thumbnail']) && $row['thumbnail']) {
             $tpl .= '<a href="/i/' . $row['url'] . '" class="item">';
             $tpl .= '<img class="item-img" src="' . public_url() . '/products/' . $row['thumbnail'] . '" alt="" />';
         } else {
             $tpl .= '<a href="/i/' . $row['url'] . '" class="item none">';
         }
         $tpl .= '</a>';
         $tpl .= '<span class="item-price abs">' . $row['price'] . '<em>AED</em></span>';
         $tpl .= '<a class="btn-lg abs addcart-btn" data-addcart-id="' . $row['id'] . '" data-addcart-img="' . public_url() . '/products/' . (isset($row['thumbnail']) && $row['thumbnail'] ? $row['thumbnail'] : 'default.png') . '"><span class="glyphicon glyphicon-shopping-cart"></span></a>';
         $tpl .= '<p class="item-caption">' . $row['name'] . '</p>';
         $tpl .= '</li>';
     }
     $tpl .= '</ul>';
     return $tpl;
 }
开发者ID:nelsieborja,项目名称:qdosworld,代码行数:24,代码来源:ProductTpl.php


示例15: head

echo head(array('title' => $itemTitle, 'bodyclass' => 'items edit'));
include 'form-tabs.php';
echo flash();
?>

<form method="post" enctype="multipart/form-data" id="item-form" action="">
    <?php 
include 'form.php';
?>
    <section class="three columns omega">
        <div id="save" class="panel">
            <?php 
echo $this->formSubmit('submit', __('Save Changes'), array('id' => 'save-changes', 'class' => 'submit big green button'));
?>
            <a href="<?php 
echo html_escape(public_url('items/show/' . metadata('item', 'id')));
?>
" class="big blue button" target="_blank"><?php 
echo __('View Public Page');
?>
</a>
            <?php 
echo link_to_item(__('Delete'), array('class' => 'delete-confirm big red button'), 'delete-confirm');
?>
            
            <?php 
fire_plugin_hook("admin_items_panel_buttons", array('view' => $this, 'record' => $item));
?>
            
            <div id="public-featured">
                <?php 
开发者ID:lchen01,项目名称:STEdwards,代码行数:31,代码来源:edit.php


示例16: flash

echo flash();
?>

<form method="post">
    <?php 
include 'form.php';
?>

    <section class="three columns omega">
        <div id="save" class="panel">
            <input type="submit" name="submit" class="big green button" id="save-changes" value="<?php 
echo __('Save Changes');
?>
" />
            <a href="<?php 
echo html_escape(public_url('collections/show/' . metadata('collection', 'id')));
?>
" class="big blue button" target="_blank"><?php 
echo __('View Public Page');
?>
</a>
            <?php 
echo link_to_collection(__('Delete'), array('class' => 'big red button delete-confirm'), 'delete-confirm');
?>
            
            <?php 
fire_plugin_hook("admin_collections_panel_buttons", array('view' => $this, 'record' => $collection, 'collection' => $collection));
?>

            <div id="public-featured">
                <div class="public">
开发者ID:lchen01,项目名称:STEdwards,代码行数:31,代码来源:edit.php


示例17: public_url

					<span class="item-caption abs">Jackets</span>
				</a>
			</li>
			<li>
				<a href="/c/test" class="item rel">
					<img class="item-img abs" src="<?php 
echo public_url();
?>
/images/category/shorts.jpg" alt="" />
					<span class="item-caption abs">Shorts</span>
				</a>
			</li>
			<li>
				<a href="/c/dresses" class="item rel">
					<img class="item-img abs" src="<?php 
echo public_url();
?>
/images/category/dresses.jpg" alt="" />
					<span class="item-caption abs">Dresses</span>
				</a>
			</li>
		</ul>
		<div class="clearfix"></div>
	</div>
	
	<div class="product-list float-li">
		<h2 class="product-list-caption">Great offers</h2>
		<?php 
if (isset($offers_tpl) && $offers_tpl) {
    ?>
			<?php 
开发者ID:nelsieborja,项目名称:qdosworld,代码行数:31,代码来源:home.php


示例18: public_url

                        </div>
                        <div>
                            <div>
                                <h3> Metered Previews </h3>
                            </div>
                            <div class="element-intro font-small">
                                <p>
                                    Introduce new users to your content by setting a number of free views.  
                                </p>
                            </div>
                        </div>
                    </div>
                    <div class="features-body-two-element col-xs-12 col-sm-12 col-md-4 col-lg-4">
                        <div>
                            <img src="<?php 
echo public_url() . "imgs/feature9.png";
?>
">
                        </div>
                        <div>
                            <div>
                                <h3> Branding </h3>
                            </div>
                            <div class="element-intro font-small">
                                <p>
                                    Upload your logo to have it appear in the subscription prompt.  
                                </p>
                            </div>
                        </div>
                    </div>                    
                </div> <!--Body 2 Row 3-->
开发者ID:leyuan,项目名称:ViewPal,代码行数:31,代码来源:features.php


示例19: nl_getOpenLayersThemeDir

/**
 * Get the path to the OpenLayers theme.
 *
 * @return string The theme path.
 */
function nl_getOpenLayersThemeDir()
{
    return public_url('plugins/Neatline/views/shared/images/dark/');
}
开发者ID:saden1,项目名称:Neatline,代码行数:9,代码来源:Assets.php


示例20: base_url

<!-- Webmaster_howdy Body Page -->
<section class="upper-body">
    <div class="wmsign-upper-body upper-body">
        <!-- Fixed navbar -->
        <div class="navbar navbar-default" role="navigation">
          <div class="container nav-container">
            <div class="navbar-header">
                <span class="logo text-right"><a class="navbar-brand" href="<?php 
echo base_url();
?>
"><img src="<?php 
echo public_url() . "imgs/logo_white.png";
?>
" class="nav-logo"></a></span>
            </div>
          </div>
        </div>
        
        <div class="headline">
            <div class="container">
                <div class="headline-main-title">
                    <h1>Webmaster</h1>
                </div>
                <div class="headline-sub-title">
                    <h3>Only one step left</h3>
                </div>
            </div>
        </div>
    </div>  
</section>
开发者ID:leyuan,项目名称:ViewPal,代码行数:30,代码来源:welcome.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP public_value函数代码示例发布时间:2022-05-15
下一篇:
PHP public_path函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap