TODO:Laravel 使用blade标签布局页面

TODO:Laravel 使用blade标签布局页面

cfcd208495d565ef66e7dff9f98764da-3.jpg
本文主要介绍Laravel的标签使用,统一布局页面。主要用到到标签有@yield,@ stack,@extends,@section,@stop,@push。使代码精简、提高页面下载速度、表现和内容相分离。站在开发者的角度看,web页面都可以提取相同的内容进行分离,让每个页面代码尽显主题内容,简洁明快,干扰信息少。

1. Laravel的blade标签代码格式是”命名.blade.php”,这样是不是很简洁。

2. 创建统一布局风格的代码模板main.blade.php,使用HTML5的代码结构,有标签header,main,footer,35行的代码完成一个风格的布局.

cfcd208495d565ef66e7dff9f98764da-4.jpg
3. 新建一个页面a.blade.php,使用这个@extends引用母模板main.blade.php,layouts是模板的路径。

cfcd208495d565ef66e7dff9f98764da-5.jpg
4. 从这两个页面代码我们可以看到Laravel的blade基本使用方法,在子页面定义@section定义代码,在母模版使用@yield,就可以输出对应的代码,充分体系了Laravel的简洁优雅。

5. 在main.blade.php我们看到了@stack,这个要怎么用了,只要在a.blade.php创建@push即可使用了,进行更多的扩展。

6. 这是简单标签使用,和统一页面布局使用,希望对你有启蒙作用。

wxgzh:ludong86

qrcode_for_gh_6bb1f39ae99c_258-1

转载于:https://my.oschina.net/todosomeone/blog/807780

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
填充下面这个程序中所有出现// TODO: fill the code这个任务的地方#include <iostream> #include <cstring> #include "ourstring.h" #include "strlib.h" using namespace std; OurString::OurString(){ // TODO: fill the code } OurString::OurString(const char *str){ // TODO: fill the code } OurString::OurString(const OurString &dstr){ // TODO: fill the code } OurString::~OurString(){ // TODO: fill the code } string OurString::toString() const{ // TODO: fill the code } OurString OurString::subStr(unsigned int start, unsigned int n) const{ // TODO: fill the code } bool OurString::operator > (const OurString &dstr) const{ // TODO: fill the code } bool OurString::operator < (const OurString &dstr) const{ // TODO: fill the code } bool OurString::operator == (const OurString &dstr) const{ // TODO: fill the code } unsigned int OurString::length () const{ // TODO: fill the code } const OurString& OurString::operator = (const OurString &dstr){ // TODO: fill the code } const OurString& OurString::operator = (const char *str){ // TODO: fill the code } char& OurString::operator[](int index){ // TODO: fill the code } const OurString OurString::operator + (const OurString &dstr) const{ // TODO: fill the code } const OurString OurString::operator + (const char *str) const{ // TODO: fill the code } const OurString& OurString::operator += (const OurString &dstr){ // TODO: fill the code } const OurString& OurString::operator += (const char *str){ // TODO: fill the code } ostream & operator<<(ostream &os, const OurString &dstr){ // TODO: fill the code } istream & operator>>(istream &is, OurString &dstr){ // TODO: fill the code }
05-29

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值