MyBB Community Forums

Full Version: Yii framework
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
I can really understand you guys and I remember that I voted against YII some time ago in this topic.

Well, we do move on. My own company is in the meanwhile building web applications using YII. We are developing applications in a minimum of time.

The latest application does include MyBB. We do run YII for the custom CMS but do use MyBB's user management, right management instead of RBAC.

And I have to admit that it was not only very easy to integrate but they are also playing very well together. Much better than the facebook or wordpress integration for MyBB that I wrote.

Jumping into YII is a hard step, it is difficult to learn and very different from MyBBs current coding style (which is more similar to CI). But once you got the structure and followed for example the popular blog tutorial it has amazing capabilities.
Our company rewrote our complex custom CMS for customers within two days. User management, WYSIWYG, SEO URLs, multilanguage support and so on included.

I did a quick comparison of YII with Laravel and this is what I saw:
- YII does a much better job dealing with relationships between models
- YII does a better job on models in general, not focussing on the database only. Makes it easy to work with external files, multimedia...
- My test applications both displaying some texts taken from a MySQL database (InnoDB) shows that YII is a bit faster then Laravel, both of course using default configuration
- Laravel is easier to learn and looks nicer (especially the homepage)


I recommend the book "Yii 1.1 Application Development Cookbook" which is excellent to learn YII and also shows the possibilities of the framework. I like, for example, the possibility to be notified if a translation is missing (using YII event handlers).
Quote:Jumping into YII is a hard step, it is difficult to learn and very different from MyBBs current coding style

Considering this is a public project with thousands of end-users and plugin authors I would think learning curve would be an important factor.

Unlike your project which was probably not a public release or even going to probably be touched by more than a handful of coders. MyBB has to be understood by a vast amount of people. IMHO the base of MyBB users are below average coders that will view Yii as complex which might turn them away from the project.
Care to explain what you prefer about Yii's ORM implementation? Eloquent is widely regarded as one of the best out there right now.
(2012-09-24, 05:15 PM)labrocca Wrote: [ -> ]
Quote:Jumping into YII is a hard step, it is difficult to learn and very different from MyBBs current coding style

Considering this is a public project with thousands of end-users and plugin authors I would think learning curve would be an important factor.

Unlike your project which was probably not a public release or even going to probably be touched by more than a handful of coders. MyBB has to be understood by a vast amount of people.

Do they have to understand the coding of MyBB if a proper API is given?
I don't think that the majority of MyBB users took a deeper look into the core files of MyBB.

(2012-09-24, 05:22 PM)euantor Wrote: [ -> ]Care to explain what you prefer about Yii's ORM implementation? Eloquent is widely regarded as one of the best out there right now.

I do personally prefer the YII way here.

Have a look at Laravel:
class Post extends Eloquent {

     public function comments()
     {
          return $this->has_many('Comment', 'post_id');
     }
     public function author()
     {
          return $this->belongs_to('User', 'author_id');
     }

}

//Access with
$comments = Post::find(1)->comments;

Now YII:
class Post extends CActiveRecord
{
    public function relations()
    {
        return array(
            'author'=>array(self::BELONGS_TO, 'User', 'author_id'),
            'comments'=>array(self::HAS_MANY, 'Comments', 'post_id'),
        );
    }
}

//Access with
$author=$post->author;

(Wrote that without testing quick and dirty, ignore mistakes)

YII has one function relations that hols all relations of the model post. Laravel does need a function for each new relationship.
Just a quick example but if you jump in deeper and try for example many-many relationships with different databases you'll see what I mean.
Fair enough. When I last checked Yii (and their Active Record system), you had to have functions to set the table name, primary key and everything which looked overly complicated to me.
I agree that some of the AR parts of YII are complicated (I especially dislike some parts of the findAll-function) but once you followed a few tutorials you can easily make your way through that framework I think.
7 reasons to switch from Drupal to Yii
http://erickennedy.org/Drupal-7-Reasons-to-Switch
^^^
At least we can eliminate any chance of using Drupal. Toungue
(2012-09-24, 05:15 PM)labrocca Wrote: [ -> ]
Quote:Jumping into YII is a hard step, it is difficult to learn and very different from MyBBs current coding style

Considering this is a public project with thousands of end-users and plugin authors I would think learning curve would be an important factor.

Unlike your project which was probably not a public release or even going to probably be touched by more than a handful of coders. MyBB has to be understood by a vast amount of people. IMHO the base of MyBB users are below average coders that will view Yii as complex which might turn them away from the project.

One of reason, why MyBB growing fast is the mods, plugins, themes etc. All its easy access, easy tune..
I had hundreds even thousands of MyBB new member (forum) out there in my support community.
And everybody can be a basic support team as a PHP is a basic understandable language.
But, later.. on Framework you will find less support team who know Yii.
Finallyy, every links inside posting in MyBB.com will be Yii Forum http://www.yiiframework.com/forum/
And Yii forum using IPB :LOL:

There is no proudly feel using bla-bla..bla., became the unique MyBB.
Everybody will said, "What? MyBB? Forum software? No.. no.. I can build such MyBB can do over Yii framework.... So, what is MyBB? It is generic forum build over Yii?"


(2012-09-14, 07:07 PM)labrocca Wrote: [ -> ]The syntax of Laravel is imho more in tune with MyBB. I find the Yii syntax completely alien and makes me feel like I'm learning a new language.

yeah, agree Smile

for me as beginner in PHP.
watching Yii is kind of a lazy programmer using Micro**** .NET (with many version)
or using Basic over Visual Basic.

But, I do understand if the framework will be more easier language, for big scalable system in the future.

Finally, maybe in the future everyone will forget how to define PHP basic function, even a properly PHP echo syntax, also can't access how to check and secure core file. All depend on Yii developers

And I hope, We never forget How Kloxo failed after being the most promises FREE platform.

Thousands of MyBB projects will depend on few developer peoples.

Well, let's see...
(2012-09-26, 10:18 PM)FBI Wrote: [ -> ]There is no proudly feel using bla-bla..bla., became the unique MyBB.
Everybody will said, "What? MyBB? Forum software? No.. no.. I can build such MyBB can do over Yii framework.... So, what is MyBB? It is generic forum build over Yii?"

By that same logic all the major commercial forums are generic as well. XF uses Zen if remember right. IPB uses an in house framework. vB sucks so who cares. BurningBoard uses their own framework but it's publicly available.
(2012-09-26, 10:18 PM)FBI Wrote: [ -> ]for me as beginner in PHP.
watching Yii is kind of a lazy programmer using Micro**** .NET (with many version)
or using Basic over Visual Basic.
That's right, you are a beginner. So - do you understand current MyBB core files 100%? If not - does it matter if you understand them in the future?


Finally, maybe in the future everyone will forget how to define PHP basic function, even a properly PHP echo syntax, also can't access how to check and secure core file. All depend on Yii developers
[/quote]
Sorry - YII itself is based on basic Php functions. One example - the default SiteController:
				$headers="From: {$model->email}\r\nReply-To: {$model->email}";
				mail(Yii::app()->params['adminEmail'],$model->subject,$model->body,$headers);
				Yii::app()->user->setFlash('contact',Yii::t('contact', 'Thank you for contacting us. We will respond to you as soon as possible.'));
				$this->refresh();

Looks weird? But it does include a basic php function - mail().
Everything else is also very clear if you look at it. The user of the Yii::app gets a flash with a Yii::translated message. After that the script does a refresh of the contact site.
Really not complicated - plain php would be much more complicated.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23