By accessing the website and accepting the Cookie Policy, you agree to use the cookies provided by the Site in accordance with to analyze traffic, remember your preferences, and optimize your experience.
2018-11-06 15:18:03    227    0    0

Making websites with October CMS

In this video series we are going to get familiar with October CMS. A great Laravel based CMS. We are going to be creating themes, plugins, learn about administr

2018-10-26 11:00:04    104    0    0

简单的php基于curl的反向代理程序

index.php

<?php 
set_time_limit(60);
if( !defined('__DIR__') )
{
  define('__DIR__',dirname(__FILE__)) ;
}

$_REQUEST['url'] =gtRootUrl();
//改成网站正式服务器ip
$ip= '127.0.0.1';
$aA
uikit    2018-10-25 10:26:49    428    0    0

抽屉/Off-canvas

创建一个可以在页面上平滑地滑入滑出的抽屉。
抽屉完美适用于构建移动端导航,与那些颇受欢迎的许多原生手机应用类似,在其左上角用一个按钮来开关带有菜单的侧边栏。

用法

.uk-offcanvas 添加该类至一个<div>元素来创建隐藏在页面外的边栏容器和覆盖层。id也需要添加,使抽屉可被打开或关闭。
.uk-offcanvas-bar 添加该类

2018-10-25 10:26:49    372    0    0

导航

添加 .uk-nav 类到一个 <ul> 元素中。使用 a 元素作为列表中的菜单项。要对一个菜单项应用选中状态的效果,添加 .uk-active 类即可。
默认情况下,导航菜单没有任何样式。这就是为什么要添加一些具有样式的修饰类,这是很重要的,在例子中我们使用了 .uk-nav-side 类。
添加 .uk-nav-side 类,将导航菜单放置到侧边栏、面板或者网页中任意其他

2018-10-24 13:24:10    442    0    0

 

我们将利用上一节学习的表单,为movies添加一个表单组件。

首先准备目录,我们将复制contact插件中的contactform组件:

重命名和目录/文件: \plugins\raiseinfo\movies\components\contactform \plugins\raiseinfo\movies\components\ContactForm.php 到: \plugins\raiseinfo\movies\components\actorform \plugins\raiseinfo\movies\components\ActorForm.php

下面修改拷贝过来的文件: \plugins\raiseinfo\movies\components\ActorForm.php

namespace Raiseinfo\Movies\Components;

use Cms\Classes\ComponentBase;


class ActorForm extends ComponentBase
{

    public function componentDetails()
    {
        return [
          'name' => 'Actor Form',
          'description' => 'Enter actor form'
        ];
    }

    public function onSave()
    {
    }

}

\plugins\raiseinfo\movies\components\actorform\default.htm

<form data-request="onSave">

    <label>Name:</label>
    <input type="text" name="name" class="form-control">
    
    <label>Last name:</label>
    <input type="text" name="lastname" class="form-control">
    
    <button type="submit" class="btn btn-success form-control">Save<
2018-10-24 13:23:08    324    0    0

针对上一节的表单添加验证功能

File:plugins\raiseinfo\contact\components\ContactForm.php

use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Facades\Redirect;

...

public function onSend()
    {

        $validator = Validator::make(
            [
                'name' => Input::get('name'),
                'email' => Input::get('email')
            ],
            [
                'name' => 'required|min:5',
                'email' => 'required|email'
            ]
        );


        if($validator->fails()){

            return Redirect::back()->withErrors($validator);

        }else{
            $vars = [
                'name' => Input::get('name'),
                'email' => Input::get('email'),
                'content' => Input::get('content')
            ];

            // views/mail/message/htm
            Mail::send('raiseinfo.contact::mail.message', $vars, function($message) {

                $message->to('[email protected]', 'Admin Person');

                $message->sub
2018-10-24 13:21:56    218    0    0

邮件设置:config/mail.php;设置为smtp。

创建插件Contact

打开编辑器,在contact插件目录下创建components目录,并在目录下创建表单文件:ContactForm.php

定义组件

File:plugins\raiseinfo\contact\components\ContactForm.php 

<?php
namespace Raiseinfo\Contact\Components;
use Cms\Classes\ComponentBase;
class ContactForm extends ComponentBase
{
    public function componentDetails()
    {
        // TODO: Implement componentDetails() method.
        return [
          'name' => 'Contact Form',
          'description' => 'Simple contact form'
        ];
    }
}

File:pluginsraiseinfocontactPlugin.php

<?php namespace Raiseinfo\Contact;

use System\Classes\PluginBase;

class Plugin extends PluginBase
{
    public function registerComponents()
    {
        return [
          'Raiseinfo\Contact\Components\ContactForm' => 'contactform',
        ];
    }

    public function registerSettings()
    {
    }
}

增加新页面:

查看页面前端,确认已经生效,只是插件没有定义htm,所以没有内容可以显示。

下面编辑表单内容:

File:plugins\raiseinfo\contact\components\contactform\default.htm

<form action="" class="form-group