Skip to content

sangar82/CodeIgniter-Starter

Repository files navigation

#Codeigniter Starter

Custom Codeigniter with preinstalled features:

##Codeigniter Version

The Codeigniter Version is 2.1.3

##Server Requirements

PHP version 5.3.5 or newer. At this moment, Scaffolding works only with MySql and models works with phpactiverecord

##Installation

The installation is the same as Codeigniter.

Please see the installation instruccions of Codeigniter http://codeigniter.com/user_guide/installation/index.html

Create the database and import the tables with the mysql_dump.sql file

Edit the files with your preferences (domain, languages, database, authentification):

  • config.php
  • database.php
  • sangar_auth.php

Create a virtualhost with the the same domain that you write in config.php. If you want more languages, create more ServerAlias

<VirtualHost *:80>

	ServerName www.mydomain.com

	ServerAlias en.mydomain.com

	ServerAlias es.mydomain.com

	ServerAlias ca.mydomain.com

	DocumentRoot /www/mydomain.com

</VirtualHost>

Enjoy!!

##Backend user and password

The default user to access to the private zone is:

user: 		[email protected]

password: 	password

##How create a new scaffold

Sangar Scaffolds creates the files for CRUD operations for you!

It creates the tables on the database, the controllers, the models and the views.

It also modifies the routes.php file.

You can create forms with the followings elements:

  • name
  • textarea
  • radiobuttons
  • checkboxes
  • select
  • select 1:N (populate the form select with a existent Model)
  • upload images (with thumbnail creation and uploads rules)
  • upload files (with uploads rules)
  • hidden relational (It's a special element. Only one hidden relational by scaffolding is allowed. It will produce a form with relation 1:N linked with his parent form automatically)

This version has more features that sangar scaffold spark. http://getsparks.org/packages/sangar-scaffold/versions/HEAD/show

Each element has validation rules and the possibility to do it multilanguage.

Create also a paginated list view.

To create a new scaffold, login into the private zone, and search the link 'Scaffolds' on the top of the page

  • Write the Controller name you want produce.
  • Write the Model name you want produce.
  • Copy the code blocks of elements you need and paste to scaffold code textarea. Each code block must be separated by commas. The scaffold code is a JSON without the first '{' and the last '}'
  • Choose the options you want
  • Scaffold!

##Translate controllers name and controllers method names

If you want to translate controllers names and controllers method names edit the file

/application/language/controller_translations.php

and

/application/language/method_translations.php. 

For use in your views use the helper transurl_helper.php:

<?=lang_anchor(controller_name, method_name, params)?>

Example:

<?=lang_anchor('users', 'edit', '1')?>

(It produces a link in the actual language, with the controller and method names translated)

About

Codeigniter 2.1.3 base for fast development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •