kohana View helper

<?php //echo Form::open();?>
<?php echo Form::open(URL::site('/user','http'), array('enctype' => 'multipart/form-data','class' => 'form1')); ?>
<?php if ($errors):?>
<p class="message">this is register form test</p>
<ul class="errors">
<?php foreach ($errors as $message):?>
<li><?php echo $message;?></li>
<?php endforeach;?>
</ul>
<?php endif;?>
<dl>
<dt><?php echo Form::label('username','UserName');?></dt>
<dd><?php echo Form::input('username',$post['username']);?></dd>
<dt><?php echo Form::label('password','Password');?></dt>
<dd><?php echo Form::password('password',$post['password']);?></dd>
<dt><?php echo Form::label('confirm','Confirm Password');?></dt>
<dd><?php echo Form::password('confirm',$post['password']);?></dd>
<dt><?php echo Form::label('use_ssl','User extra security?');?></dt>
<dd><?php echo Form::select('use_ssl',array('yes'=>'Always','no'=>'Only when necessary'));?></dd>
<dd class="help">For security, SSL is always used when making payments.</dd>
<dt><?php echo Form::label('terms', 'Terms of service')?></dt>
<dd><?php echo Form::checkbox('terms', 'agree', false, array('class' =>'terms')); ?>By checking this box you agree to our Terms of Service</dd>
<dt><?php echo Form::label('avatar', 'Avatar')?></dt>
<dd><?php echo Form::file('avatar'); ?></dd>
<dt><?php echo Form::label('message', 'New Message'); ?></dt>
<dd><?php echo Form::textarea('message'); ?></dd>
<dt>Date</dt>
<dd><?php echo Date::fuzzy_span(time());// Prints "moments ago" ?></dd>
<dd><?php echo Date::fuzzy_span(time()-500);// Prints "a few minutes ago" ?></dd>
<dd><?php echo Date::fuzzy_span(time()-5000); // Prints "a couple ofhours ago" ?> </dd>
<dd><?php echo Date::adjust(8, 'pm'); // Prints "20" ?></dd>
<dd><?php echo Date::ampm(13); // Prints 'PM' ?></dd>
<dd><?php echo Date::ampm(3); // Prints 'AM' ?></dd>

<dt>HTML</dt>
<dd><?php echo HTML::chars('<script type="javascript">alert("xss");</script>'); ?> </dd>
<dd><?php //echo HTML::obfuscate('Some Member Name'); ?></dd>
<dd><?php //echo HTML::email('[email protected]'); ?></dd>
<dd><?php echo HTML::anchor('/welcome', 'Welcome Page',array('class'=>'link')); ?></dd>
<dd><?php echo HTML::image('touch-icon-iphone.png', array('alt' => 'Alt Text')); ?></dd>
<dd><?php echo HTML::mailto('[email protected]', 'Email Someone', array('class' => 'email_addy')); ?></dd>
<dd><?php echo Inflector::underscore('narwhals are real'); // Returns:narwhals_are_real ?></dd>
<dd><?php echo Inflector::humanize('narwhals_are_real'); // Returns:narwhals are real ?></dd>
<dd><?php echo Inflector::humanize('bacon-tastes-good'); // Returns: bacon tastes good ?></dd>
<dd><?php echo URL::title('Narwhals are real - "Breaking News"'); //Prints: narwhals-are-real-breaking-news ?></dd>
<dd><?php echo URL::base(true);?></dd>
<dd><?php echo URL::base(true,'https');?></dd>
<dd><?php echo URL::site('foo/bar/baz', 'https');// Prints: https://localhost/egotist/foo/bar/baz ?></dd>
<dd><?php echo URL::site('/','http');// Prints: http://localhost/egotist/?></dd>

<dd><?php echo URL::query(array('page' => 12, 'keyword' => 'narwal')); ?></dd>
<dd><?php echo Arr::get($_POST,'username','patrick');?></dd>
<dd><?php echo Arr::get($_GET,'id','100');?></dd>

<dd>
<?php
$array_1 = array(
'first_name' => 'Joe',
'last_name' => 'User'
);
$array_2 = array(
'first_name' => 'Jason',
'last_name' => 'Straughan'
);
$array_3 = array(
'first_name' => 'Ken',
'last_name' => 'Jones'
);
$arrayList = array($array_1, $array_2, $array_3);
$first_names = Arr::pluck($arrayList, 'first_name');
echo "<pre>";
var_dump($first_names);
echo "</pre>";
?>
</dd>
<dd>
<?php
	$multi = array(
		'id' => 1,
		'favorite_foods' => array(
			'bacon', 'cheeseburgers', 'pizza'
		)
	);
	$flat = Arr::flatten($multi);
	echo "<pre>";
	var_dump($flat);
	echo "</pre>";
?>
</dd>
<dd>

<?php
	$user = array(
		'id' => 42,
		'userinfo' => array(
			'first_name' => 'Jason',
			'last_name' => 'Straughan',
			'username' => 'jdstraughan'
		)
	);
	$big_user = Arr::map('strtoupper', $user);
	echo "<pre>";
	var_dump($big_user);
	echo "</pre>";
?>
</dd>
<dd><?php echo Cookie::get('username'); ?></dd>

<dt>
<?php 
	$content = 'This is a test message';
	$author = 'Joe Tester';
	$timestamp = time() - 2500;
	echo Html::message($content, $author, $timestamp);
?>
</dt>

</dl>

<?php echo Form::submit(null,'Sign Up');?>
<?php echo Form::close();?>

猜你喜欢

转载自wuchengyi.iteye.com/blog/1883360
今日推荐