fuelphp

Multiple uploads to different directories using FuelPHP

空扰寡人 提交于 2019-12-11 17:57:36
问题 I'm trying to figure out how to deal with multiple uploads in FuelPHP. Basically this is an easy task, regarding the documentation. My problem is: I've got two files per POST, one pdf and one jpg. Now I want the jpg to be stored in another directory than the pdf. Is there any possibility to do so which I might habe missed? Thanks in advance! 回答1: Sorry for being stupid :D I really did miss the important note in the docs. So this is how I solved my problem: Upload::process(); if(Upload::is

Difference in Class Calling PHP

☆樱花仙子☆ 提交于 2019-12-11 15:23:03
问题 With learning fuelPHP, I am introduced on calling classes using scope resolution, or :: in sense. Typically, when we call a method in a class we do this ... $myclass = new myclass(); $myclass->mymethod(); On fuel, methods are usually called in this manner ... myclass::mymethod(); I was wondering if there are any difference between the two? Is the scope resolution is something of an update on 5.3 as well ... if not, which one is ideal, or when should I use these. Thanks. 回答1: The scope

Fuelphp Asset:: error

浪尽此生 提交于 2019-12-11 08:06:36
问题 Just testing out Fuelphp.. was wondering if anyone is aware of the issue with Asset:: call I implemented it in a template and got an error ( error view : 'url') thanks ps: I guess i need to set Asset::add_path(??) , I tried Asset::add_path('/assets/') but that didnt do it. 回答1: Due to inaccurate documentation i had the wrong syntax from the example : Asset::css('main.css') the correct syntax is : Asset::css(array('main.css')) 回答2: The documentation is actually acurate now. And Asset::css(

FuelPHP - Ordering Many to Many Relations

与世无争的帅哥 提交于 2019-12-11 05:17:11
问题 I checked the documentation, but can't seem to find what I'm looking for. I have two tables: Pages Layouts With a table between (pages__layouts) that does the many-to-many. This is working great. However, when referencing the relationship, I always want: $p->layout[1] To be the most recent layout that also has a status of 1. Is there a conditional many-to-many in the model or do I do this in the Controller when I reference the layout for the first time? I have just been using lazy loading to

Dynamic added form fields based on 1-to-n relation - What framework alternatives? [closed]

半城伤御伤魂 提交于 2019-12-06 14:44:52
Closed. This question is off-topic . It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . We have to develop a multi-model form that should use ajax calls to dynamically add or remove, sub-model fieldsets. For example, let's imagine this team form scenario : Team: Team Name: Team Country: Members: Member A name: Member A age: [add another member] [REGISTER TEAM AND MEMBERS] We are using Yii at the moment. As as far as we can tell Yii doesn't support this out of the box (nor there is any extension

PHP & Composer, how do I combine composer.json files

雨燕双飞 提交于 2019-12-06 08:14:03
问题 Can someone explain how I'm supposed to use composer with a php. I have a composer.json file in my doc root that downloads the core packages for my project, but then when I want to add another project like google+ php sdk found here https://github.com/googleplus/gplus-quickstart-php/ what do I do with that composer.json file? do i combine them manually? Do I just download that composer.json into a different dir? my current composer.json file looks like this { "name": "fuel/fuel", "type":

FuelPHP ORM database schema for i18n, opinions/suggestions

倾然丶 夕夏残阳落幕 提交于 2019-12-05 00:30:19
问题 While this question might be similar to many others, I'd like to ask for opinions/suggestions on the best approach for i18n specificaly on FuelPHP. So, here is what I've got so far: Database schema #1: models (id, name_pt, name_es, name_en, description_pt, description_es, description_en) Sample data #1: (1, 'Modelo', 'Modelo', 'Model', 'Descrição do modelo', 'Descripción del modelo', 'Model description') Pros: Straight and simple One table per model No need to use JOIN Use of a magic method

PHP & Composer, how do I combine composer.json files

房东的猫 提交于 2019-12-04 13:09:44
Can someone explain how I'm supposed to use composer with a php. I have a composer.json file in my doc root that downloads the core packages for my project, but then when I want to add another project like google+ php sdk found here https://github.com/googleplus/gplus-quickstart-php/ what do I do with that composer.json file? do i combine them manually? Do I just download that composer.json into a different dir? my current composer.json file looks like this { "name": "fuel/fuel", "type": "metapackage", "description": "The FuelPHP framework", "keywords": ["framework"], "homepage": "http:/

How to check whether the Redis server is running

给你一囗甜甜゛ 提交于 2019-12-03 09:44:43
How to check whether the Redis server is running? If it's not running, I want to fallback to using the database. I'm using the FuelPHP framework, so I'm open to a solution based on this, or just standard PHP. Frank de Jonge What you can do is try to get an instance (\Redis::instance()) and work with it like this: try { $redis = \Redis::instance(); // Do something with Redis. } catch(\RedisException $e) { // Fall back to other db usage. } But preferably you'd know whether redis is running or not. This is just the way to detect it on the fly. You can use command line to determine if redis is

Git Submodule Workflow Advice

杀马特。学长 韩版系。学妹 提交于 2019-12-03 05:16:01
问题 So I started using Git a few days ago. ( Very late to the party - don't scold :) ). Really starting to get comfortable with the basic commands, ideas and workflows. However, submodules are really taking my brain for a ride. I am attempting to contribute code to FuelPHP's GitHub and I could use some guidance and tips. I am running the following commands in the terminal: //1: clone the repository from Fuel's github. git clone git://github.com/fuel/fuel.git //2: move into the main fuel directory