Yii Framework Forum: [EXTENSION] MyConfig - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION] MyConfig Manage your website config. Rate Topic: -----

#1 User is offline   twisted1919 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 617
  • Joined: 23-October 10
  • Location:Romania

Posted 14 January 2011 - 09:48 AM

This component allows you to manage your website various config items via database or files.
In my case, i created this component because my projects require an area in the admin panel where the clients can set various
config items for the website(Website keywords/description | admin theme | website theme | maintenance theme | contact emails | etc)
and i also have some classes that needs to have their params set dynamically from the admin panel.

Basically, you can save your custom config to database, you can load custom config items from files|database and you can cache them if you like.


More details here:
http://www.yiiframew...nsion/myconfig/
0

#2 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 14 January 2011 - 12:16 PM

Looks very good... thanks for sharing
┬┐How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#3 User is offline   twisted1919 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 617
  • Joined: 23-October 10
  • Location:Romania

Posted 14 January 2011 - 01:35 PM

It's good to know that i can give something back to the community ;)
Regarding the component, i believe it can help a developer a lot, as it helped me.
0

#4 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 3,308
  • Joined: 17-January 09
  • Location:Russia

Posted 14 January 2011 - 02:21 PM

Nice one. Can be helpful. Thanks for sharing.
Yii 1.1 Application Development Cookbook

Enjoying Yii? Star us at github: 1.1 and 2.0.
0

#5 User is offline   rebus 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 07-December 09
  • Location:Ancona

Posted 31 January 2011 - 07:58 AM

Hi, i have installed your component (Yii 1.1.6):

'cfg'=>array(
            'class' =>  'application.components.MyConfig',
            'cacheId'=>null,
            'useCache'=>false,
            'cacheTime'=>0,
            'tableName'=>'userconfig',
            'createTable'=>false,
            'loadDbItems'=>true,
            'serializeValues'=>true,
            'configFile'=>'',
        ),


But getItem not return value:

echo Yii::app()->cfg->getItem('test');
0

#6 User is offline   Raoul 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 633
  • Joined: 29-November 08
  • Location:Paris, France

Posted 02 February 2011 - 03:52 PM

Great extension and very useful !!

When I first try it, it did not create the table as I expected (initialized with createTable => true and tableName => 'config').
I had to modify the init() method by changing the order between the first 2 tests :
This is the result and it works fine :


    public function init()
    {
   	// do this first ...
        if($this->getCreateTable())
            $this->createTable();
            
   	// ... and then load items
        if($this->getLoadDbItems())
            $this->loadDbItems();
            
        $this->_initialized=true;
        
        Yii::app()->attachEventHandler('onEndRequest', array($this,'whenRequestEnds'));
    }



Is there something I didn't do well or did I fix a bug ?
Anyway, it's really good job, thanks
Posted Image
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users