symfony1

Where should I save my css and js files in Symfony project?

大憨熊 提交于 2019-12-11 13:50:12
问题 The docs seem unclear.I am not sure if I have to rewrite rules with apache so that their folder is staic or something? 回答1: the documentation is very specific about where to save your javascript & css files You save them in %SF_ROOT_DIR%/web/css and %SF_ROOT_DIR%/web/js . You then include them either in the view.yml or you include them manually on each page with use_javascript(''); and use_stylesheet(''); 回答2: Your CSS and JS files are stored in web/css and web/js respectively by default. You

Storing Session Data

给你一囗甜甜゛ 提交于 2019-12-11 12:43:39
问题 I have some rhetorical question regarding storing session data in Symfony. We can store session data as variables: // The First Example $this->getUser()->setAttribute('hash', $hash); $this->getUser()->setAttribute('name', $name); Or as an Array: // The Second Example $this->getUser()->setAttribute('something' , array('hash' => $hash,'name' => $name)); With the first example, we can use hasAttribute('name') to check if it's set and with the second example, we will need two lines of code for

foreign-key relationship with Doctrine concrete inheritance

蓝咒 提交于 2019-12-11 12:35:56
问题 In my schema, I have a generic table Animal and an inherited table Dog . Before using doctrine, I used to implement this pattern with an inherited id referencing the generic id as foreign key. I can't reproduce the same with Doctrine, and I feel like something is missing. The schema I used to produce is the following : CREATE TABLE `animal` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `color` VARCHAR(20) NOT NULL, PRIMARY KEY (`id`) ); CREATE TABLE `dog` ( `id` INT UNSIGNED NOT NULL, `breed`

Login to application with GET/POST token

。_饼干妹妹 提交于 2019-12-11 12:15:19
问题 I work on a Symfony web application which has a standard login form. To allow users to login more easily we want to give them a link which logs them in directly. I've already build a way to get a token to use, but I have no clue as to how the Symfony login process works, specifically how I can adapt it to take a GET/POST token instead of redirecting to the login page. Any help appreciated! Oh and this is Symfony 1.2 BTW (and no, upgrading is not an option right now) 回答1: Not sure if there are

how to secure an application by environment in symfony?

最后都变了- 提交于 2019-12-11 11:46:10
问题 i made a apps/frontend/config/security.yml dev: default: is_secure: false prod: default: is_secure: true but it is not working, am i missing something ? 回答1: As steve says, is_secure can't be configured on a per environment basis. My guess is that you are trying to password protect your entire dev environment? I'd suggest that you use .htaccess/.htpasswd protection or equivalent to protect a site in this way. If you can't or for whatever reason want to do it in symfony, you could make symfony

How can I check if it's sfguarduser s first logon in symfony?

喜你入骨 提交于 2019-12-11 11:44:39
问题 I want someone to enter their logon details and then the action to check if they are an existing user. If not, then I want them to have to select their department from a drop down, otherwise proceed as normal. I don't know whereabouts the logon is processed though to check if they are an existing user. Can anyone help? 回答1: In Symfony sfGuard, if someone isn't an existing user, they cannot login at all. This means that you should separate these into login and registration: If a user, go login

Symfony 1.4 Session vs $_SESSION Issues

丶灬走出姿态 提交于 2019-12-11 11:27:57
问题 I have a strange behavior when i'm working on my development Installation( Ubuntu 12.04 Firefox ). I store values into my Session like this in a Component Class(..Components.class.php) : $this->getUser()->setAttribute("ns1", myarray(), "globalNameSpace"); When this Controller is called i see into Debug Modus that User Session is set, but Globals Session($_SESSION) is not set, then i can't accessed the Session for example with $sf_user->getAttribute(...) . I should reload the whole Page to see

Orange HRM 3.1 leave list customization

被刻印的时光 ゝ 提交于 2019-12-11 11:07:51
问题 In orangehrm3.1 I want to customize view leave request page. If leave request day is greater than 3 I need to hide Actions list box for supervisor. How do I do this? Currently editing in LeaveListConfigurationFactory.php $leaveRequestService = new LeaveRequestService(); $header7->populateFromArray(array( 'name' => 'Actions', 'width' => '10%', 'isSortable' => false, 'isExportable' => false, 'elementType' => 'leaveListAction', 'textAlignmentStyle' => 'left', 'elementProperty' => array(

Removing table headers from embedRelation()

半世苍凉 提交于 2019-12-11 11:07:22
问题 I have used the embedRelation() to pull another form into the sfGuard user form. It is working correctly, I am just trying to style it to fit into the current form. This pulls the form in: $this->embedRelation('Profile'); but it is adding some extra html elements that I would like to remove: <div class="form_row"> Profile <table> <tbody><tr> <th><label for="sf_guard_user_Profile_department_title">Department</label></th> <td><input type="text" name="sf_guard_user[Profile][department_title]"

Adding a new user field to sfGuard user Admin Form

匆匆过客 提交于 2019-12-11 10:49:10
问题 I am trying to add a custom field to the user form in the sfGuard plugin. I have created the column in the database and added the widgetschema for the field. It is showing up correctly in the form, and when text is added and submitted, it is showing the update was successful. The data inserted into the field is not getting populated in the database though. I am thinking I have to update the model for sfGuard, as it is not aware of the new field. I have tried $ ./symfony doctrine:build-model ,