Getting Started

About Webcoder CMS

Webcoder CMS is a Content Management System, which developed to be as simple and straightforward as possible. It is easy to set up and configure, uses stylish templates, and above all: it's a entertainment tool to build a website. Webcoder CMS is created using Codeigniter, and is best suited to build sites rapidly with lightweight framework.

Building a website with Webcoder CMS: we assume you have the usual Frontender skills. You know HTML/CSS, and have working knowledge about JavaScript so you can implement things like Javascript functions, jQuery plugins and such. To create a working site out of your static HTML, you'll need to know about how Webcoder CMS uses Smarty template engine. Information about those topics can be found in the Template/Theme section.

With creating Webcoder CMS we wanted to focus on creating something simple, straightforward and enjoyable. Webcoder CMS concentrates on being a content management system with a small footprint. Being built on modular, loosely coupled components it can be an ideal foundation for projects large and small.

Requirements
The system requirements for Webcoder CMS to run on any fairly modern web server:

PHP 7 or higher
Access to MySQL
Apache with mod_rewrite enabled (.htaccess files) or Nginx (virtual host configuration covered below)
The PHP installation has a few additional requirements. On most servers these are default settings:
A minimum of 32MB of memory allocated to PHP
The following common PHP extensions:
PDO
CURL
mbstring

Installation

Manual download and extraction

Download the latest version of Webcoder CMS as the regular from https://webcodercms.com/download/latest.zip. Extract the .zip file, and you can start developing locally, or upload the files to your webhost using the (S)FTP client of your choice.

After extract the file yourself, perform Configuration of the Webcoder CMS.

Permissions

Webcoder CMS needs to be able to write data to a number of folders. For example the templates_c/ folder, and the uploads/ folder where uploaded images and other files will be saved. Generally, servers should be fine with the default permissions. If your server needs to have the permissions set manually, you'll immediately notice when opening your recently created website, because you will greeted by an error.

Finishing
After you've done this, skip to the Configuration section.

Configuration

Modify config file

When you settle your new website into Webcoder CMS you need to define some initials. Like base url, image uploads folder, encryption key and any other option you want to define.

There are some options which you need to define first for Webcoder CMS to work. Config file's location is application/config/config.php.

Set value of base_url as your website main url.

Example: $config['base_url'] = 'https://example.com/';

Set value of encryption_key as your desire.

Example: $config['encryption_key'] = 'your_encryption_key';

Define directory where images will upload.

Example: define('DIR_IMAGE', "C:/xampp/htdocs/mysite/uploads/");

Set up Database

Create database with 'wc_' prefix as default and edit the database configuration file. To fill and edit database options open application/config/database.php.

Example:

$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '12345',
'database' => 'mydb',
'dbdriver' => 'mysqli',
'dbprefix' => 'wc_',
...

Cheatsheet

You are reading the official Webcoder CMS Cheat sheet. This page contains a full description of used functions and custom ones. Use CTRL-F to search for your need quickly.
Model Cheatsheet

Variables

$database_connection Holds the connection with database

application/core/Webcoder_Model.php

$controller Directory name of the current Controller

application/core/Webcoder_Model.php

$table Table name which requested controller belongs.

application/core/Webcoder_Model.php

$table_translation Name of the translation table that current table has relation with

application/core/Webcoder_Model.php

$primary_key Primary_key of the database table of current controller (default: "id")

application/core/Webcoder_Model.php

$table_translation_key Translation table related key

application/core/Webcoder_Model.php

$table_language_key Translation table language key (default: "language_id")

application/core/Webcoder_Model.php

$fillable Carries fillable fields option. If value is set as null, the $fillable property will be set as an array with all the table fields (except the primary key) as elements. If value is set as an array, there won't be any changes done to it (ie: no field of the table will be updated or inserted).

application/core/Webcoder_Model.php

$protected Carries protected fields option If value is set as null, the $protected will be set as an array with the primary key as single element. If value is set as an array, there won't be any changes done to it (if set as empty array, the primary key won't be inserted here).

application/core/Webcoder_Model.php

$timestamps Boolean value of the timestamps option (default: true)

application/core/Webcoder_Model.php

$timestamps_format Holds the timestamps_format (default: "Y-m-d H:i:s")

application/core/Webcoder_Model.php

$created_at_field Holds the created date (value as timestamps)

application/core/Webcoder_Model.php

$updated_at_field Holds the updated date (value as timestamps)

application/core/Webcoder_Model.php

$deleted_at_field Holds the deleted date (value as timestamps)

application/core/Webcoder_Model.php

$soft_deletes Boolean value for soft delete option

