kenjis / codeigniter-ss-twig

A Simple and Secure Twig integration for CodeIgniter 3.x and 4.x
MIT License
168 stars 46 forks source link

install with composer #22

Closed asadghazanfary closed 7 years ago

asadghazanfary commented 7 years ago

hi @kenjis

how can i install codeigniter-ss-twig with composer?

please exactly explain to me

thank you

markskayff commented 7 years ago

Hi there,

You basically have to clone the git project first.

To use composer you must have either Composer installed on your system, or download a composer.phar file to your project working directory.

Go to your project directory -notice the composer files must be there-. If you have composer installed on your system just run: composer install

If you prefer the composer.phar option, you have to run: php composer.phar install

That will install CodeIgniter, Twig and all its dependencies.

Then it looks like there's an install.php script there. You probably have to run that one too, to have stuff setup in place.

kenjis commented 7 years ago

@asadghazanfary See https://github.com/kenjis/codeigniter-ss-twig#with-composer

asadghazanfary commented 7 years ago

thank you for answer.

my problem is solved.

but how can i use this instructions in my project:

**Install libraries/Twig.php to your CodeIgniter application folder:

$ php vendor/kenjis/codeigniter-ss-twig/install.php Above command always overwrites exisiting files. You must run it at CodeIgniter project root folder.**

I mean you did not get properly

kenjis commented 7 years ago

Run the following command on your project root folder:

$ php vendor/kenjis/codeigniter-ss-twig/install.php
MoserMi commented 7 years ago

I would really appreciate a step by step explanation as well. When i checkout your repository and then run composer i get a totally different folder structure than described in the manual.

image

When i install codeigniter first and then clone the repository field in the root folder and run it i get a complete mess.

Can someone help me?

kenjis commented 7 years ago

@MoserMi You need to install CodeIgniter first, and follow the instruction: https://github.com/kenjis/codeigniter-ss-twig#with-composer

MoserMi commented 7 years ago

hi @kenjis your help is much appreciated! I am very new to codeigniter too. IInstalling codeigniter first ist what i tried very first, when i try to render a view i am getting the following error: image

do you know what i am doing wrong?

kenjis commented 7 years ago

@MoserMi Probably you need to set composer_autoload in application/config/config.php like this:

$config['composer_autoload'] = realpath(APPPATH . '../vendor/autoload.php');
MoserMi commented 7 years ago

you are awesome @kenjis! Thanks a lot!!!!

hermann8u commented 7 years ago

@MoserMi Probably you need to set composer_autoload in application/config/config.php like this:

$config['composer_autoload'] = realpath(APPPATH . '../vendor/autoload.php');

Thank you for this response, but it could be fine to precise it in the composer install guide for new in CodeIgniter like me!

Thanks