…html.erb<h1>Albums</h1> <%= link_to 'Add', new_album_path %> <ul> <%= render @albums %> </ul>Now the partial:views/albums/_album.html.erb<li> <%= image_tag(album.image.url, alt: album.title) if album.image_stored? %> <%= link_to album.title, album_path(album) %> by <%= album.singer %> | <%= link_to 'Edit', edit_album_path(album) %> | <%= link_to 'Remove', album_path(album), method: :delete, data: {confirm: 'Are you sure?'} %> </li>There…
…html.erb to hold your navigation code; the partial should be located in the app/views/layouts directory.Enter the code below into an IDE. It uses Bootstrap to create a navigation bar for your application.#app/views/layouts/_navigation.html.erb <nav class="navbar navbar-inverse"> <div class="container"> <div class="navbar-header"> <%= link_to 'Tuts Social', root_path, class: 'navbar-brand' %> </div> <div id="navbar">…
…HTML5 canvas. In this tutorial, I will show you how to use JavaScript and the HTML5 canvas to graphically display data by using bar charts. What Is a Bar Chart? Bar charts are very common tools used to represent numerical data. From financial reports to PowerPoint presentations to infographics, bar…
…html.erb<h1>Posts</h1> <%= link_to 'Add post', new_post_path %> <%= render @posts %>And the corresponding partial:views/posts/_post.html.erb<h2><%= link_to post.title, post_path(post) %></h2> <p><%= truncate(post.body, length: 150) %></p> <p><%= link_to 'Edit', edit_post_path(post) %></p> <hr>Here I am using the Rails truncate method to display only the first 150 symbols from the post. Before we create other…
…What You'll Be CreatingIn this Programming With Yii2 series, I'm guiding readers in use of the Yii2 Framework for PHP. You may also be interested in my Introduction to the Yii Framework, which reviews the benefits of Yii and includes an overview of what's new in Yii 2.x.In today's tutorial,…
…HTML language with custom tags. The custom tags can be used to implement various behaviors, so they are a very convenient way to write less code and keep your HTML documents simpler. What Is a Custom HTML Tag? With HTML, you use the <b> tag, for example, to show bold…
…Html; use yii\grid\GridView; use yii\widgets\Pjax; /* @var $this yii\web\View */ /* @var $searchModel frontend\models\SocialProfileSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Yii::t('frontend', 'Social Profiles'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="social-profile-index"> <h1><?= Html::encode($this->title) ?></h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <?php Pjax::begin(); ?> <?= GridView::widget([ 'dataProvider' => $dataProvider,…
…In this article, I'll review 19 of the best PHP calendar scripts. Whether you need an appointment booking script, an event calendar script, a web calendar script, or a PHP calendar reservation system, you'll find something on this list. There are lots of reasons you might need a PHP calendar…
…In this article, I'll review 20 of the best PHP calendar scripts. Whether you need an appointment booking script, an event calendar script, a web calendar script, or a PHP calendar reservation system, you'll find something on this list. There are lots of reasons you might need a PHP calendar…
…What You'll Be CreatingIntroduction Regardless how simple we try to make our web applications, it's often helpful to guide new users through their first experience. Visual tours are likely the easiest way.If you've followed my Envato Tuts+ Building Your Startup With PHP series, you're familiar with Meeting Planner. After watching…