application/core/Webcoder_Model.php

$relationships Details of the relations with other tables (default: array[])

application/core/Webcoder_Model.php

$has_one Relation details with other tables (default: array[])

application/core/Webcoder_Model.php

$requested Details of requested table to join with (default: array[])

application/core/Webcoder_Model.php

$cache_driver Type of the cache driver (default: "file")

application/core/Webcoder_Model.php

$cache_prefix Prefix of the cache files (default: "mm")

application/core/Webcoder_Model.php

$cache Holds the cache itself

application/core/Webcoder_Model.php

$delete_cache_on_save Boolean value for cache delete on save (default: "false")

application/core/Webcoder_Model.php

$select Carries SQL select query string (default: "*")

application/core/Webcoder_Model.php

Functions

set_connection() Sets the connection to database

application/core/Webcoder_Model.php

set_timestamps() Sets the fields for the created_at, updated_at and deleted_at timestamps

return boolean

application/core/Webcoder_Model.php

fetch_table() This function verifies if a table name was defined. if not, it calls the get_table_name in order to retrieve a potential table name, which will be tested if exists. If all went well, the table name will be saved as $this->table

return boolean

application/core/Webcoder_Model.php

get_table_name($model_name) Returns a table name as proper to its model_name

return string

application/core/Webcoder_Model.php

set_table_fillable_protected() Sets fillable and protected fields

return $this

application/core/Webcoder_Model.php

prep_before_write($data) Before writing database this function checks if field in given parameter is fillable or not. At final it returns new data

return array

application/core/Webcoder_Model.php

prep_after_write() this function simply deletes the cache related to the model's table if $this->delete_cache_on_save is set to true It should be called by any "save" method

return boolean

application/core/Webcoder_Model.php

is_multidimensional($array) Verifies if an array is multidimensional or not;

return boolean

application/core/Webcoder_Model.php

object_to_array($object) Converts object to array

return array

application/core/Webcoder_Model.php

array_to_object($array)

return runs _array_to_object($array, $obj) function which do convert operation

application/core/Webcoder_Model.php

_array_to_object($array, &$obj) Converts array to object

return object

application/core/Webcoder_Model.php

is_assoc($array)

return boolean

application/core/Webcoder_Model.php

insert($data = null, $table_name = null) Inserts data into table. Can receive an array or a multidimensional array depending on what kind of insert we're talking about.

return int/array Returns id/ids of inserted rows

application/core/Webcoder_Model.php

the_timestamp() Returns a value representing the date/time depending on the timestamp format choosed

return string

application/core/Webcoder_Model.php

update($data = null, $column_name_where = null, $escape = true) Updates data into table. Can receive an array or a multidimensional array depending on what kind of update we're talking about.

return str/array Returns id/ids of inserted rows

application/core/Webcoder_Model.php

where($field_or_array = null, $operator_or_value = null, $value = null, $with_or = false, $with_not = false, $custom_string = false) Sets a where method for the $this object

return $this

application/core/Webcoder_Model.php

limit($limit, $offset = 0) Sets a rows limit to the query

return $this

application/core/Webcoder_Model.php

group_by($grouping_by) A wrapper to $this->database->group_by()

return $this

application/core/Webcoder_Model.php

delete($where = null) Deletes data from table.

return Returns affected rows or false on failure

application/core/Webcoder_Model.php

force_delete($where = null) Forces the delete of a row if soft_deletes is enabled

return boolean

application/core/Webcoder_Model.php

restore()($where = null) "Un-deletes" a row

return boolean

application/core/Webcoder_Model.php

trashed($where = null) Verifies if a record (row) is soft_deleted or not

return boolean

application/core/Webcoder_Model.php

only_trashed() Sets $_trashed to only

return boolean

application/core/Webcoder_Model.php

get_joined($requested) Joins requested table to the query

return boolean

application/core/Webcoder_Model.php

join_temporary_results($data) Joins the subquery results to the main $data

return mixed

application/core/Webcoder_Model.php

one($where = null) Retrieves one row from table.

return mixed

application/core/Webcoder_Model.php

get_from_cache($cache_name = null) Gets data from cahce with cache_driver if there cache_name is set.

return array

application/core/Webcoder_Model.php

where_trashed() Switches trashed cases and sets proper results to query (where)

return $this

application/core/Webcoder_Model.php

write_to_cache($data, $cache_name = null) Saves to cache

return boolean

application/core/Webcoder_Model.php

reset_cache($string) Resets cache

return $this

application/core/Webcoder_Model.php

all($where = null) Retrieves rows from table.

return mixed

application/core/Webcoder_Model.php

