Example #1
0
 /**
  * Test function associated with HeadMeta
  *
  * @return void
  * @test
  */
 public function testHeadMetaViewFunctions()
 {
     zbase_config_set('view.autoload.plugins', []);
     $this->assertInstanceOf(Zbase\Models\View\HeadMeta::class, zbase_view_head_meta_add('viewport', 'width=1020', null, null, ['http-equiv' => 'Content-Language']));
     $links = ['linkOne' => ['content' => 'width=1020', 'name' => 'viewport'], 'linkTwo' => ['content' => 'width=1020', 'name' => 'viewport'], 'linkThree' => ['content' => 'width=1020', 'name' => 'viewport'], 'linkFour' => ['content' => 'width=1020', 'name' => 'viewport']];
     $this->assertEquals(7, count(zbase_view_head_metas_set($links)));
     $this->assertInstanceOf(Zbase\Models\View\HeadMeta::class, zbase_view_head_meta('linkThree'));
     $this->assertNotInstanceOf(Zbase\Models\View\HeadMeta::class, zbase_view_head_meta('linkFive'));
     $this->assertTrue(zbase_view_head_meta_has('linkThree'));
     $this->assertFalse(zbase_view_head_meta_has('linkFive'));
     $this->assertEquals(7, count(zbase_view_head_metas($links)));
 }
Example #2
0
/**
 * SEt the Meta Keywords
 *
 * @param string $keywords
 */
function zbase_view_meta_keywords($keywords)
{
    zbase_view_head_meta_add('keywords', $keywords);
}
Example #3
0
<?php

zbase_view_head_meta_add('_token', zbase_csrf_token());
?>
<div class="row">
	<div class="col-md-6">
		<form method="post" action="<?php 
echo zbase_url_from_route('siteImageUpload');
?>
" enctype="multipart/form-data">
			<?php 
echo zbase_csrf_token_field();
?>
			<div class="form-group">
				<label for="imageUpload">Upload Image</label>
				<input type="file" name="file" id="imageUpload">
			</div>
			<button type="submit" class="btn btn-default">Upload</button>
		</form>
	</div>
	<div class="col-md-6">
		<?php 
if (!empty($image)) {
    ?>
			<hr />
			<?php 
    $fontMaps = zbase_config_get('zivsluck.fontmaps');
    $dataCustomize = [];
    ?>
			<div class="form-group"  id="form-group-font">
				<label for="font">Font</label>
Example #4
0
/**
 * The Facebook Head Meta tags
 * 	https://davidwalsh.name/facebook-meta-tags
 * 	Minimum Facebook Head Metas
 * 		title: The title to accompany the URL; In most cases, this should be the article or page title.
 * 		type: Provides Facebook the type of website that you would like your website to be categorized by; blog|article
 * 		locale
 * 		site_name: Provides Facebook the name that you would like your website to be recognized by:
 * 		url: The URL should be the canonical address for the given page:
 * 		description
 * 		image
 * 		app_id = Facebook APP Id
 *
 * @param array $metas AssocArray of Facebook Metas
 * @return void
 */
function zbase_view_facebook_meta($metas)
{
    foreach ($metas as $key => $val) {
        if ($key == 'app_id') {
            zbase_view_head_meta_add('fb:app_id' . $key, $val);
            continue;
        }
        zbase_view_head_meta_add('og:' . $key, $val);
    }
}