0

I have one project in Yii 1, but i wan't develop some features in other framework, i choose Symfony.

The startpoint of website is a index.php from Yii1, but I build a selector by route to start one project in Yii1 or another proyect Symfony.

But when I include web/app.php i have this error:

 Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /vagrant/planetahuerto/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Bundle/Bundle.php on line 224

I use this code to load symfony project:

<?php
chdir("../planetahuerto/web/");
require 'app.php';
exit;

But i don't know why Kernel Bundle didn't throw this error.

Thx.

fermin
  • 635
  • 7
  • 25
  • Someone ask but no answers http://stackoverflow.com/questions/11786649/using-multiple-php-frameworks-on-one-website – fermin May 15 '17 at 16:07

1 Answers1

0

I think the simplest way to do this is by adding Http redirection in your .htaccess file. For this to work you'll need to choose a specific route prefix for your Symfony URLs

Exp:

RedirectMatch seeother ^/new$ /sf-project/

you can find more here

Community
  • 1
  • 1
Youssef
  • 1,033
  • 8
  • 16
  • If you make a RedirectMatch, it change url , I think i don't explain very well the problem. - urlWithString -> load sf project - rest of url's -> load yii project. I don't want change url. – fermin May 15 '17 at 15:42
  • RedirectMatch should not change your URL you can see here https://coolestguidesontheplanet.com/redirecting-a-web-folder-directory-to-another-in-htaccess/ – Youssef May 16 '17 at 08:37
  • I probe whit Redirect, but SF the have same error that when I load with php. – fermin May 16 '17 at 16:50