navbarSearchForm() public static method

Generates a navbar search form.
public static navbarSearchForm ( mixed $action, string $method = 'post', array $htmlOptions = [] ) : string
$action mixed the form action URL.
$method string form method (e.g. post, get).
$htmlOptions array additional HTML attributes
return string the generated form.
示例#1
0
            'items' => array(
                array('label' => 'Home', 'url' => '#', 'active' => true),
                array('label' => 'Link', 'url' => '#'),
                array('label' => 'Link', 'url' => '#'),
            ),
        ),
    ),
)); ?></pre>

	<hr class="bs-docs-separator">

	<h3>Search form</h3>

	<div class="bs-docs-example">
		<?php 
$this->widget('bootstrap.widgets.TbNavbar', array('brandLabel' => 'Title', 'items' => array(TbHtml::navbarSearchForm('#'))));
?>
	</div>

	<pre class="prettyprint linenums">
&lt;?php $this->widget('bootstrap.widgets.TbNavbar', array(
    'brandLabel' => 'Title',
    'items' => array(
        TbHtml::navbarSearchForm('#'),
    ),
));</pre>

	<hr class="bs-docs-separator">

	<h2>Optional display variations</h2>
示例#2
0
 public function testNavbarSearchForm()
 {
     $I = $this->codeGuy;
     $html = TbHtml::navbarSearchForm('#');
     $I->createNode($html, 'form.navbar-search');
 }
示例#3
0
            'items' => array(
                array('label' => 'Home', 'url' => '#', 'active' => true),
                array('label' => 'Link', 'url' => '#'),
                array('label' => 'Link', 'url' => '#'),
            ),
        ),
    ),
)); ?></pre>

    <hr class="bs-docs-separator">

    <h3>Search form</h3>

    <div class="bs-docs-example">
        <?php 
$this->widget('bootstrap.widgets.TbNavbar', array('display' => TbHtml::NAVBAR_DISPLAY_NONE, 'brandLabel' => 'Title', 'items' => array(TbHtml::navbarSearchForm('#'))));
?>
    </div>

    <pre class="prettyprint linenums">
&lt;?php $this->widget('bootstrap.widgets.TbNavbar', array(
    'brandLabel' => 'Title',
    'items' => array(
        TbHtml::navbarSearchForm('#'),
    ),
));</pre>

    <hr class="bs-docs-separator">

    <h2>Display variations</h2>
示例#4
0
echo Yii::app()->request->baseUrl;
?>
/css/form.css" />

	<title><?php 
echo CHtml::encode($this->pageTitle);
?>
</title>
</head>

<body>
<div id="wrap">
	<div class="container" id="page">
			<div id="mainmenu">
				<?php 
$this->widget('bootstrap.widgets.TbNavbar', array('color' => TbHtml::NAVBAR_COLOR_INVERSE, 'brandLabel' => CHtml::encode(Yii::app()->name), 'collapse' => true, 'items' => array(array('class' => 'bootstrap.widgets.TbNav', 'items' => array(array('label' => 'Home', 'url' => array('/')), array('label' => 'Pests', 'url' => array('pest/'), 'visible' => !Yii::app()->user->isGuest), array('label' => 'Plants / Leafs', 'url' => array('/plantleaf/'), 'visible' => !Yii::app()->user->isGuest), array('label' => 'Tubers', 'url' => array('/tuber/'), 'visible' => !Yii::app()->user->isGuest), array('label' => 'Tutorials', 'url' => array('/tutorial/'), 'visible' => !Yii::app()->user->isGuest), array('label' => 'Login', 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest), TbHtml::navbarSearchForm('#'), array('label' => 'Logout (' . Yii::app()->user->name . ')', 'url' => array('/site/logout'), 'visible' => !Yii::app()->user->isGuest))))));
?>
			</div><!-- mainmenu -->
			<?php 
if (isset($this->breadcrumbs)) {
    ?>
				<?php 
    $this->widget('bootstrap.widgets.TbBreadcrumb', array('links' => $this->breadcrumbs));
    ?>
<!-- breadcrumbs -->
			<?php 
}
?>


		<?php