Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A really simple plugin that allows you to manage and display blocks of content

License

NotificationsYou must be signed in to change notification settings

ciricihq/cake-blocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build StatusCoverageTotal DownloadsLicense

A really simple plugin that allows you to manage and show small content blocks.

Install

UsingComposer:

composer require ciricihq/blocks

You then need to load the plugin. You can use the shell command:

bin/cake plugin load Cirici/Blocks

or by manually adding statement shown below to your app'sconfig/bootstrap.php:

Plugin::load('Cirici/Blocks');

Usage

There's a Trait that does all the job, and we've created aBlockHelper and aBlockComponent so you can use them easily on your CakePHP app.

To start using them, just load whatever class you want.

For theBlockHelper, on yourAppView's initialize method, add:

// src/View/AppView.phppublicfunctioninitialize(){$this->loadHelper('Cirici/Blocks.Block');}

For theBlockComponent, on yourAppController's initialize:

// src/Controller/AppController.phppublicfunctioninitialize(){$this->loadComponent('Cirici/Blocks.Block');}

Methods

Right now there are just two methods available (as said, this plugin is really simple):

  • get: retrieves the entire Block entity by its slug.
  • getContents: just returns the Block'scontent field contents.

Patches & Features

  • Fork
  • Mod, fix
  • Test - this is important, so it's not unintentionally broken
  • Commit - do not mess with license, todo, version, etc. (if you do change any, bump them into commits oftheir own that I can ignore when I pull)
  • Pull request - bonus point for topic branches

Bugs & Feedback

http://github.com/ciricihq/cake-blocks/issues

License

Copyright (c) 2016,Cirici New Media and licensed underGNU GPL3 license.


[8]ページ先頭

©2009-2025 Movatter.jp