Они используют Chromium . там открыт, и интерфейс и движок.
Eсли вам нужет только двиг то можно использовать Webkit.net. А если интерфейс + двиг . то без С++ не обойтись.
<?php
// src/Acme/DemoBundle/Entity/Category.php
namespace Acme\DemoBundle\Entity;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
/**
* @Gedmo\Tree(type="nested")
* @ORM\Table(name="categories")
* use repository for handy tree functions
* @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository")
*/
class Category
{
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;
/**
* @Gedmo\Translatable
* @ORM\Column(name="title", type="string", length=64)
*/
private $title;
/**
* @Gedmo\TreeLeft
* @ORM\Column(name="lft", type="integer")
*/
private $lft;
/**
* @Gedmo\TreeLevel
* @ORM\Column(name="lvl", type="integer")
*/
private $lvl;
/**
* @Gedmo\TreeRight
* @ORM\Column(name="rgt", type="integer")
*/
private $rgt;
/**
* @Gedmo\TreeRoot
* @ORM\Column(name="root", type="integer", nullable=true)
*/
private $root;
/**
* @Gedmo\TreeParent
* @ORM\ManyToOne(targetEntity="Category", inversedBy="children")
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE")
*/
private $parent;
/**
* @ORM\OneToMany(targetEntity="Category", mappedBy="parent")
* @ORM\OrderBy({"lft" = "ASC"})
*/
private $children;
/**
*
* @Gedmo\Translatable
* @Gedmo\Slug(fields={"title"})
* @ORM\Column(name="slug", type="string", length=128)
*/
private $slug;
public function getId()
{
return $this->id;
}
public function getSlug()
{
return $this->slug;
}
public function setTitle($title)
{
$this->title = $title;
}
public function getTitle()
{
return $this->title;
}
public function setParent(Category $parent = null)
{
$this->parent = $parent;
}
public function getParent()
{
return $this->parent;
}
}
use Acme\DemoBundle\Entity\Category as CategoryEntity;
// ... your code before
$em = $this->getDoctrine()->getManager();
$cat1= new CategoryEntity();
$cat1->setTitle('Фрукты');
$subcat = new CategoryEntity();
$subcat->setTitle('Экзотические');
$subcat->setParent($cat1);
$cat2 = new CategoryEntity();
$cat2->setTitle('Овощи');
$em->persist($cat1);
$em->persist($cat2);
$em->persist($subcat);
$em->flush();
// ...
$categoryEntity = $this->em->getRepository('Acme\DemoBundle\Entity\Category');
$categories = $categoryEntity->childrenHierarchy();
// ...
render
как раз для таких нужд{% render 'AcmeDemoBundle:User:login' %}
class LogListener implements EventSubscriber
{
private $container;
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
public function getSubscribedEvents()
{
return array(Events::postUpdate, Events::postPersist, Events::preRemove);
}
public function postUpdate(LifecycleEventArgs $eventArgs)
{
$this->log($eventArgs, Log::ACTION_UPDATE);
}
public function postPersist(LifecycleEventArgs $eventArgs)
{
$this->log($eventArgs, Log::ACTION_PERSIST);
}
public function preRemove(LifecycleEventArgs $eventArgs)
{
$this->log($eventArgs, Log::ACTION_REMOVE);
}
private function log(LifecycleEventArgs $eventArgs, $action)
{
$token = $this->container->get('security.context')->getToken();
if (!$token) {
return;
}
$user = $token->getUser();
if (!($user instanceof User)) {
return;
}
$entity = $eventArgs->getEntity();
if ($entity instanceof Log) {
return;
}
$request = $this->container->get('request');
$log = new Log();
$log->setAction($action);
$log->setUser($user);
$log->setIp($request->server->get('REMOTE_ADDR'));
$log->setEntityClass(get_class($entity));
$log->setEntityId($entity->getId());
$em = $this->container->get('doctrine')->getEntityManager();
$meta = $em->getClassMetadata(get_class($log));
$conn = $em->getConnection();
foreach ($meta->getReflectionProperties() as $fieldName => $reflProp) {
if (!$meta->isIdentifier($fieldName)) {
$columns[] = $fieldName;
$values[] = ':' . $fieldName;
}
}
$insertSql = 'INSERT INTO ' . $meta->getQuotedTableName($conn->getDatabasePlatform())
. ' (' . implode(', ', $columns) . ') '
. 'VALUES (' . implode(', ', $values) . ')';
$stmt = $conn->prepare($insertSql);
$fields = $meta->getFieldNames();
$association = $meta->getAssociationNames();
foreach ($meta->getReflectionProperties() as $fieldName => $reflProp) {
if (!$meta->isIdentifier($fieldName)) {
$value = $reflProp->getValue($log);
if (in_array($fieldName, $fields)) {
$mapping = $meta->getFieldMapping($fieldName);
$stmt->bindValue($meta->getColumnName($fieldName), $value, $mapping['type']);
} else if (in_array($fieldName, $association)) {
$classMeta = $em->getClassMetadata($meta->getAssociationTargetClass($fieldName));
list($classId) = $classMeta->getIdentifier();
$mapping = $classMeta->getFieldMapping($classId);
$associationIdProperty = $classMeta->getReflectionProperty($classId);
$associationValue = $associationIdProperty->getValue($value);
$stmt->bindValue($meta->getColumnName($fieldName), $associationValue, $mapping['type']);
} else {
throw new \Exception('Exception in log listener');
}
}
}
$stmt->execute();
}
}
находясь на сайте site.ru показать пользователю средствами js куки сайта статистики