This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
form div.required label.control-label:after { | |
content:" * "; | |
color:red; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = [3, 5, 7] | |
def double_list(x): | |
n.append('!') | |
print n | |
# Don't forget to return your new list! | |
print double_list(n) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numbers = [1, 2, 3, 4] | |
double_first(numbers) | |
print numbers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return [ | |
'component' => [ | |
'request' => [ | |
'class' => 'yupe\components\HttpRequest', | |
// пути, исключенные из csrf-валидации | |
'noCsrfValidationRoutes' => ['admin/AjaxImageUpload', 'admin/AjaxFileUpload'], | |
] | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XP: | |
http://www.amazon.com/Test-Driven-Development-By-Example/dp/0321146530 | |
http://www.amazon.com/Extreme-Programming-Explained-Embrace-Edition/dp/0321278658/ref=pd_sim_b_3 | |
BDD: | |
story: | |
http://dannorth.net/whats-in-a-story/ | |
http://www.amazon.com/The-Cucumber-Book-Behaviour-Driven-Development/dp/1934356808 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
server_name crm.local; | |
root /var/www/crm/web; | |
location / { | |
# try to serve file directly, fallback to app.php | |
try_files $uri /app.php$is_args$args; | |
} | |
location ~ ^/(app|app_dev|config|install)\.php(/|$) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends "layouts/main.twig" %} | |
{% block title %}{{ post.title }}{% endblock %} | |
{% block description %}{{ post.getQuote() }}{% endblock %} | |
{% block keywords %}yii, yiiframework, юпи!, yupe, блог, записи{% endblock %} | |
{% block content %} | |
<section id="blog-post" class="light-bg"> | |
<div class="container inner-top-sm inner-bottom classic-blog"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace yupe\components; | |
use Symfony\Component\EventDispatcher\Event; | |
use Yii; | |
use CApplicationComponent; | |
use Symfony\Component\EventDispatcher\EventDispatcher; | |
class EventManager extends CApplicationComponent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function publish() | |
{ | |
$transaction = Yii::app()->db->beginTransaction(); | |
try | |
{ | |
$this->status = self::STATUS_PUBLISHED; | |
$this->publish_date = date('d-m-Y h:i'); | |
if($this->save()) { | |
Yii::app()->eventManager->fire(PostEvents::POST_PUBLISH, new PostPublishEvent($this, Yii::app()->getUser())); |
NewerOlder