count_rows($where = null) Retrieves number of rows from table.

return integer

application/core/Webcoder_Model.php

with($request, $arguments = []) Allows the user to retrieve records from other interconnected tables depending on the relations defined before the constructor

return boolean

application/core/Webcoder_Model.php

set_relationships() Called by the public method with() it will set the relationships between the current model and other models

application/core/Webcoder_Model.php

parse_model_dir($foreign_model) Parse model and model folder

return $data

application/core/Webcoder_Model.php

on($connection_group = null) Sets a different connection to use for a query

return object

application/core/Webcoder_Model.php

reset_connection() Resets the connection to the default used for all the model

return object

application/core/Webcoder_Model.php

trigger($event, $data = [], $last = true) Trigger an event and call its observers. Pass through the event name (which looks for an instance variable $this->event_name), an array of parameters to pass through and an optional 'last in interation' boolean

return object

application/core/Webcoder_Model.php

fields($fields = null) Does a select() of the $fields

return $this

application/core/Webcoder_Model.php

order_by($criteria, $order = 'ASC') A wrapper to $this->database->order_by()

return $this

application/core/Webcoder_Model.php

as_array() Return the next call as an array rather than an object

return $this

application/core/Webcoder_Model.php

as_object() Return the next call as an object rather than an array

return $this

application/core/Webcoder_Model.php

as_dropdown($field = null) Return the next call as a dropdown rather than an array

return $this

application/core/Webcoder_Model.php

set_cache($string, $seconds = 86400) Saves to cache

return $this

application/core/Webcoder_Model.php

delete_cache($string = null) Deletes from cache proper to cache_name ($string)

return $this

application/core/Webcoder_Model.php

_build_sorter($data, $field, $order_by, $sort_by = 'DESC') Sorts array $data with defined conditions (with custom function)

return $data

application/core/Webcoder_Model.php

__call($method, $arguments) Checks method's start parts and performs proper database functions. If method is not defined pulls an error message.

return $this

application/core/Webcoder_Model.php

filter($filter = []) Adds conditions (filters) to the query (where)

return $this

application/core/Webcoder_Model.php

with_translation($language_id = false) Joins translation table with language

return $this

application/core/Webcoder_Model.php

insert_translation($data) Performs INSERT INTO operation to insert translations to related table

return $this

application/core/Webcoder_Model.php

delete_translation($id) Performs DELETE operation to delete translations from related table

return boolean

application/core/Webcoder_Model.php

Controller Cheatsheet

Variables

$directory Directory of the current Controller

application/core/Webcoder_Controller.php

$controller Name of the current Controller

application/core/Webcoder_Controller.php

$model Model name proper to its controller

application/core/Webcoder_Controller.php

$method Name of the requested method

application/core/Webcoder_Controller.php

$theme Name of the theme

application/core/Webcoder_Controller.php

$module_name Name of the module

application/core/Webcoder_Controller.php

Functions

index() Runs as default when this controller requested if any other method is not specified in route file. Collects all data (buttons, table columns, fields, pagination config, breadcrumb links) which will be displayed on index page of this controller (generally it contains rows of database result). At final sends data to target template.
create() Runs as default when this controller requested if any other method is not specified in route file.
edit() Runs as default when this controller requested if any other method is not specified in route file.
delete() Runs as default when this controller requested if any other method is not specified in route file.
trash() Runs as default when this controller requested if any other method is not specified in route file.
remove() Runs as default when this controller requested if any other method is not specified in route file.
restore() Runs as default when this controller requested if any other method is not specified in route file.
clean() Runs as default when this controller requested if any other method is not specified in route file.
render(template, layout) Runs as default when this controller requested if any other method is not specified in route file.
block(id) Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Users.php

unblock(id) Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Users.php

cropper() Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Filemanager.php

upload() Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Filemanager.php

folder() Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Filemanager.php

pagination(data) Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Filemanager.php

database() Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Extension.php

get_params() Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Extension.php

login() Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Authentication.php

logout() Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Authentication.php

directory(files) Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Translation.php

file(files) Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Translation.php

add_extra_keys() Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Translation.php

add_one_key() Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Translation.php

save() Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Translation.php

create_new_language() Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Translation.php

delete_language() Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Translation.php

remove_key() Runs as default when this controller requested if any other method is not specified in route file.

application/controllers/admin/Translation.php

Library/Helper Cheatsheet

Functions

