Added new (clean) yii boilerplate
This commit is contained in:
6
www/protected/views/layouts/column1.php
Normal file
6
www/protected/views/layouts/column1.php
Normal file
@@ -0,0 +1,6 @@
|
||||
<?php /* @var $this Controller */ ?>
|
||||
<?php $this->beginContent('//layouts/main'); ?>
|
||||
<div id="content">
|
||||
<?php echo $content; ?>
|
||||
</div><!-- content -->
|
||||
<?php $this->endContent(); ?>
|
||||
22
www/protected/views/layouts/column2.php
Normal file
22
www/protected/views/layouts/column2.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php /* @var $this Controller */ ?>
|
||||
<?php $this->beginContent('//layouts/main'); ?>
|
||||
<div class="span-19">
|
||||
<div id="content">
|
||||
<?php echo $content; ?>
|
||||
</div><!-- content -->
|
||||
</div>
|
||||
<div class="span-5 last">
|
||||
<div id="sidebar">
|
||||
<?php
|
||||
$this->beginWidget('zii.widgets.CPortlet', array(
|
||||
'title'=>'Operations',
|
||||
));
|
||||
$this->widget('zii.widgets.CMenu', array(
|
||||
'items'=>$this->menu,
|
||||
'htmlOptions'=>array('class'=>'operations'),
|
||||
));
|
||||
$this->endWidget();
|
||||
?>
|
||||
</div><!-- sidebar -->
|
||||
</div>
|
||||
<?php $this->endContent(); ?>
|
||||
59
www/protected/views/layouts/main.php
Normal file
59
www/protected/views/layouts/main.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php /* @var $this Controller */ ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="language" content="en" />
|
||||
|
||||
<!-- blueprint CSS framework -->
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
|
||||
<!--[if lt IE 8]>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
|
||||
<![endif]-->
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
|
||||
|
||||
<title><?php echo CHtml::encode($this->pageTitle); ?></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="container" id="page">
|
||||
|
||||
<div id="header">
|
||||
<div id="logo"><?php echo CHtml::encode(Yii::app()->name); ?></div>
|
||||
</div><!-- header -->
|
||||
|
||||
<div id="mainmenu">
|
||||
<?php $this->widget('zii.widgets.CMenu',array(
|
||||
'items'=>array(
|
||||
array('label'=>'Home', 'url'=>array('/site/index')),
|
||||
array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),
|
||||
array('label'=>'Contact', 'url'=>array('/site/contact')),
|
||||
array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
|
||||
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('zii.widgets.CBreadcrumbs', array(
|
||||
'links'=>$this->breadcrumbs,
|
||||
)); ?><!-- breadcrumbs -->
|
||||
<?php endif?>
|
||||
|
||||
<?php echo $content; ?>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<div id="footer">
|
||||
Copyright © <?php echo date('Y'); ?> by My Company.<br/>
|
||||
All Rights Reserved.<br/>
|
||||
<?php echo Yii::powered(); ?>
|
||||
</div><!-- footer -->
|
||||
|
||||
</div><!-- page -->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
85
www/protected/views/site/contact.php
Normal file
85
www/protected/views/site/contact.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/* @var $this SiteController */
|
||||
/* @var $model ContactForm */
|
||||
/* @var $form CActiveForm */
|
||||
|
||||
$this->pageTitle=Yii::app()->name . ' - Contact Us';
|
||||
$this->breadcrumbs=array(
|
||||
'Contact',
|
||||
);
|
||||
?>
|
||||
|
||||
<h1>Contact Us</h1>
|
||||
|
||||
<?php if(Yii::app()->user->hasFlash('contact')): ?>
|
||||
|
||||
<div class="flash-success">
|
||||
<?php echo Yii::app()->user->getFlash('contact'); ?>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<p>
|
||||
If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.
|
||||
</p>
|
||||
|
||||
<div class="form">
|
||||
|
||||
<?php $form=$this->beginWidget('CActiveForm', array(
|
||||
'id'=>'contact-form',
|
||||
'enableClientValidation'=>true,
|
||||
'clientOptions'=>array(
|
||||
'validateOnSubmit'=>true,
|
||||
),
|
||||
)); ?>
|
||||
|
||||
<p class="note">Fields with <span class="required">*</span> are required.</p>
|
||||
|
||||
<?php echo $form->errorSummary($model); ?>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->labelEx($model,'name'); ?>
|
||||
<?php echo $form->textField($model,'name'); ?>
|
||||
<?php echo $form->error($model,'name'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->labelEx($model,'email'); ?>
|
||||
<?php echo $form->textField($model,'email'); ?>
|
||||
<?php echo $form->error($model,'email'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->labelEx($model,'subject'); ?>
|
||||
<?php echo $form->textField($model,'subject',array('size'=>60,'maxlength'=>128)); ?>
|
||||
<?php echo $form->error($model,'subject'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->labelEx($model,'body'); ?>
|
||||
<?php echo $form->textArea($model,'body',array('rows'=>6, 'cols'=>50)); ?>
|
||||
<?php echo $form->error($model,'body'); ?>
|
||||
</div>
|
||||
|
||||
<?php if(CCaptcha::checkRequirements()): ?>
|
||||
<div class="row">
|
||||
<?php echo $form->labelEx($model,'verifyCode'); ?>
|
||||
<div>
|
||||
<?php $this->widget('CCaptcha'); ?>
|
||||
<?php echo $form->textField($model,'verifyCode'); ?>
|
||||
</div>
|
||||
<div class="hint">Please enter the letters as they are shown in the image above.
|
||||
<br/>Letters are not case-sensitive.</div>
|
||||
<?php echo $form->error($model,'verifyCode'); ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="row buttons">
|
||||
<?php echo CHtml::submitButton('Submit'); ?>
|
||||
</div>
|
||||
|
||||
<?php $this->endWidget(); ?>
|
||||
|
||||
</div><!-- form -->
|
||||
|
||||
<?php endif; ?>
|
||||
15
www/protected/views/site/error.php
Normal file
15
www/protected/views/site/error.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/* @var $this SiteController */
|
||||
/* @var $error array */
|
||||
|
||||
$this->pageTitle=Yii::app()->name . ' - Error';
|
||||
$this->breadcrumbs=array(
|
||||
'Error',
|
||||
);
|
||||
?>
|
||||
|
||||
<h2>Error <?php echo $code; ?></h2>
|
||||
|
||||
<div class="error">
|
||||
<?php echo CHtml::encode($message); ?>
|
||||
</div>
|
||||
20
www/protected/views/site/index.php
Normal file
20
www/protected/views/site/index.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
/* @var $this SiteController */
|
||||
|
||||
$this->pageTitle=Yii::app()->name;
|
||||
?>
|
||||
|
||||
<h1>Welcome to <i><?php echo CHtml::encode(Yii::app()->name); ?></i></h1>
|
||||
|
||||
<p>Congratulations! You have successfully created your Yii application.</p>
|
||||
|
||||
<p>You may change the content of this page by modifying the following two files:</p>
|
||||
<ul>
|
||||
<li>View file: <code><?php echo __FILE__; ?></code></li>
|
||||
<li>Layout file: <code><?php echo $this->getLayoutFile('main'); ?></code></li>
|
||||
</ul>
|
||||
|
||||
<p>For more details on how to further develop this application, please read
|
||||
the <a href="http://www.yiiframework.com/doc/">documentation</a>.
|
||||
Feel free to ask in the <a href="http://www.yiiframework.com/forum/">forum</a>,
|
||||
should you have any questions.</p>
|
||||
53
www/protected/views/site/login.php
Normal file
53
www/protected/views/site/login.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/* @var $this SiteController */
|
||||
/* @var $model LoginForm */
|
||||
/* @var $form CActiveForm */
|
||||
|
||||
$this->pageTitle=Yii::app()->name . ' - Login';
|
||||
$this->breadcrumbs=array(
|
||||
'Login',
|
||||
);
|
||||
?>
|
||||
|
||||
<h1>Login</h1>
|
||||
|
||||
<p>Please fill out the following form with your login credentials:</p>
|
||||
|
||||
<div class="form">
|
||||
<?php $form=$this->beginWidget('CActiveForm', array(
|
||||
'id'=>'login-form',
|
||||
'enableClientValidation'=>true,
|
||||
'clientOptions'=>array(
|
||||
'validateOnSubmit'=>true,
|
||||
),
|
||||
)); ?>
|
||||
|
||||
<p class="note">Fields with <span class="required">*</span> are required.</p>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->labelEx($model,'username'); ?>
|
||||
<?php echo $form->textField($model,'username'); ?>
|
||||
<?php echo $form->error($model,'username'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php echo $form->labelEx($model,'password'); ?>
|
||||
<?php echo $form->passwordField($model,'password'); ?>
|
||||
<?php echo $form->error($model,'password'); ?>
|
||||
<p class="hint">
|
||||
Hint: You may login with <kbd>demo</kbd>/<kbd>demo</kbd> or <kbd>admin</kbd>/<kbd>admin</kbd>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="row rememberMe">
|
||||
<?php echo $form->checkBox($model,'rememberMe'); ?>
|
||||
<?php echo $form->label($model,'rememberMe'); ?>
|
||||
<?php echo $form->error($model,'rememberMe'); ?>
|
||||
</div>
|
||||
|
||||
<div class="row buttons">
|
||||
<?php echo CHtml::submitButton('Login'); ?>
|
||||
</div>
|
||||
|
||||
<?php $this->endWidget(); ?>
|
||||
</div><!-- form -->
|
||||
12
www/protected/views/site/pages/about.php
Normal file
12
www/protected/views/site/pages/about.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/* @var $this SiteController */
|
||||
|
||||
$this->pageTitle=Yii::app()->name . ' - About';
|
||||
$this->breadcrumbs=array(
|
||||
'About',
|
||||
);
|
||||
?>
|
||||
<h1>About</h1>
|
||||
|
||||
<p>This is a "static" page. You may change the content of this page
|
||||
by updating the file <code><?php echo __FILE__; ?></code>.</p>
|
||||
Reference in New Issue
Block a user