Some suggestion for features based in other frameworks


I have some suggestion based in other frameworks like rails, grails and play!.

#1 - When use active record to get some database data, sometimes we need convert it to xml, json, array, it will turn our life to build services too easy. So i suggest it (array i think is already implement in 2.0):

$customers = Customer::find()->asArray()->all();

$customers = Customer::find()->asXml()->all();

$customers = Customer::find()->asJson()->all();

#2 - Custom transformation data when use activerecord, like #1, but custom, example:

$customers = Customer::find()->asMyCustomConverter()->all();

$customers = Customer::find()->asPDF()->all();

#3 - Native CURL extension:

We always need integrate our website to another thing, so, we need a decent curl class to do it. That can make all type of requests (get, post, put, delete) and some of other sort of improvements and utilities using CURL (set cookies, headers, …)

#4 - Native package manager like others, example:

yiic install myExtension

yiic install-extension myExtension

yiic install-plugin myExtension

yiic install myExtension -v 1.2

yiic install myExtension -v=1.2

some of one from this list

#5 - Native interface to send mail and custom implementation

A way to send mail from a class from framework and if you need another sender/mailer (like phpmailer) you can set it.


$mailer->subject = ‘teste’;

$mailer->body = ‘teste’;

$mailer->from = array(‘my name’ => ‘my email’);

$mailer->to = array(‘one name’ => ‘one email’, …);


$mailer->setClass(‘extensions.phpmailer.PHPMailer’); // you can set from config too

#6 - Config files to different environments

We need urgent a way to change config files in different environments.

We can set a server var on apache/nginx for development/test environment, and if this var doesnt exists assume ‘production’

#7 - Change UI framework

I suggest BOOTSTRAP than BLUEPRINT. I test a king of UI framework, and bootstrap if complete, well documented, too many of features and a big company on maintenance.

#8 - Nice logger/profiler native support

Every application need a decent log to you know what is happening, so yii need one too. I like this too much:

#9 - Clear everything from console

We need a native console command that clear all from command line (assets, runtime, cache, log, …)

#10 - A requiments command from console

Always that we need check requirements from YII we need access from browser, but i use linux and remote shell, and i need check some issues that we can prevent using requirements page. Will be more easy and usually a way to do it from command line. Example:

PHP version - Need 5.2 (Current is 5.3.5) - [OK]

Path writable (webroot/assets) - [FAIL]

#11 - GII from command line

Everything from gii generator, from command line

#12 - A better ajax form, ajax button and submit

I never do it work, i never understand it. I like too much the implementation of couponic. It is very easy to use and work for return a new content to a element, alert, custom script, json, xml, redirect and custom, and you decide if from controller return data.

#13 - The pagination class has some bugs

I get some bugs from pager class - You cannot hide some elements and change text form some elements.

#14 - A client/server for soap

We need a client and server for soap 1 and 1.2. A lot of webservices use it.

#15 - A fast utlitity class to convert numbers and date from calendar

Today i dot:

echo(Yii::app()->numberFormatter->format(Yii::app()->params[‘percentFormat’], 1234) . ‘%’);

We need a way to convert our activerecord data from our language to database automatic

#16 - Console/shell/terminal class

When use PHP i have a lot of difficult to find a correct way to create process or execute something in terminal/console

I suggest a native class to make this work. Execute for example imagemagic from command line. Like this:

Console::execute(array(‘unrar’, ‘myfile.txt’, ‘-d’, ‘/tmp/myfile.rar’));

#17 - Class to manager file and dir

We need a native class to handle files and dir.

Read and write files

List files/dir recursive

Create, delete, chmod files and dir recursive

And more

#18 - Serial class

A native class to handle serial port, like COM1 (windows) and /dev/usb1 (linux/mac)

#19 - Render an action s custom class

Render a view or content as a custom class (i think it is already done in 1.*)


#20 - Some helper, utility class from here:

util, helpers, renders

#21 - Cron/task

A way to create tasks/jobs and it run based on a time in the job, like this:

I think that is only this for now. Its only a suggestion.

Based on some of your suggestions I think you might find this forum post interesting "ActiveResource for using REST resources as models".

Some of what you suggest I think could be possible now without changing core. EG: #6 can be achieved with some creative organisation of config files in combination with something like Phing.

I am also interested in #9 and #10, but would add the ability to run extension requirements routines.

I also think some of your points are already being discussed EG: #4 = Atomic core and packages

Hi prchakal,

There are already some extensions for what you propose. IMHO, some features would be better implemented as extensions than in the core.

Some other suggestions are curently being discussed on this forum. Join the discussions and share your opinion there!

For #6, read these wiki articles for inspiration:

#1 - instead of supporting different formats in ActiveQuery, it’s better we have separate data formatters that can turn array into XML or JSON or something else.

#2 - same as above.

#3 - The requirements are very vague. Nevertheless, I agree having some CURL helper is useful. This is not our top priority though.

#4 - We have discussed this before. Will have something in 2.0

#5 - We may or may not support this in the core.

#6 - This doesn’t belong to the core, but we probably can provide some commands or initial setup to simplify this.

#7 - We will consider bootstrap and other alternatives.

#8 - We will have it.

#9 - This belongs to application domain.

#10 - Will consider it.

#11 - We will drop the command line code generator except the webapp command.

#12 - Requirements too vague or broad to be considered.

#13 - same as #12.

#14 - Beyond our scope.

#15 - same as #12.

#16 - Beyond our scope.

#17 - Beyond our scope.

#18 - Beyond our scope.

#19 - Not in our design.

#20 - We will have more helper classes in 2.0.

#21 - We may consider it.