Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Стиль написания #4

Open
kirillivan0ff opened this issue Aug 24, 2013 · 1 comment
Open

Стиль написания #4

kirillivan0ff opened this issue Aug 24, 2013 · 1 comment

Comments

@kirillivan0ff
Copy link

Скажите как было бы вернее написать в реальной жизни

 if ( !empty($routes[2]) )
        {
            $action_name = $routes[2];
        }

        $action_name = 'action_'.$action_name;

или

 if ( !empty($routes[2]) )
        {
            $action_name = 'action_'.$routes[2];
        }

А так же

        if(file_exists($model_path))
        {
            include "application/models/".$model_file;
        }

или

        if(file_exists($model_path))
        {
            include $model_path;
        }

Прочитал вашу статью на Хабре и она очень многое насчет MVC мне расставила на места. Большое за нее спасибо. Только вот этот момент по написанию хотелось бы уточнить. Чтоб не учится писать неверно, если второй вариант не правильный с точки зрения каких-либо "стандартов".

@kirillivan0ff
Copy link
Author

Понял почему.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant