symfony-1.4

Symfony 1.4 with TCPDF: How to retrieve data from a database and show it as a .pdf file?

旧城冷巷雨未停 提交于 2019-11-28 11:09:22
问题 I work with Symfony 1.4. I want to create a pdf file using TCPDF with the content of a query involving multiple tables. Here my code in the actions.class.php: public function executeTest() { $this->conflictos1s = Doctrine_Core::getTable('Conflictos1') ->createQuery('a') ->leftJoin('a.SectorActividadCiuTa7') ->leftJoin('a.RelacionConflictualPrincipalTa9') ->leftJoin('a.SubsectorActividadTa8') ->leftJoin('a.DemandasTa2') ->leftJoin('a.ActoresTa1') ->leftJoin('a.Conflictos1HasActoresTa1') -

Force HTTPS using only HTACCESS in SYMFONY

佐手、 提交于 2019-11-28 01:44:54
问题 We have a Symfony 1.4 project and are looking to force https for all pages in a symfony application using only the htaccess file. I know there are ways to do using filters but I want to know if its possible to do without that first? Here is the .HTACCESS file I currently am using but isn't working as expected... RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L] RewriteCond %{REQUEST_FILENAME} !-f I've also tried without success: RewriteCond %

MySQL User defined variable within Doctrine and Symfony

懵懂的女人 提交于 2019-11-28 01:23:28
问题 I have the following Doctrine statement which works fine. $query = $this->createQuery('r') ->select('u.id, CONCAT(u.first_name, " ", LEFT(u.last_name,1)) as full_name, u.first_name, u.last_name, u.gender, r.run_time') ->innerJoin('r.ChallengeUser u') ->orderBy('run_time') ->execute(array(), Doctrine::HYDRATE_ARRAY_SHALLOW); I need to add a row count into this. Now I know with raw SQL you can do this; SET @rank=0; SELECT @rank:=@rank+1 as rank, u.id, u.first_name ....etc So my question is, how

SQL query with UNION in Doctrine Symfony

 ̄綄美尐妖づ 提交于 2019-11-27 17:02:51
问题 I have a question about the translation of a SQL query in Doctrine Symfony. I would like to do a thing like that : SELECT m.* FROM member m INNER JOIN ( SELECT id_member FROM friend WHERE id_friend=99 UNION SELECT id_friend FROM friend WHERE id_member=99 ) a ON m.id=a.id_member WHERE m.visible=1 In this example, i search all friends of the user 99. My tables : Member: (id, name, visible) Friend: (id, id_member, id_friend, active) Precision : I would like to use the Symfony pager. A solution ?

How to use Sessions in Symfony? [closed]

微笑、不失礼 提交于 2019-11-27 13:29:50
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . Like in classic PHP we use the magic variables to start and create sessions, so how to do that in Symfony? 回答1: In your controller, you can access session variables through the user object. // Get a session value

Porting a website from Symfony 1.4 to 2.0

故事扮演 提交于 2019-11-27 12:32:37
问题 I've got a huge site that has been written (in a very bad way) in symfony 1.4 now, I've been asked to make some substantial changes to the navigation flow, add some features and so on.. considering the effort, I was wondering if it would be better to take the radical decision to port the entire website to symfony 2.0, but I'm not sure how hard that it could be. Has anybody ever done this before? Do you have any suggestion to make for patterns to follow, or tutorials or doc or whatever? 回答1: