New to Yii Framework - Some Basic Questions

Greetings,

I’m been a codeigniter MVC user for many years now and just recently started learning Yii, one of the main reasons being the support for module that Yii has (HMVC). My work mainly involves developing standalone scripts and selling them commercially.

I have a few questions about Yii and I would really appreciate it if someone could help me out with these :

  1. Does the Yii license permit me to sell scripts I make using Yii code commercially ?

  2. I want to give users the ability to enable / disable certain modules in the Yii app, but WITHOUT going into the code. I was thinking I would store the list of activated / deactivated modules in the database. From what I understand, modules are loaded in the application configuration file :


return array(

    ......

    'modules'=>array('forum',...),

    ......

);

How can I have the list of modules coming from the database ?

  1. I have a few functions I would like to use globally. Does Yii have the concept of helper functions that can be called from anywhere in the application without prefixing with a class ? How do I implement this ?

  2. Does Yii have a thumbnailing library ? Does it have any libraries that ship with the framework itself ?

  1. Yes.

  2. Not out of box (at least not until Yii 2) but search for ‘phundament’… But generally, anything which is in the config can be dynamically configured, so it’s definitely possible.

  3. You can use an application component - probably the best and most robust option. Or classes with all static public functions.

  4. It doesn’t. This is by design. There’s lots of good thumbnailing extensions in the repository. :)

about the 2.

I use the same approach for 1 of my applications.

on the onBeginRequest event I do this




$modules=loadUserModulesFromDb();//put the actual code here

Yii::app()->setModules($modules);