site_url_multi($uri = ' ', $protokol = null) Create a multilingual local URL based on your basepath. Segments can be passed via the first parameter either as a string or an array.
slug($str, $separator = '-', $lowercase = false) Converts string to SEO friendly slug
site_url_multi($uri = ' ', $protokol = null) Create a multilingual local URL based on your basepath. Segments can be passed via the first parameter either as a string or an array.
slug($str, $separator = '-', $lowercase = false) Converts string to SEO friendly slug
site_url_multi($uri = ' ', $protokol = null) Create a multilingual local URL based on your basepath. Segments can be passed via the first parameter either as a string or an array.
slug($str, $separator = '-', $lowercase = false) Converts string to SEO friendly slug
site_url_multi($uri = ' ', $protokol = null) Create a multilingual local URL based on your basepath. Segments can be passed via the first parameter either as a string or an array.
slug($str, $separator = '-', $lowercase = false) Converts string to SEO friendly slug
site_url_multi($uri = ' ', $protokol = null) Create a multilingual local URL based on your basepath. Segments can be passed via the first parameter either as a string or an array.
slug($str, $separator = '-', $lowercase = false) Converts string to SEO friendly slug
site_url_multi($uri = ' ', $protokol = null) Create a multilingual local URL based on your basepath. Segments can be passed via the first parameter either as a string or an array.
slug($str, $separator = '-', $lowercase = false) Converts string to SEO friendly slug

Template / Theme

Webcoder CMS is a Content Management System, which developed to be as simple and straightforward as possible. It is easy to set up and configure, uses stylish templates, and above all: it's a entertainment tool to build a website. Webcoder CMS is created using Codeigniter, and is best suited to build sites rapidly with lightweight framework.

Building a website with Webcoder CMS: we assume you have the usual Frontender skills. You know HTML/CSS, and have working knowledge about JavaScript so you can implement things like Javascript functions, jQuery plugins and such. To create a working site out of your static HTML, you'll need to know about how Webcoder CMS uses Smarty template engine. Information about those topics can be found in the Template/Theme section.

With creating Webcoder CMS we wanted to focus on creating something simple, straightforward and enjoyable. Webcoder CMS concentrates on being a content management system with a small footprint. Being built on modular, loosely coupled components it can be an ideal foundation for projects large and small.

Routing

Webcoder CMS is a Content Management System, which developed to be as simple and straightforward as possible. It is easy to set up and configure, uses stylish templates, and above all: it's a entertainment tool to build a website. Webcoder CMS is created using Codeigniter, and is best suited to build sites rapidly with lightweight framework.

Building a website with Webcoder CMS: we assume you have the usual Frontender skills. You know HTML/CSS, and have working knowledge about JavaScript so you can implement things like Javascript functions, jQuery plugins and such. To create a working site out of your static HTML, you'll need to know about how Webcoder CMS uses Smarty template engine. Information about those topics can be found in the Template/Theme section.

With creating Webcoder CMS we wanted to focus on creating something simple, straightforward and enjoyable. Webcoder CMS concentrates on being a content management system with a small footprint. Being built on modular, loosely coupled components it can be an ideal foundation for projects large and small.

Module System

Webcoder CMS is a Content Management System, which developed to be as simple and straightforward as possible. It is easy to set up and configure, uses stylish templates, and above all: it's a entertainment tool to build a website. Webcoder CMS is created using Codeigniter, and is best suited to build sites rapidly with lightweight framework.

Building a website with Webcoder CMS: we assume you have the usual Frontender skills. You know HTML/CSS, and have working knowledge about JavaScript so you can implement things like Javascript functions, jQuery plugins and such. To create a working site out of your static HTML, you'll need to know about how Webcoder CMS uses Smarty template engine. Information about those topics can be found in the Template/Theme section.

With creating Webcoder CMS we wanted to focus on creating something simple, straightforward and enjoyable. Webcoder CMS concentrates on being a content management system with a small footprint. Being built on modular, loosely coupled components it can be an ideal foundation for projects large and small.

Conclusion

Webcoder CMS is a Content Management System, which developed to be as simple and straightforward as possible. It is easy to set up and configure, uses stylish templates, and above all: it's a entertainment tool to build a website. Webcoder CMS is created using Codeigniter, and is best suited to build sites rapidly with lightweight framework.

Building a website with Webcoder CMS: we assume you have the usual Frontender skills. You know HTML/CSS, and have working knowledge about JavaScript so you can implement things like Javascript functions, jQuery plugins and such. To create a working site out of your static HTML, you'll need to know about how Webcoder CMS uses Smarty template engine. Information about those topics can be found in the Template/Theme section.

With creating Webcoder CMS we wanted to focus on creating something simple, straightforward and enjoyable. Webcoder CMS concentrates on being a content management system with a small footprint. Being built on modular, loosely coupled components it can be an ideal foundation for projects large and small.